# Trim with Region Bug

**URL:** <https://discourse.mcneel.com/t/trim-with-region-bug/150263>\
**Category:** Grasshopper\
**Tags:** windows\
**Created:** [November 8, 2022, 5:30am UTC](https://discourse.mcneel.com/t/trim-with-region-bug/150263 "2022-11-08T05:30:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![attheeast18](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/attheeast18/32/613217_2.png) [@attheeast18](https://discourse.mcneel.com/u/attheeast18)\
**Post date:** [November 8, 2022, 5:30am UTC](https://discourse.mcneel.com/t/trim-with-region-bug/150263/1 "2022-11-08T05:30:06Z")

</div>

Good day,

I’m encountering a problem with the Trim with Region component. There are curves it doesn’t trim in that it’s still counted as inside the region.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/7/7/677988b168b4210af24c82c9a7d815d1791d5705.png)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/6/f/46fa76938181ffcd01d38b2950bc7a8b5e41d00a.png)

[Trim with Region Problem.gh](https://discourse.mcneel.com/uploads/short-url/apqFqUymlJIyXuCKOvX0mHypids.gh) (24.6 KB)

---

<div class="post-metadata">

**Author:** ![11159](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/11159/32/765292_2.png) [@11159](https://discourse.mcneel.com/u/11159)\
**Post date:** [November 8, 2022, 5:46am UTC](https://discourse.mcneel.com/t/trim-with-region-bug/150263/2 "2022-11-08T05:46:44Z")

</div>

Region must contain closed curves.

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

---

<div class="post-metadata">

**Author:** ![attheeast18](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/attheeast18/32/613217_2.png) [@attheeast18](https://discourse.mcneel.com/u/attheeast18)\
**Post date:** [November 8, 2022, 6:49am UTC](https://discourse.mcneel.com/t/trim-with-region-bug/150263/3 "2022-11-08T06:49:32Z")

</div>

I plugged in my surfaces directly as a region, it should be a closed region by then. It should trim the line considering it trimmed the others. I’m thinking maybe it’s a tolerance issue?

---

<div class="post-metadata">

**Author:** ![11159](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/11159/32/765292_2.png) [@11159](https://discourse.mcneel.com/u/11159)\
**Post date:** [November 8, 2022, 7:24am UTC](https://discourse.mcneel.com/t/trim-with-region-bug/150263/4 "2022-11-08T07:24:49Z")

</div>

You use Graft a lot so I am not sure if that is a bug or not.  
If you just want to trim, why not just draw a closed curve on the XY plane?

[Trim with Region Problem\_2.gh](https://discourse.mcneel.com/uploads/short-url/85wrhxahbYbph5yIIqsNpM49hNK.gh) (30.8 KB)

 ![Grasshopper_-_Trim_with_Region_Problem2](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/2/7/6279f9839f8bf58b37e73dd89e70f222d260bdbc.png)

---

<div class="post-metadata">

**Author:** ![attheeast18](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/attheeast18/32/613217_2.png) [@attheeast18](https://discourse.mcneel.com/u/attheeast18)\
**Post date:** [November 8, 2022, 9:38am UTC](https://discourse.mcneel.com/t/trim-with-region-bug/150263/5 "2022-11-08T09:38:23Z")

</div>

Is it not true that if I plug in my surface into the region input it automatically converts it to a closed curve? So all the things you mentioned I’ve already done.

---

<div class="post-metadata">

**Author:** ![inno](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/inno/32/544036_2.png) [@inno](https://discourse.mcneel.com/u/inno)\
**Post date:** [November 8, 2022, 11:42am UTC](https://discourse.mcneel.com/t/trim-with-region-bug/150263/6 "2022-11-08T11:42:40Z")

</div>

I think it could be a bug, for sure it does not behave as expected to my eyes

maybe @wim knows more about this 🙂

stupid experiment: 6 lines and a square, two lines lie exactly on square edges

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/f/d/f/fdfdd5b2377215fb7b9343fb370d53612d002641.png)  
[Trim\_With\_Region\_Bug.gh](https://discourse.mcneel.com/uploads/short-url/vJwoXmWAICq2AVSJWwICXahLqBR.gh) (10.1 KB)

result:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/5/4/7543c2493f07c2267281276e318c188b9eebc67a.png)

if the lines are flipped the same problem appears on the opposite side:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/2/3/0/230cf283422c6721f43ac6ff331426a5711fc173.png)

just for the sake of experimenting, shatter gives correct results:

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

* * *

just because of the particular situation in this unique case, flipping the original curves produce a result that happens to be correct, but the general case will still be wrong:

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/9/b/99b226aa6b9d389e1a4dafa72f3ec9396e23480e.png)  
[Trim with Region Problem\_Re.gh](https://discourse.mcneel.com/uploads/short-url/opa9FN5rpEYLnzbMhE6opQgXNCC.gh) (31.5 KB)

---

<div class="post-metadata">

**Author:** ![attheeast18](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/attheeast18/32/613217_2.png) [@attheeast18](https://discourse.mcneel.com/u/attheeast18)\
**Post date:** [November 9, 2022, 1:10am UTC](https://discourse.mcneel.com/t/trim-with-region-bug/150263/7 "2022-11-09T01:10:36Z")

</div>

Thank you for commenting on this. If memory serves correctly, I think i saw a similar thread with the issue being the tolerance. Coz when it comes to edges touching with edges i think in rhino it could be buggy. Hopefully mcneel fixes this soon.

---

<div class="post-metadata">

**Author:** ![daniel.locatelli](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/daniel.locatelli/32/671242_2.png) [@daniel.locatelli](https://discourse.mcneel.com/u/daniel.locatelli)\
**Post date:** [February 1, 2023, 5:51pm UTC](https://discourse.mcneel.com/t/trim-with-region-bug/150263/8 "2023-02-01T17:51:28Z")

</div>

Thanks @attheeast18, the document tolerance was the problem in my case!
