# Surfaces intersect

**URL:** <https://forum.dynamobim.com/t/surfaces-intersect/85154>\
**Category:** Geometry\
**Tags:** python, dynamo\
**Created:** [January 19, 2023, 3:15pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154 "2023-01-19T15:15:27Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanywillim](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hanywillim/32/155832_2.png) [@hanywillim](https://forum.dynamobim.com/u/hanywillim)\
**Post date:** [January 19, 2023, 3:15pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/1 "2023-01-19T15:15:27Z")

</div>

**Hi Everybody,**  
I am trying to get the intersections areas (to define them as openings in floors later) as showed in the photo how can I get it by dynamo nodes or even python code ?  
Any suggestions, Please?  
Thanks in advance

![qes](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/3/63f2c45d1c345b6af276748a29d603bf86e0ff3e.png)

I tried to use Geometry. intersect by give me 10 items of intersections and duplicate many surfaces and when i try to get the unique items still give me the 10 items!

 ![1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/f/6fb3be193ce696d4a63b37adf15591f1435cdeab.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [January 19, 2023, 3:40pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/2 "2023-01-19T15:40:25Z")

</div>

You’re on the right path. First, `List.UniqueItems` only works for comparable objects and surfaces are not comparable. That’s ok, you’ll just have to handle duplicates another way. Second, you don’t want to flatten your intersections since they’ll be grouped by surface already. It’ll be helpful to know which surfaces are intersecting later when you clean up duplicates. The problem right now is you’re intersecting each surface with itself, so you end up with 4 extra intersections. Keeping the intersections grouped allows you to identify and remove the self-intersections.

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [January 19, 2023, 3:44pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/3 "2023-01-19T15:44:04Z")

</div>

@hanywillim ,

like this…

 ![grafik](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/d/fd139a90382b12fb90337cb3864ce216fa9a2a1d.png)

KR

Andreas

---

<div class="post-metadata">

**Author:** ![hanywillim](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hanywillim/32/155832_2.png) [@hanywillim](https://forum.dynamobim.com/u/hanywillim)\
**Post date:** [January 19, 2023, 3:54pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/4 "2023-01-19T15:54:55Z")

</div>

Yes, you got my problem here but can you tell me exactly how to remove the self-intersections from the list ?

---

<div class="post-metadata">

**Author:** ![hanywillim](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hanywillim/32/155832_2.png) [@hanywillim](https://forum.dynamobim.com/u/hanywillim)\
**Post date:** [January 19, 2023, 3:58pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/5 "2023-01-19T15:58:19Z")

</div>

I actually simplified my question but in the fact i have a dozen of areas intersects each other so i can not use code block to select that indices as you did to avoid the self intersection.  
So if you can help by giving me a python code to use it in a wide way regardless the number of areas?

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [January 19, 2023, 4:01pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/6 "2023-01-19T16:01:35Z")

</div>

You know that each surface is going to intersect with itself so you either need to remove each surface from it’s own list of geometries to intersect or you need to remove the intersection from its respective index after all intersections have been found.

Essentially, you either need to:

1. Create a specific list of viable intersections for each surface. (S1 can intersect S2, S3, and S4 but not S1).
2. Find all intersections and then remove the self-intersection based on indices. (With 4 intersections each, index 0 would be a self-intersection item 0, index 1 would be a self-intersection with item 1, etc.)

Option 2 is probably the cleanest and pretty straightforward with the use of `List.RemoveItemAtIndex`.

---

<div class="post-metadata">

**Author:** ![hanywillim](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hanywillim/32/155832_2.png) [@hanywillim](https://forum.dynamobim.com/u/hanywillim)\
**Post date:** [January 19, 2023, 5:09pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/7 "2023-01-19T17:09:30Z")

</div>

Many thanks to you but i faced another problem after removed the self intersection i found 6 areas, and i tried to remove the duplicated areas but in vain beacuse dynamo consider them not eaqual? so any suggestions to keep only 3 areas ?

 ![2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/6/965130ed25d090de82f111a01ab3a487db298cf7.png)

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [January 19, 2023, 5:28pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/8 "2023-01-19T17:28:44Z")

</div>

This is the part that requires a little creativity. I don’t believe there is a way to definitively compare geometries, which means we have to do our best to make an educated guess and what’s considered “equal”. This basically means comparing geometric _properties_ until you have a reasonable level of confidence.

This could be as simple as comparing surface areas. If you know you have considerably different geometries and can make pairs with matching surface areas, then you can pretty confidently say those are duplicate surfaces. You can continue this kind of comparison with other properties (like perimeter length or even specific perimeter curves) to whatever level of confidence you think is necessary.

All of that being said, you have an easy out in this scenario. Because you’re already dealing with combined overlaps you don’t have any areas of further congruence. Simply put, your intersections are already isolated so you can do a really easy comparison of just the center points. I’d use `GroupByKey` to group the surfaces by center point (points are still uncomparable geometries so you’ll have to convert to a string) and then get a single surface from each group.

---

<div class="post-metadata">

**Author:** ![hanywillim](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hanywillim/32/155832_2.png) [@hanywillim](https://forum.dynamobim.com/u/hanywillim)\
**Post date:** [January 19, 2023, 6:31pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/9 "2023-01-19T18:31:22Z")

</div>

I really appreciate your time to help me and it works after I convert the center point to string and grouped them as you said.  
Thanks again my dear friend,  
God bless you always ❤

---

<div class="post-metadata">

**Author:** ![y.Petrenko](https://avatars.discourse-cdn.com/v4/letter/y/e95f7d/32.png) [@y.Petrenko](https://forum.dynamobim.com/u/y.Petrenko)\
**Post date:** [January 20, 2023, 9:49am UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/10 "2023-01-20T09:49:28Z")

</div>

hi  
as well easy solution

 ![Solution](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/8/983866f4cac594bc0788a54c39e9ad4f5de5ed40.png)

---

<div class="post-metadata">

**Author:** ![hanywillim](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hanywillim/32/155832_2.png) [@hanywillim](https://forum.dynamobim.com/u/hanywillim)\
**Post date:** [January 20, 2023, 11:16am UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/11 "2023-01-20T11:16:13Z")

</div>

Thanks for your concern,  
But where i can find “Surface.Downward” node, Is it in a package or updated dynamo version?  
and why you used code block after using list flatten at the beginning?

---

<div class="post-metadata">

**Author:** ![hanywillim](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hanywillim/32/155832_2.png) [@hanywillim](https://forum.dynamobim.com/u/hanywillim)\
**Post date:** [January 22, 2023, 9:56am UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/12 "2023-01-22T09:56:17Z")

</div>

Bro are you still here, I didn’t find this node yet?

---

<div class="post-metadata">

**Author:** ![y.Petrenko](https://avatars.discourse-cdn.com/v4/letter/y/e95f7d/32.png) [@y.Petrenko](https://forum.dynamobim.com/u/y.Petrenko)\
**Post date:** [January 23, 2023, 8:00am UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/13 "2023-01-23T08:00:55Z")

</div>

hi bro,  
Orchid.Common.Geometry.Surface.Downward

---

<div class="post-metadata">

**Author:** ![AM3D.BIM.STUDIO](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/am3d.bim.studio/32/127441_2.png) [@AM3D.BIM.STUDIO](https://forum.dynamobim.com/u/AM3D.BIM.STUDIO)\
**Post date:** [January 23, 2024, 8:32pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/14 "2024-01-23T20:32:07Z")

</div>

What version of orchid is that node in? I can’t find it =??

---

<div class="post-metadata">

**Author:** ![y.Petrenko](https://avatars.discourse-cdn.com/v4/letter/y/e95f7d/32.png) [@y.Petrenko](https://forum.dynamobim.com/u/y.Petrenko)\
**Post date:** [January 23, 2024, 9:11pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/15 "2024-01-23T21:11:22Z")

</div>

no possible to check - just take a bottom surface in any your possible way

---

<div class="post-metadata">

**Author:** ![AM3D.BIM.STUDIO](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/am3d.bim.studio/32/127441_2.png) [@AM3D.BIM.STUDIO](https://forum.dynamobim.com/u/AM3D.BIM.STUDIO)\
**Post date:** [January 23, 2024, 9:15pm UTC](https://forum.dynamobim.com/t/surfaces-intersect/85154/16 "2024-01-23T21:15:08Z")

</div>

😑 🫤 😟 🤔 🤔
