Splitting surface with curves python component in GH

Hi all,

I have several surfaces I have to split with curves within a grasshopper python component.
I think I have managed to split them and the result are breps. However, I need these breps inside the component to be surfaces/polysurfaces (I can’t output them and use a different component) but I don’t know how to convert them via script. Possibly due to my limited knowledge of Rhino Common.

See image and script below, should describe better what I am trying to do. Any ideas?

Thanks you so much in advance

  • surfaces contains all surfaces to be split (guids)
  • cuttercurves contains all curves used to split the surfaces (guids)

cut_surfaces_breps = [ ]
for surface in surfaces:

        cutter_elements = [rs.coercecurve(curve) for curve in cuttercurves]
        brep = rs.coercebrep(surface)
        split_brep = brep.Faces[0].Split(cutter_elements, 0.01)
        cut_surfaces_breps.append(split_brep)
  • how do I convert all cut_surfaces_breps to surfaces?

The image belows shows cute_surfaces_breps, but I need this to be as polysurfaces/surfaces within rhino

brep%20resulting

you can double check but i don’t think Polysurface is a Rhino.Geometry class. it’s probably just Brep.
so i think you can replace your last line with

for brep in split_brep:
    for bface in brep.Faces:
        cut_surfaces.append(bface)