I’m curious about how you would approach sampling contours positions from a pattern and using them to generate curves in Geometry Nodes. How would you align the curves to follow these contours effectively?
I’ve attached an example image and a .blend file for reference. I’d love to know a good way to approch this!
The key ingredient here is the “marching triangles surface” nodegroup from here by @higgsas. The version in the file is my own slightly-modified version (now using integer math nodes to be able to process larger meshes, and with iterative refinement of the boundary shape.)
In order to use that, you need a fine (subdivided) and triangular (triangulated) mesh.
What the Marching Triangles will give you is a set of mesh islands whose boundaries are given by the provided texture. From that, separate out the boundary edges (the edges that border exactly one face) and convert those edges to curves. To make the curves a little smoother, I then resampled them.
Reducing the subdivision, turning down the “refinement iterations” on the marching triangles nodegroup, and turning up the resampling length are ways to produce curves that still look smooth with less evaluation time.
In this case, because there’s a really big exponent in that “pattern to match” nodegroup, the refinement equation is stiff and evaluation is slow. But it probably still doesn’t need 128 iterations - I picked that before I threw the resampling on.