99% of the time, algorithms end up being way more frustrating and way less effective in code than they were in your head. Then, there’s that 1% of the time wherein divine powder falls from the sky, striking your code at a secret, magical angle that induces ridiculous levels of wow-this-just-works-ness. And then you ask “where’s the catch?” and hope that there isn’t one.
Such has been the story of SurfaceWrap, my work-in-progress surface-based scalar field polygonization algorithm. It’s remarkable how well it’s working so far. Granted, it’s still not adaptive nor self-stitching, so I’m hesitant to terminate my relationship with marching cubes just yet…but things are looking really, really good. I’ve run into a surprisingly small number of headaches, especially considering how hard I usually fail at writing topological algorithms.
Here’s the current state of the algorithm:
A few things to notice:
- The triangles cover the surface very smoothly and gradually without slivers or jaggies
- The consistency of the triangles is really nice! Looks like this algorithm is going to dominate with symmetric surfaces
- Approximate normals are calculated for free (no gradient evaluations!) during the process! BIG WIN!
- Although stitching isn’t yet implemented, no self-intersection has been observed (so long as the boundary isn’t allowed to wrap back around on itself). Looks like the small-angle-elimination feature is keeping everything in check
Next step: boundary merging/splitting. Pray for me.

2 ResponsesLeave a comment ?
This is actually amazing. I have been reading you blog for a while and decided to go back through some of your old posts. It struck me how useful and well done this project is. How is progress on it?
Good to hear! I assume you’re talking about SurfaceWrap in particular? I haven’t worked much on it since this post…new and interesting things keep popping up to distract me. I’ll come back to it sooner than later, though, since it’s so pivotal to everything I do. This is definitely a high-priority sub-project, so I’ll post any significant news that comes up.