Splitting a surface with a curve in grasshopper python?

Probably everyone knows, but if you want to use RhinoCommon functions instead of calling components, Surface Split is provided under a BrepFace.
So, you need to convert a surface to a Brep first, and access Faces[0] to call Split().

import Rhino.Geometry as rg  
#input :srf as Surface
#inpute :crvs as Curves
brep=rg.Brep.CreateFromSurface(srf)
srfs=brep.Faces[0].Split(crvs,0.0001)
3 Likes