Hi, I’m looking for a way to perform a boolean on any amount of curves at once in a sequence.
See this example:
And the GH file:
boolean_question_multiple.gh (13.2 KB)
I’ve tried different ways by using:
Clipper:
The issue is that it keeps the lines around the bottom edge with clipper, this means double lines where the curves intersect, which are unwanted.
(sorry for the messy drawing, I have a double wrist injury)
Make2D:
First making sure the curves are extruded into solids and placed on top of each other in the z-direction, but it didn’t work out for me as the curves that should be invisible, are still visible somehow despite getting the layering correctly.
Furthermore, I couldn’t find out how to use clipper to perform a repeating boolean that takes the previous shape and booleans it with the next one. It should at the same time perform a join boolean on all of the curves that are on top of the next, this shape will be used as the subtraction curve. This is because it also has to work with irregular curvy shapes that might sometimes cover also the second and third object underneath it.
So I think it works like this:
- Take curve 1
- Subtract curve 1 from curve 0
- Join curve 0 and 1
- Subtract the result of the join from curve 2
- Join curve 0, 1, 2
- Subtract that join from curve 3
- Join curve 0, 1, 2, 3
- Subtract that join from curve 4
All curves should be closed curves if it is done this way so it knows outside and inside.
It should do this, but it should also remove the lines where both curves share a boundary to make sure we don’t end up with double curves.
Now I’m working on a generator that generates multiple shapes at once, so for five items, sure, I can make a boolean stream with the output of the previous boolean being plugged into the next boolean (still an issue with double lines though), but I want to see if I can make it as flexible as possible and have the script generate this loop by itself, no matter how many curves are being plugged in.
This project has been on my wishlist since forever and I had hoped to be able to create this after a few months, but I have to give in and ask for advice. I have checked just about any topic on this but nothing that features an issue like this. Maybe I’m looking in the wrong corner.
If anything’s unclear, let me know!