# Splitting surface with curves python component in GH

**URL:** <https://discourse.mcneel.com/t/splitting-surface-with-curves-python-component-in-gh/86263>\
**Category:** Scripting\
**Tags:** ghpython, rhinocommon, grasshopper, python\
**Created:** [July 16, 2019, 4:20pm UTC](https://discourse.mcneel.com/t/splitting-surface-with-curves-python-component-in-gh/86263 "2019-07-16T16:20:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![revink](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/revink/32/657284_2.png) [@revink](https://discourse.mcneel.com/u/revink)\
**Post date:** [July 16, 2019, 4:20pm UTC](https://discourse.mcneel.com/t/splitting-surface-with-curves-python-component-in-gh/86263/1 "2019-07-16T16:20:52Z")

</div>

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](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/0/7/07b2558205186b1c7378a67941081d9580614acf.png)

---

<div class="post-metadata">

**Author:** ![Will\_Wang](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/will_wang/32/513624_2.png) [@Will\_Wang](https://discourse.mcneel.com/u/Will_Wang)\
**Post date:** [July 18, 2019, 12:52pm UTC](https://discourse.mcneel.com/t/splitting-surface-with-curves-python-component-in-gh/86263/2 "2019-07-18T12:52:08Z")

</div>

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

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

```
