C# Brep Split

Could you please help me solve the Brep Split in C#, when I use the example bellow I get 2 clones of the object I want to split, plus the original.
All I want to achieve is a regular split.

Thank you!

            ///This is for testing splitting of surfaces
            ObjRef srfRef;
            Result result = RhinoGet.GetOneObject("Pick surface to split", false, ObjectType.Surface, out srfRef);
            if (result != Result.Success)
                MessageBox.Show("Couldn't pick surface to split");
            var srfBrep = srfRef.Brep();
            ObjRef splitRef;
            result = RhinoGet.GetOneObject("Pick splitter", false, ObjectType.Surface, out splitRef);
            if (result != Result.Success)
                MessageBox.Show("Couldn't pick splitter");
            var splitBrep = splitRef.Brep();
            var breps = srfBrep.Split(splitBrep, Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance);
            foreach (var brep in breps)
                foreach (var bsurf in brep.Surfaces)

Hi Cristiane,

In order to add the brep with the trimming information created by split, you will need to add the brep and not the underlying untrimmed surfaces (brep.Surface). Iā€™m not familiar enough with C# but the pseudo code I think should be:

foreach( var brep in breps):


It works!

Thank you very much for your help!


1 Like