Brep boolean resulting in to many outputs

Hi there,
first of all, my enlgish isn’t very good - excuse me for that :slight_smile:

I’m working on a scribt to project 2d curves on a mesh/polysurface, representing a surface model.
The goal initially was to 1. project the curves on the DGM an 2. to make surfaces/ meshes from them.
I ran into multiple errors with that option. So i decided to cut out the 2d curves from the DGM.
so i extruded the curves- caped them and used them as cutting objects.
But somehow, the operation results in many more outputs than cutting objects.

I guess there also could be a better way to achieve my initial goal.

Maybe there is another way to achieve my initial idea to automatically “convert” a 2D plan to 3D for making fast visualizations.

I attached both files - 3dm and .gh.

I’m looking forward to some inputs.
Regards Beyon
Question.3dm (251.6 KB)
Question.gh (7.3 KB)

What is “DGM” ? I added a EL Sort cluster that sorts the results of your split by sum of edge lengths, then Shift List with ‘-1’ to ignore the largest (last) piece.


Question_2023Mar6a.gh (14.3 KB)

1 Like

You were faster, I was still searching for the source of errors.

First there is a line in the curves, which doesn’t result in a cutting surface. Therefore there should be 14 cutters, so 14 pieces out. Though there are 16 with this method.
Brep Join gives 12 because some pieces are adjacent.

If you really need one piece per cutter, graft the cutters, remove the largest piece in each branch, join the results and you’ll get 14.

Question_2023Mar6b.gh (25.5 KB)

1 Like

Wow! Thank you guys! It works perfectly!
I didn’t notices, there’s an extra line :slight_smile:
Somehow in my example file, all ist great. But in my original, working files with all the other scripts not every curve cuts the brep correctly… Maybe the file is corrupt or something?

Maybe your extrusion wasn’t long enough or positioned correctly? Here is another way to do that sort of thing with an expression on the Move ‘T’ (Motion) input: -x/2


Question_2023Mar6b.gh (12.6 KB)

It’s also possible that in some cases, removing only one piece after the split isn’t enough?

thanks for getting back.
I’m not sure why it sin’t working in my original file since everything is just copied out from it.

Your expressions are very helpful. I rarely use them, but they make the script much more organised.