@Helvetosaur wrote:
Why does Brep.Split completely fail if just one curve in a collection fails to split the brep?
import rhinoscriptsyntax as rs import scriptcontext as sc import Rhino, System from System.Collections.Generic import IEnumerable def SplitBrepWCrvs(brepID,crvIDs,tol,del_orig=True): brep=rs.coercebrep(brepID) crvs=[rs.coercecurve(crvID) for crvID in crvIDs] splits=brep.Split.Overloads[IEnumerable[Rhino.Geometry.Curve],System.Double](crvs, tol) if splits: if del_orig: rs.DeleteObject(brepID) return [sc.doc.Objects.AddBrep(brep) for brep in splits] brepID=rs.GetObject("Select surface",8) crvIDs=rs.GetObjects("Select curves",4) tol=sc.doc.ModelAbsoluteTolerance parts=SplitBrepWCrvs(brepID,crvIDs,tol) if not parts: print "Failed!" else: print "Surface split into {} parts".format(len(parts))
Select all the curves in the file below, it fails. Select only the black ones that go through the surface, it succeeds.
SplitSrfTest.3dm (318.5 KB)
Posts: 1
Participants: 1