Boolean difference - but for lines/curves?


Does anyone know if there is a node in Dynamo that does the same thing as boolean difference - but for lines or curves. I have one curve (a rectangle, the red one) and another set of curves (the balck ones). They are overlapping each other three times (see the blue arrows) and I would like to delete these overlapping parts from the red curve. Does anyone know how to do this?

Join the black lines (I assume some of them are multiple segments) into a polycurve and do a Geometry.Intersect with the red lines. That should get you what you want.

Okay thanks, but the problem is this curve (the rectangle inside a bigger rectangle). Since I have that in my set of black curves I cant join them… Do you have any ideas of how I can solve it?

The list for the black curves looks like this… So when I do polyline I only join the lines in each sublist…

here you can see the sublist for the big space (with the little space inside)

I guess you really don’t need to join them first. You can just get the intersecting geometry then join anything that needs to be joined afterwards.

Two sets of curves:

Overlapping curves:

Okay thank you :slight_smile: I did like this to find the intersection:

Do you or anyone else know how to find the non-intersecting curves? I would like to add these curves to my black “grid” of curves

Try Geometry.DoesIntersect. It gives a boolean for whether geometry intersects or not. Then you could use List.FilterByBoolMask to separate your geometry curves into intersecting and non-intersecting curves.