# Reset a curve domain in Rhinoscript?

**URL:** <https://discourse.mcneel.com/t/reset-a-curve-domain-in-rhinoscript/6496>\
**Category:** Scripting\
**Created:** [March 4, 2014, 8:48am UTC](https://discourse.mcneel.com/t/reset-a-curve-domain-in-rhinoscript/6496 "2014-03-04T08:48:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![filip\_rooms](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/filip_rooms/32/6370_2.png) [@filip\_rooms](https://discourse.mcneel.com/u/filip_rooms)\
**Post date:** [March 4, 2014, 8:48am UTC](https://discourse.mcneel.com/t/reset-a-curve-domain-in-rhinoscript/6496/1 "2014-03-04T08:48:03Z")

</div>

Dear members,

I am dealing with a closed curve in Rhinoscript that is trimmed to an open curve.

The curve is oriented that it goes from smaller values to larger values, but now the start point has a large negative number in the curve domain (-160) and the end point a curve parameter near zero (-2).

I would like to keep going from small to large but reparametrize the curve that the start point has value 0 and the end point a value like +160. How can I do this?

Kind regards,

Filip

---

<div class="post-metadata">

**Author:** ![djordje](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/djordje/32/747634_2.png) [@djordje](https://discourse.mcneel.com/u/djordje)\
**Post date:** [March 4, 2014, 10:39am UTC](https://discourse.mcneel.com/t/reset-a-curve-domain-in-rhinoscript/6496/2 "2014-03-04T10:39:18Z")

</div>

Hi Filip,

There’s no rhinoscript function which does this. But it could be done with RhinoCommon.

You can use curve’s “[Domain](http://4.rhino3d.com/5/rhinocommon/html/P_Rhino_Geometry_Curve_Domain.htm)” property to set its domain:

```python
domain = Rhino.Geometry.Interval(0, 160)
crv_obj.Domain = domain

```

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [March 4, 2014, 4:27pm UTC](https://discourse.mcneel.com/t/reset-a-curve-domain-in-rhinoscript/6496/3 "2014-03-04T16:27:17Z")

</div>

Hi Filip,

Why do you want or need to reparameterize the curve? What technical problem are you trying to solve?

– Dale

---

<div class="post-metadata">

**Author:** ![filip\_rooms](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/filip_rooms/32/6370_2.png) [@filip\_rooms](https://discourse.mcneel.com/u/filip_rooms)\
**Post date:** [March 4, 2014, 4:43pm UTC](https://discourse.mcneel.com/t/reset-a-curve-domain-in-rhinoscript/6496/4 "2014-03-04T16:43:50Z")

</div>

Hi Dale,

Thansk for taking interest in my question.

The problem is more one for backward compatibility of the code, since the older code assumed that curves start with a curve parameter at 0 and increase when following the curve to the end.

Today, I had a curve that started at -160 and went to 0. This is the correct direction: smaller values near the beginning, larger towards the end, but it would be nicer to let the beginning of the curve coincide with 0 and let the curve parameter increase to the end point for the curve direction of my choice. It would have saved me a couple of hours work today replacing our legacy code…

Thanks in advance,

Filip

---

<div class="post-metadata">

**Author:** ![dale](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/dale/32/685184_2.png) [@dale](https://discourse.mcneel.com/u/dale)\
**Post date:** [March 4, 2014, 5:07pm UTC](https://discourse.mcneel.com/t/reset-a-curve-domain-in-rhinoscript/6496/5 "2014-03-04T17:07:16Z")

</div>

Check the Rhino help file for information on the Reparameterize command.

---

<div class="post-metadata">

**Author:** ![filip\_rooms](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/filip_rooms/32/6370_2.png) [@filip\_rooms](https://discourse.mcneel.com/u/filip_rooms)\
**Post date:** [March 11, 2014, 9:48am UTC](https://discourse.mcneel.com/t/reset-a-curve-domain-in-rhinoscript/6496/6 "2014-03-11T09:48:44Z")

</div>

Thanks, that did the trick 😉
