Boundary surface issue

Hello All,

It’s me again, I have a simple question for you guys.

The question is that I have a bunch of enclosed curve here, and I use the polyline offset first, and then I connect the original enclosed curve and the Contour curve from the polyline offset to the flatten boundary surface component, but the surface I got is the surface containing all the area within the contour curve, what I want is just the area between the contour and original curve, more like a ring. I have use the same way to do other single enclosed curve and it worked, but for thosed enclosed curve, it is not, any suggetions? THX!

Mingbang

boundary surface issue.3dm (11.4 MB) boundary surface issue.gh (5.9 KB)

Here is a way.
Flatten lose the global logic for boundary surfaces. Graft enable to have a logic per shape.
Please don’t put a tolerance = 1 mm for terrain modelling. I put 1 m.

By the way it is a limitation of Grasshopper because as there are no mouse click to tell the code which curve is inside or outside the code has to make his own assumptions.
In Clipper legacy algorithm they choose to say that counter clockwise curve are outside curves. So you could decide which curve is the outside or a hole.

1 Like

Hello Laurent,

Thanks for that, I am just a beginner and still a long way to go, and your advice is very helpful and I appreaciate your continuing help for those days, thanks so much!!! Problem solved

Best Regards
Mingbang

It is not so simple because all tools doesn’t work the same. There are lot of things to learn. I also learned more the clipper way some weeks ago and I had to make my own library to solve the same problems as yours.
The logic implemented in Clipper is worth to be known if you continue in GIS domain
http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Types/PolyFillType.htm

1 Like

Thanks so much, I think I need to learn the data tree and the logic behind how GH manage to use the data. One more question, I use your way, but there are still two curves still not like ring as you can see from the image.

I look at it, this are some clear limitation of Boundary surface. For my self I will opt for more internal work with some script to sort the curves, inner outer … then put the correct winding, then make the area calculation depending on the winding …
Here boundary surface has some problem with you high resolution curves. Then some others I don’t know why.
With high tolerance it seems to work better


boundary surface issue.gh (289.5 KB)
You can also use Branch component to explore which branch isn’t working and which workflow make it work …

Thanks for your effort! With your help I am almost done with my project, many thanks!

If you try to get the ring by just using the most regular way with those two enclosed curve, it will work. Then the hard part will be how to combine all those curves together and then get the expected result, btw what do you mean by the high resolution? you mean there are too many control points for the curve?

The logic to combine curve depends on the input.
Here graft has a limitation because there is no merge if 2 curves are too close.
The good way could be
Offset the whole set of curves with Clipper without graft
For each offset output search curves that are inside (the holes). Use that to make the “border surfaces”. There was some discussion on that king of problem on this forum, I think it was related to fast way to draw buildings using GIS building contour.

Yes high resolution means too many controls points. For some reason Boundary surface doesn’t like it, it is more a limitation or a bug of the tool.

Got it, thanks!

If you think your solution is somewhat generic, let me know, I’m glad to add stuff to clipper if needed.

In the past I’ve opted to keep the usage of the offset and booleans somewhat simple, because using things can become quite complex, in a short amount of time.

The options you refer to are also ported in the PolylineBoolean component, except that I skipped the options for Positive and Negative windings, since they’re quite esoteric.

You have done a very good job and as Rhinoceros and Grasshopper doesn’t use the winding logic you don’t have to make modifications that will add complexity.

I mentioned this because it could be very useful for some uses. For my own problems I had to develop some 2D processing that requires this logic as I use Clipper library. It is also a very good strategy when the objects are not real surfaces and are just described by frontiers.

1 Like

Just a small observation in your model: It’s pretty far away from the origin (8 to 9 decimal places for meters). In general double floating point numbers (what rhino uses) can handle about 15 to 17 decimal places of precision, and since in CAD we often do stuff where you have to square things, you may quickly run into rounding errors when far away from the origin.

My advice: Place your geometry closer to the origin, if you can. If you start seeing some weird clipping issues, or strange tolerance problems, remember that it can be because you’re far away from the origin.

One thing I always want in Clipper (unless it is there already) is the ability to give the Polyline Offset zero distance so it just creates regions / cells from overlapping Polylines. Currently, I get away with it in a way by doing a small offset like 0.001. Would be nice to have it at 0.0.

P.S. your Polyline Boolean component has a duplicate description for input A and B they both say “The first polyline”.

Clipper is awesome!

Thanks for the kind feedback!

Good idea. The thing is that clipper upstream does not support offsets of 0 (it won’t do any processing, just return things that are closed already). But I’ll try if to figure out if it’s a trivial hack or a few phd’s worth of work to get it working.

Otherwise, I’ve also been able to figure out a way that works ok-ish with curves. (But I’m pretty sure it’ll not be on the fire-and-forget level of clipper).