Extruding solid / closed Brep ? [Solved] Solid Union trouble

Hi everybody, I am running into some issue I don’t really understand. (working with R6 and Gh for R6)

For a complex joinery system I am trying to extrude solid Breps (that represent the tenons) along their assembly axis.
To do so I deconstruct the Brep and extrude individually each sub-surface, I then get rid of the surface that extrude into flat surfaces (aka Open-Brep) so I can do a Solid-Union on the resultings breps in order to rebuild the extrusion of my original Brep.

As you can see in the attached file it works fine for the item 0 of my list but the same process does not work for item 1 and 2. And I cant figure out why. Does anyone know what could be the issue ? (the following screenshots illustrate the expected result when it works (item 0) )

I know solid-union are best fitted for overlapping Breps, but it seems my process may generate some not overlapping breps but I think it is out of my range to control this, plus it does work with items 0.

Is there any other way to do it ? Or any recommended plugin ? !

20180824_Solid union Solid brep.gh (33.8 KB)

20180824_Solid union Solid brep.gh (60.8 KB)
Is that waht you want

Vous ici !

Anyway lovely way to do it, very practical. I actually just solved it as well, in a more analytical way.

Basically what I did was to study the deviation of the vector in relation to the frame on which lies every single subsurface. Using a ‘tolerance value’ I could cull faces that will lead to a bad (flat) result.

here is my solution : 20180824_Solid union Solid brep.gh (33.4 KB)

However I feel my first try was also a good way to go, but despite the check for Open Brep, some Brep should have been culled but did not, for an unknown reason. @DavidRutten you might maybe have a look at it (play with the slider in the very first definition to review what I am talking about)