# Interactive surface mesh refinement Runs in your browser through [numbl](https://numbl.org) — no install. ## ▶ [Open `refine_demo.m`](refine_demo.m) and click **Run** A cubed-sphere [surfacefun](https://github.com/danfortunato/surfacefun) mesh appears in the figure. Drag the **Refinement level** slider: the page sends the level back to the script, which refines the mesh with surfacefun and returns the new patches — the surface re-renders in place (drag to rotate, scroll to zoom). It's a live demo of numbl's `uihtml` two-way bridge: data flows script → figure, and the slider drives work back in the interpreter, figure → script. ## How it works - [`refine_demo.m`](refine_demo.m) — the whole user-facing script: load surfacefun, build a mesh, and hand it to `mesh_refiner`. - `mesh_refiner.m` — the plumbing: opens the figure, sends the mesh to it, and refines the mesh on each slider change (the script → figure → script wiring). - `app/` — a small React/three.js app (built to a single HTML file) that renders the surface with numbl's own surface renderer and hosts the slider. On every push to `main`, the [deploy workflow](.github/workflows/deploy.yml) builds the app, bundles the project with the numbl browser IDE, and publishes it to GitHub Pages.