Splitting a surface with multiple surfaces

Hello, I apologize in advance for any mistake. It’s my first time around Rhino.

I’m trying to split a surface using multiple surfaces. This is something I’d do very easily via the interface by using the Split command, selecting the first surface and then the other surfaces.

Via code I was able to make it work for a simpler model by using a simple for cycle and SplitBrep (in RhinoScriptSyntax), by iteratively calling SplitBrep on the last brep returned by the function.

This works because I know that the first element of the returned array is the non-splitted brep but will fail for more complex models because I don’t know what returned brep still needs splitting.

Is there a way to make it work like the Split command (that seems to handle everything by itself)?

Thanks in advance.

Hi @o11225669,

There are three new Brep.Split overrides included with RhinoCommon for Rhino 6 SR13:

// Splits a Brep into pieces using Breps as cutters.
Brep[] Brep.Split(IEnumerable<Brep> cutters, double intersectionTolerance);

/// Splits a Brep into pieces using curves, at least partially on the Brep, as cutters.
Brep[] Brep.Split(IEnumerable<Curve> cutters, double intersectionTolerance);

// Splits a Brep into pieces using a combination of curves, to be extruded, and Breps as cutters.
Brep[] Brep.Split(IEnumerable<GeometryBase> cutters, Vector3d normal, bool planView, double intersectionTolerance);

I am guessing one of these will help.

– Dale

Thank you for your answer @dale.

In the end I solved by creating a brep with all the cutters and passing it to the SplitBrep method. It worked fine but the new methods are surely easier to use. Thanks!