Implicit surfaces

Can’t help you with C++, but here’s about the simplest C# implementation I can come up with: boundaries.gh (11.7 KB)

It’s a bit simpler than the approach you referenced; instead of tracking both a lower and an upper threshold and creating the space in between I’m only comparing the triangle corners to a single value. If all three corners are either below or above the threshold, no shape is outputted for that triangle. If one corner is on the opposite side of the other two, then either a triangle or a quad is appended to the the output list. The benefit of this is that there’s only eight cases to take into consideration, rather than the 27 posted above.

Doing it this way at least gives you a result that could not possibly have been accomplished with the Mesh/Intersection approach I suggested as an alternative.

I hope the code is readable enough to help you further along.