# Trim Surfaces

**URL:** <https://forum.dynamobim.com/t/trim-surfaces/50964>\
**Category:** Alias\
**Tags:** dynamo\
**Created:** [May 22, 2020, 10:11am UTC](https://forum.dynamobim.com/t/trim-surfaces/50964 "2020-05-22T10:11:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![gianbupa](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@gianbupa](https://forum.dynamobim.com/u/gianbupa)\
**Post date:** [May 22, 2020, 10:11am UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/1 "2020-05-22T10:11:54Z")

</div>

Hello,  
I’m having a problem trimming curves or even solids with some surfaces I import from Alias.

I always get the inner trim of a circle, instead of the main surface with a hole.

Can Anyone explain the exact method to trim a curve or solid into a surface?

When I’m home I’ll be able to post a screenshot of the code, as at work I can’t do it.

Thanks

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [May 22, 2020, 11:32am UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/2 "2020-05-22T11:32:25Z")

</div>

Two methods:

[https://dictionary.dynamobim.com/#/Geometry/Geometry/Action/Trim](https://dictionary.dynamobim.com/#/Geometry/Geometry/Action/Trim)

[https://dictionary.dynamobim.com/#/Geometry/Surface/Action/TrimWithEdgeLoops](https://dictionary.dynamobim.com/#/Geometry/Surface/Action/TrimWithEdgeLoops)

---

<div class="post-metadata">

**Author:** ![Michael-GG](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@Michael-GG](https://forum.dynamobim.com/u/Michael-GG)\
**Post date:** [May 24, 2020, 5:20pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/3 "2020-05-24T17:20:19Z")

</div>

Actually there is one more, which we used for our sample files:  
Surface.SubtractFrom  
It takes a surface, and a solid (which can be several, not intersecting bodies) which is then removed (=trimming) form that surface. This is especially useful, if the entities you want to trim out of your surfaces vary in amount and shape, due to changing script parameters.  
Hope that helps,  
GG

---

<div class="post-metadata">

**Author:** ![gianbupa](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@gianbupa](https://forum.dynamobim.com/u/gianbupa)\
**Post date:** [June 16, 2020, 2:45pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/4 "2020-06-16T14:45:12Z")

</div>

Sorry my late reply.  
I’m still having problem trimming surfaces. The only way I can manage is to covert it into a solid and then use Solid.DifferenceAll to make holes.  
I’ve an issue I’m having with TrimWithEdgeLoops. It keeps trimming the outer surface filling the holes instead.  
I’ll post a screenshot to show what happens.

Maybe I’m doing something wrong.

Any help appreciated. 😉

 ![trimwithedgeloops](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/3/5372fefa0b3ff678cfcc7779ecad966797b0cd93.jpeg)

---

<div class="post-metadata">

**Author:** ![gianbupa](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@gianbupa](https://forum.dynamobim.com/u/gianbupa)\
**Post date:** [June 16, 2020, 2:48pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/5 "2020-06-16T14:48:24Z")

</div>

Jacob,  
tried both but none of them worked for me ;(

---

<div class="post-metadata">

**Author:** ![Michael\_Kirschner2](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michael_kirschner2/32/75576_2.png) [@Michael\_Kirschner2](https://forum.dynamobim.com/u/Michael_Kirschner2)\
**Post date:** [June 16, 2020, 3:08pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/6 "2020-06-16T15:08:09Z")

</div>

try the surface difference nodes

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 16, 2020, 3:11pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/7 "2020-06-16T15:11:36Z")

</div>

Looks like there is a bug in the Trim with Edge loops as it’s behaving the exact opposite of what the diagram shows. Fortunately there is a "Surface.TrimWIthLoopsFix in the springs package that should do what you need. The node has no call to anything resources Dynamo so you should be able to leverage this in any environment.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/7/b75f37983196d57a49630cd38135ab1770ca474d.png)

---

<div class="post-metadata">

**Author:** ![Michael\_Kirschner2](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michael_kirschner2/32/75576_2.png) [@Michael\_Kirschner2](https://forum.dynamobim.com/u/Michael_Kirschner2)\
**Post date:** [June 16, 2020, 3:13pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/8 "2020-06-16T15:13:10Z")

</div>

I think to get trimWithEdgeLoops to work as you expect you just need to add an outer loop around the interior loops. (ie a loop around the entire surface)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 16, 2020, 3:17pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/9 "2020-06-16T15:17:24Z")

</div>

Well this is certainly a bug…

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/5/25594b234f6231d5f43dcb0f0df2a80a96ed46a8.jpeg)

Faster and more stable than the custom node, so this is the work around for now. Not sure how it’ll handle surfaces which are not coplanar but with testing out @gianbupa.

@Michael_Kirschner2 I’m filing the GitHub issue now. 🙂

---

<div class="post-metadata">

**Author:** ![Michael\_Kirschner2](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/michael_kirschner2/32/75576_2.png) [@Michael\_Kirschner2](https://forum.dynamobim.com/u/Michael_Kirschner2)\
**Post date:** [June 16, 2020, 3:17pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/10 "2020-06-16T15:17:59Z")

</div>

I don’t think this is a bug.

---

<div class="post-metadata">

**Author:** ![Aparajit\_Pratap](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Aparajit\_Pratap](https://forum.dynamobim.com/u/Aparajit_Pratap)\
**Post date:** [June 16, 2020, 3:41pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/11 "2020-06-16T15:41:18Z")

</div>

@jacob.small @gianbupa by definition of the TrimWithEdgeLoops node, this is unfortunately not a bug. One is expected to provide all the edges of the surface, both outer and interior ones for the node to work as expected.

---

<div class="post-metadata">

**Author:** ![gianbupa](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@gianbupa](https://forum.dynamobim.com/u/gianbupa)\
**Post date:** [June 16, 2020, 3:58pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/12 "2020-06-16T15:58:03Z")

</div>

Ok, giving the outline of the surface it works.  
Although is quite annoying as concept.

but now I have another issue.  
It works with a single surface like a rect, but I work with complex surfaces and sometimes I use objects containing over 20 small surfaces.  
It seems to work but everytime I press RUN, I have a different result.  
Sometimes holes half cut, sometimes I get errors and now, for example, I get nothing

It seems I have to start scripting to get what I want and I didn’t really wanted to start coding.

---

<div class="post-metadata">

**Author:** ![Aparajit\_Pratap](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Aparajit\_Pratap](https://forum.dynamobim.com/u/Aparajit_Pratap)\
**Post date:** [June 16, 2020, 5:46pm UTC](https://forum.dynamobim.com/t/trim-surfaces/50964/13 "2020-06-16T17:46:53Z")

</div>

Could you share a graph with some example workflows which are not working.
