# Splitting a Surface with Intersecting Breps fails pretty often

**URL:** <https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778>\
**Category:** Grasshopper\
**Tags:** windows, python, rhino7, grasshopperrhino\
**Created:** [August 29, 2023, 11:59pm UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778 "2023-08-29T23:59:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cooper\_Copetas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cooper_copetas/32/485205_2.png) [@Cooper\_Copetas](https://discourse.mcneel.com/u/Cooper_Copetas)\
**Post date:** [August 29, 2023, 11:59pm UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/1 "2023-08-29T23:59:29Z")

</div>

Hello,

Anyone have a workaround to split the surface of a sphere with these cutting curves? Every surface split generates an incorrect result.

I’ve attempted a few python solutions too, but never seems to spit out something proper.

Thanks  
[Earth.gh](https://discourse.mcneel.com/uploads/short-url/pg5eYIhMZmGJ8V8DGm0FucWKFCO.gh) (862.2 KB)

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [August 30, 2023, 12:53am UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/2 "2023-08-30T00:53:24Z")

</div>

![missing](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/2/e/c/2ec2be7a1ecace1444408976fc3f3f7ab00d5f2c.png)

I got around that but **OUCH** ❗ It is painfully slow before even trying to split the sphere.

 ![Earth_2023Aug29a](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/0/0/c00c6a8744c9a730a190ef26eecf0752bdfdde45.png)

And I wonder if the extrusions even intersect the sphere fully? To be sure, I’m inclined to scale up the extrusions or the joined curves that are extruded… Yes, I can see that works better:

 ![Earth_2023Aug29a2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/0/4/004e727337247e490b606ffe1da0db526f8b6c30.png)  
[Earth\_2023Aug29a.gh](https://discourse.mcneel.com/uploads/short-url/a2mkeuYMvPUmZbhP8RDDPJdXY2p.gh) (854.5 KB)

My inclination is to try SplitMul first - I’ll let you know.

**P.S.** How to choose which parts of the split sphere to view if either method succeeds?  
**P.P.S.** My laptop is running too hot, I may kill this before it completes. 😢

Later - I quit, burn up your own computer if you must - I don’t see the point of damaging mine.

---

<div class="post-metadata">

**Author:** ![Ryan14](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ryan14/32/498212_2.png) [@Ryan14](https://discourse.mcneel.com/u/Ryan14)\
**Post date:** [August 30, 2023, 12:56am UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/3 "2023-08-30T00:56:47Z")

</div>

`PullCurve` is much faster on this than brep Intersection by the way at 530ms 🙂

---

<div class="post-metadata">

**Author:** ![Ryan14](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ryan14/32/498212_2.png) [@Ryan14](https://discourse.mcneel.com/u/Ryan14)\
**Post date:** [August 30, 2023, 1:45am UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/4 "2023-08-30T01:45:40Z")

</div>

Best I have, not perfect though. Splitting the sphere in half actually helped it. As @Joseph_Oster said though, How to sort the surfaces? Good luck 🙂  
[Earth (1).gh](https://discourse.mcneel.com/uploads/short-url/61vy0V1bFzYWsSM1Am1mAok5rl4.gh) (851.9 KB)

---

<div class="post-metadata">

**Author:** ![michaelvollrath](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/michaelvollrath/32/479405_2.png) [@michaelvollrath](https://discourse.mcneel.com/u/michaelvollrath)\
**Post date:** [August 30, 2023, 3:59am UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/5 "2023-08-30T03:59:20Z")

</div>

Hi @Cooper_Copetas ,

This is a tricky one…

I have heeded the warnings of others and noted that this one is a real CPU hog.

I added some optimizations to cull bad lines, and filter by tolerance for the outline sizes.

If you need every single island, you will need to take the time to compute it.  
If you can get away with the earth looking correct in general, it can be a significant performance boost.  
Your call, it should work either way.

Thankfully when it comes to separating the split faces, we can exploit the fact that the oceans will return the largest “single” surface and cull or filter other faces accordingly.

The longest computation time is the Extrude To Point component. Not even sure if that’s what you’re after or if you simply need to split the sphere with the boundary curves?

If that takes too long, you can utilize the Loft logic I added where we scale the curves to near 0 and loft between them. Creating the tapered to point illusion while giving a performance boost.

Graph Space:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/5/1/45121e7ed04686ff71894d0f429ce77775aa4fa6.png)

Model Space:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/3/e/73e2f014ddfb766b091e9996d7272abe019b560f.jpeg)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/8/9/78958004e95fa5832de4755bb661ea79fa175cc4.jpeg)

Hope this helps you!

[20230829\_Earth\_Split\_Response\_01a.gh](https://discourse.mcneel.com/uploads/short-url/ufAA7I6XlkAqXCYO56O3qrZdWz8.gh) (869.1 KB)

---

<div class="post-metadata">

**Author:** ![Cooper\_Copetas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cooper_copetas/32/485205_2.png) [@Cooper\_Copetas](https://discourse.mcneel.com/u/Cooper_Copetas)\
**Post date:** [August 30, 2023, 1:49pm UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/6 "2023-08-30T13:49:45Z")

</div>

All,

Thanks for giving it a shot!  
Sorry I forgot to leave a disclaimer that your CPU might melt…

@Joseph_Oster I gave those a shot too, does not work. I think it’s an issue inherent to the splitting functions in grasshopper unfortunately.

@Ryan14 That’s a good tip – saves me the trouble of making the extrusions.

@michaelvollrath Thanks for this interesting workaround. Size filtering does help expedite the testing to see what works and what doesn’t. What I’m looking is to isolate only the landmass boundaries as spherical cut-outs. That was why I made the extrusions in the first place to cut the sphere. I can just adjust the selection from the cut surface list to pick the landmasses only.

It does cripple the Sphere (Ocean) but landmasses come out good

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/0/7/f/07fde3bcef56814fc89f5789deaaaa3d4f0073cf.jpeg)  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/3/d/53dd8039180c7e9825a417d697fcb50063f0c0ca.jpeg)

🙂

---

<div class="post-metadata">

**Author:** ![Ryan14](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/ryan14/32/498212_2.png) [@Ryan14](https://discourse.mcneel.com/u/Ryan14)\
**Post date:** [August 30, 2023, 2:35pm UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/7 "2023-08-30T14:35:45Z")

</div>

> [@Cooper\_Copetas](#):
>
> Sorry I forgot to leave a disclaimer that your CPU might melt

Ha no worries! Its been a long time sinse I worked my CPU that hard. It needed a workout anyways 😉

---

<div class="post-metadata">

**Author:** ![michaelvollrath](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/michaelvollrath/32/479405_2.png) [@michaelvollrath](https://discourse.mcneel.com/u/michaelvollrath)\
**Post date:** [August 30, 2023, 7:55pm UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/8 "2023-08-30T19:55:15Z")

</div>

Nice, I’m glad that worked. Just out of curiosity, what did your computation time end up being?

---

<div class="post-metadata">

**Author:** ![Cooper\_Copetas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cooper_copetas/32/485205_2.png) [@Cooper\_Copetas](https://discourse.mcneel.com/u/Cooper_Copetas)\
**Post date:** [August 30, 2023, 10:38pm UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/9 "2023-08-30T22:38:03Z")

</div>

1.2 Minutes. Not too bad actually… It only partially fused to my motherboard.

---

<div class="post-metadata">

**Author:** ![michaelvollrath](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/michaelvollrath/32/479405_2.png) [@michaelvollrath](https://discourse.mcneel.com/u/michaelvollrath)\
**Post date:** [August 30, 2023, 10:39pm UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/10 "2023-08-30T22:39:13Z")

</div>

That was around my time as well. Good haha no computers were harmed in the making of this globe

---

<div class="post-metadata">

**Author:** ![Joseph\_Oster](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/joseph_oster/32/549124_2.png) [@Joseph\_Oster](https://discourse.mcneel.com/u/Joseph_Oster)\
**Post date:** [August 30, 2023, 10:45pm UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/11 "2023-08-30T22:45:33Z")

</div>

Not posting your code? 🥱

---

<div class="post-metadata">

**Author:** ![Cooper\_Copetas](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/cooper_copetas/32/485205_2.png) [@Cooper\_Copetas](https://discourse.mcneel.com/u/Cooper_Copetas)\
**Post date:** [August 31, 2023, 12:42am UTC](https://discourse.mcneel.com/t/splitting-a-surface-with-intersecting-breps-fails-pretty-often/164778/12 "2023-08-31T00:42:41Z")

</div>

Oh I’m still messing with this script (adding features like landmass extrusions and filtering out seas using layers), but the bulk is resolved by Michael (I copied the script here). I brought it down to 18.3s.

Cheers!

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/8/0/c804f9f167ff249d97e27afc8739de031883c882.png)

[Earth Workaround.gh](https://discourse.mcneel.com/uploads/short-url/ox6OFim3CrofZmMYdGPmMhWJu8V.gh) (865.4 KB)
