4 ms·
Simplest possible smooth contouring algorithm
- fwip 8y agoWhat makes this the simplest possible algorithm?
- Scarblac 8y agoAs opposed to, say, drawing a circle large enough to encompass all the points.
- andrewla 8y agoVery interesting, and I like the interactive graphics. I've been looking at this problem recently with an eye towards what it looks like to translate scene descriptions from an SDF (signed distance function) representation of a CSG (constructive solid geometry) scene to a triangular-mesh representation. I've looked at marching cubes, which has another page on this site that is linked from this page, but it seems kind of inelegant. The obvious problem with this method is that it relies in the underlying object being smooth, and many CSG designs have cusps and other non-smooth artifacts that are very hard to derive from an abstract representation because the SDF is not well-behaved around those regions.
- okaleniuk 8y agoTry dual contouring. It preserves sharp features from the box. When combined with octrees, it's much more effective than the simple thing. https://www.cse.wustl.edu/~taoju/research/dualContour.pdf https://www.cse.wustl.edu/~taoju/research/dualContour.pdf
- lalaithion 8y agoIt's pretty easy to create weird loops in the contour by placing two dots with about ~0.5r of distance between the edges.
- jerrysievert 8y agoI really have a problem with this article, not because of the algorithm, but because of the presentation: for(x...) for(y...) for(z...) { ... } I believe that code should at least attempt to be literate, and this just makes me shake my head in frustration.
- karmakaze 8y agoI see no problem with this and do it myself if autoformat doesn't undo it. This is being literate (evaluating over a space of three dimensions) rather than literal (of nested loops).