How to split a brep with multiple surfaces

Hello,

I’m trying to split this singular brep with multiple surfaces which have been constructed on a series of planes. From my limited understanding the split brep multiple component should resolve this. However, it doesn’t seem to be working in this particular scenario unless I convert the surfaces into breps by adding a thickness. The problem with that is it isn’t what I want to do as it adds small surfaces between the larger ones.

Here is the script working with the surfaces converted to breps but adds extra surfaces which is not the result I wanted.

GH script: Balustrade_Design_230916_help.gh (48.0 KB)

Thank you for your help in advanced!

Hi, I think having a circle like surface is problematic for Brep Split.

You can split the curves and then after do the loft.

Balustrade_Design_230916_help_re.gh (51.7 KB)

1 Like

Mysterious. Your code looks OK to me. Tried several variations of it but all fail the same way. Looks like a GH flaw to me.

Also confirmed that adding thickness (0.0001) to the cutters works.

Balustrade_Design_2023Sep16a
Balustrade_Design_2023Sep16a.gh (63.6 KB)

1 Like


Instead, use the one from Flexibility.
Flexibility | Food4Rhino

1 Like

Found this:

and cobbled together this Python from it, which appears to work:

import Rhino.Geometry as rg
import scriptcontext as sc

tol=sc.doc.ModelAbsoluteTolerance

cutter = rg.Brep()
for b in cutters:
    cutter.Append(b)

pieces = brep.Split(cutter, tol)


Balustrade_Design_2023Sep16b.gh (47.9 KB)

https://discourse.mcneel.com/search?q=split%20brep%20python

https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.brep/split

1 Like

Just being redundant/curious:

what @ShynnSup is doing seems like a good alternative, though there’s no reason things shouldn’t work the way @adam_murray272 is trying?

still no splitting…same with Rhino 8 - since I always deal with this and will probably face it again, copying @GregArden :saluting_face:

Thank you all for taking the time to look at this issue. It’s been insightful to always looking at all your solutions as I’m still learning Grasshopper!

Just to note here that I have found that this also sometimes fails…

Does it depend on tolerance? (‘View | Display Options… | Units | Absolute tolerance’)

IIRC in certain input cases where the cutters themselves intersected, it created non-manifold objects.

Thanks. In this case, the cutters do not intersect each other.

Yep, that was just for general info…

I just adjusted the cutters so that some DO intersect each other and the Python ‘Rhino.Geometry / Brep / Split’ method works fine. That post I referenced was from 2017, maybe they fixed it since then?


Balustrade_Design_2023Sep16bb.gh (29.2 KB)

The algorithm used in the SplitBrepMultiple component is at fault. RH-77129 Grasshopper Component SplitBrepMultiple doesn’t work in a case that works in Rhino Split command. This component needs to be rewritten to follow the logic that the RhinoCommand uses to perform split.

3 Likes

Is not visible to the public…

Well, your python does not work in the following case (cylinder and 4 intersecting planes).

However, Instead of constructing the merged brep as you did, I use
Rhino.Geometry.Brep.MergeBreps(breps,tol)

MergeSplitTest.gh (12.9 KB)

This works for this case. My original comment was based on the fact that I found notes in several of my scripts from a couple of years ago that this method could also fail. It is possible that this has been worked on since then. Unfortunately, I did not keep any of my failure examples to test now.

My Python? That code was from Dale Fugier.

MergeBreps, of course! Why didn’t I think of that? :slight_smile: Thanks, it works well.

Description:

Combines two or more breps into one. A merge is like a boolean union that keeps the inside pieces. This function creates non-manifold Breps which in general are unusual in Rhino. You may want to consider using JoinBreps or CreateBooleanUnion functions instead.

OK, sorry about that…

Thanks. It is now.
-wim