# Extract underlying surface from Brep

**URL:** <https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668>\
**Category:** Grasshopper Developer\
**Tags:** windows\
**Created:** [March 3, 2025, 9:12pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668 "2025-03-03T21:12:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bakuri\_Gogua](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bakuri_gogua/32/680287_2.png) [@Bakuri\_Gogua](https://discourse.mcneel.com/u/Bakuri_Gogua)\
**Post date:** [March 3, 2025, 9:12pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/1 "2025-03-03T21:12:29Z")

</div>

Hello,  
Can anyone please help me properly extract the underlying trimmed surface from Brep?

 ![r1](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/9/b/c9b3055689656eed92d95c083a1b3cc79e176f97.png)  
 ![r2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/a/e/9/ae922d1c5eff33324970647604316834ac564b18.png)

---

<div class="post-metadata">

**Author:** ![leopoldomonzani](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/leopoldomonzani/32/637191_2.png) [@leopoldomonzani](https://discourse.mcneel.com/u/leopoldomonzani)\
**Post date:** [March 3, 2025, 9:58pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/2 "2025-03-03T21:58:49Z")

</div>

![img1](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/3/c/f3caa0182fd31210095c7223298951ea3409d717.jpeg)

---

<div class="post-metadata">

**Author:** ![Bakuri\_Gogua](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bakuri_gogua/32/680287_2.png) [@Bakuri\_Gogua](https://discourse.mcneel.com/u/Bakuri_Gogua)\
**Post date:** [March 3, 2025, 10:49pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/3 "2025-03-03T22:49:04Z")

</div>

Hello, @leopoldomonzani,  
It is easy to do with the Grasshopper’s native components… I want it inside my GH C# protect using VS. Also, the image I provided is just for sample, the curves tend to be more than 2 (see pic).  
anyway, thank you so much. 🙏

 ![r3](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/2/f/02fac19aba50619dba50dc5b7dc61d5f8d559498.png)

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [March 4, 2025, 4:03pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/4 "2025-03-04T16:03:03Z")

</div>

Hi @Bakuri_Gogua,

Can you post a .GH file that doesn’t work the way you want? Also please provide a .3DM file that contains both the result you are looking for?

Thanks,

– Dale

---

<div class="post-metadata">

**Author:** ![Bakuri\_Gogua](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bakuri_gogua/32/680287_2.png) [@Bakuri\_Gogua](https://discourse.mcneel.com/u/Bakuri_Gogua)\
**Post date:** [March 4, 2025, 7:25pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/5 "2025-03-04T19:25:16Z")

</div>

Hi @dale, I have it in my C# Visual Studio project, so I can’t technically provide that component, but upload the files:

1. the code behind  
 ![code](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/2/6/12658b8a35fbc450a2d43d373c2cdd568256584f.png)
2. image  
 ![gh.PNG](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/3/a/63a771e322b64f901f456f56a46e968f180a96ab.png)

[rhino.3dm](https://discourse.mcneel.com/uploads/short-url/ng8K6kEr3r1iVG0c7uWGNtMhlsv.3dm) (41.7 KB)  
[gh.gh](https://discourse.mcneel.com/uploads/short-url/u9CaiF2u3imwXg9IXcBkJkmVWxz.gh) (2.9 KB)

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [March 4, 2025, 8:09pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/6 "2025-03-04T20:09:08Z")

</div>

Hi @Bakuri_Gogua,

See the attached.

[TestBakuri.gh](https://discourse.mcneel.com/uploads/short-url/tsBvPAK6BuTErf0CdDwwqvhlG5.gh) (6.1 KB)

– Dale

---

<div class="post-metadata">

**Author:** ![Bakuri\_Gogua](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bakuri_gogua/32/680287_2.png) [@Bakuri\_Gogua](https://discourse.mcneel.com/u/Bakuri_Gogua)\
**Post date:** [March 4, 2025, 9:50pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/7 "2025-03-04T21:50:19Z")

</div>

@dale, my apologies; I could not clearly explain what I want. I want the result of the Rhinocommon method Brep.CreatePlanarBreps() as Surface inside my project (VS C#), to manipulate on it. ( CreatePlanarBreps() returns the trimmed surface but is as a Brep array).

 ![finR](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/b/4/7/b47178cdb91779287c4a1658c5aea36b1e3c47a8.png)

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [March 4, 2025, 10:13pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/8 "2025-03-04T22:13:59Z")

</div>

Hi @Bakuri_Gogua,

In your case, the results of `Brep.CreatePlanarBreps` cannot be represented as a surface because it has “holes”. Thus, it must be represented as a [Brep](https://en.wikipedia.org/wiki/Boundary_representation).

If the `Brep` has a single face and that face is geometrically the same as the underlying surface (i.e., the face has trivial trimming), then it could be represented by a `Surface`.

– Dale

---

<div class="post-metadata">

**Author:** ![Bakuri\_Gogua](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bakuri_gogua/32/680287_2.png) [@Bakuri\_Gogua](https://discourse.mcneel.com/u/Bakuri_Gogua)\
**Post date:** [March 5, 2025, 5:54am UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/9 "2025-03-05T05:54:53Z")

</div>

Hello @dale,  
I got it, thanks 🙏.  
Just a quick question, does this mean that the GH native component “Boundary Surfaces” uses a different method? because it returns the results as Surface.  
Is it possible to extrude the resulted trimmed surface(Brep) using Rhinocommon? What is the best way?

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [March 5, 2025, 5:54pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/10 "2025-03-05T17:54:29Z")

</div>

> [@Bakuri\_Gogua](#):
>
> does this mean that the GH native component “Boundary Surfaces” uses a different method?

If you pass in a single curve and that curve is a polyline curve, then the `Boundary Surfaces` component uses [Brep.CreateFromCornerPoints](https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.brep/createfromcornerpoints) to create the `Brep`. If the resulting `Brep` has a single face and that face is geometrically the same as the underlying surface, then GH will report it as an untrimmed surface.

– Dale

---

<div class="post-metadata">

**Author:** ![Bakuri\_Gogua](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bakuri_gogua/32/680287_2.png) [@Bakuri\_Gogua](https://discourse.mcneel.com/u/Bakuri_Gogua)\
**Post date:** [March 5, 2025, 6:59pm UTC](https://discourse.mcneel.com/t/extract-underlying-surface-from-brep/200668/11 "2025-03-05T18:59:48Z")

</div>

🙏 🙏 🙏
