# Divide/Trim/Redraw segment of a curve

**URL:** <https://discourse.mcneel.com/t/divide-trim-redraw-segment-of-a-curve/59275>\
**Category:** Grasshopper\
**Created:** [March 29, 2018, 9:09am UTC](https://discourse.mcneel.com/t/divide-trim-redraw-segment-of-a-curve/59275 "2018-03-29T09:09:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![javiergonzalezcastil](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/javiergonzalezcastil/32/678385_2.png) [@javiergonzalezcastil](https://discourse.mcneel.com/u/javiergonzalezcastil)\
**Post date:** [March 29, 2018, 9:09am UTC](https://discourse.mcneel.com/t/divide-trim-redraw-segment-of-a-curve/59275/1 "2018-03-29T09:09:27Z")

</div>

Hello,

I have an ellipse with 2 points in the curve. How could I trim the curve between this 2 points?

 ![Untitled-1](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/d/b/dbc10810990b23334fe366cfe59eee8023641893.jpg)

---

<div class="post-metadata">

**Author:** ![DavidRutten](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidrutten/32/755688_2.png) [@DavidRutten](https://discourse.mcneel.com/u/DavidRutten)\
**Post date:** [March 29, 2018, 9:20am UTC](https://discourse.mcneel.com/t/divide-trim-redraw-segment-of-a-curve/59275/2 "2018-03-29T09:20:39Z")

</div>

In all likelihood an ellipse in GH is a NurbsCurve. Closed nurbs curves have _seams_, which is where the start and end of the curve meet. You can trim a curve to a subdomain on its interior, but that subdomain cannot include the seam.

What you will have to do to guarantee this works is adjust the seam to be on top of one of the points, _then and only then_ figure out the closest parameters of both points and then trim the adjusted ellipse.

1. Curve Closest Point to find the parameter for the new seam.
2. Seam to modify the seam location.
3. Curve Closest Point twice to find the trimming parameters on the adjusted ellipse.
4. Sub Curve to trim to new interior domain.

But even now of course the question is whether you get the short portion of the ellipse or the long one.

Alternatively, your approach could be more like \_Split instead. You get forget about seams, just find the parameters on the ellipse closest to your points, shatter your ellipse at those parameters (the Shatter component is smart enough to take seams into account), then figure out which of the two remaining elliptical segments you want to keep. The shortest? The longest? The one closest to some other point?

---

<div class="post-metadata">

**Author:** ![javiergonzalezcastil](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/javiergonzalezcastil/32/678385_2.png) [@javiergonzalezcastil](https://discourse.mcneel.com/u/javiergonzalezcastil)\
**Post date:** [March 29, 2018, 9:33am UTC](https://discourse.mcneel.com/t/divide-trim-redraw-segment-of-a-curve/59275/3 "2018-03-29T09:33:53Z")

</div>

Thank you very much. Maybe I wasn’t enough specific. What I want to get is the short segment curve of the ellipse (between the 2 points).

I am trying to did what you proposed. I post the files in case you find the solution before than me. Thanks again.[Delphinarium Hall.3dm](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/f/8/f88f8a2b3c9a955be0f713425eeeb5f7826ea894.3dm) (30.8 KB)  
[Delphinariu Hall\_Grasshopper.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/5/8/585495f867ef883e7d188d5ce062ffdf90c9c83e.gh) (18.9 KB)

---

<div class="post-metadata">

**Author:** ![Regee](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/regee/32/521613_2.png) [@Regee](https://discourse.mcneel.com/u/Regee)\
**Post date:** [March 29, 2018, 10:45am UTC](https://discourse.mcneel.com/t/divide-trim-redraw-segment-of-a-curve/59275/4 "2018-03-29T10:45:41Z")

</div>

Like this ?

 ![Delphinariu%20Hall_Grasshopper_r](https://global.discourse-cdn.com/mcneel/original/3X/1/5/15e2e952ecd1bce662106a26ce91be9e99b6ff3c.png)

[Delphinariu Hall\_Grasshopper\_r.gh](https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/9/7/97263b74017a823cca4c9cacb3b98f4790844fb6.gh) (12.3 KB)
