# Rebuild or add Knots?

**URL:** <https://discourse.mcneel.com/t/rebuild-or-add-knots/205010>\
**Category:** Rhino\
**Created:** [May 26, 2025, 4:44am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010 "2025-05-26T04:44:00Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![guido](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/guido/32/761602_2.png) [@guido](https://discourse.mcneel.com/u/guido)\
**Post date:** [May 26, 2025, 4:44am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/1 "2025-05-26T04:44:00Z")

</div>

I just noticed that adding knots gives me a much lower deviation than rebuilding. I’m surprised that rebuild accuracy is so low. I’m just looking at arcs. it might be different with more complex curves. Insights?  
[Rebuild-Vs-Knots.gh](https://discourse.mcneel.com/uploads/short-url/eF2zzHUZNcrdE4wGijuzsu1JZvv.gh) (11.3 KB)

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

---

<div class="post-metadata">

**Author:** ![Jakob\_v\_Schirmeister](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jakob_v_schirmeister/32/762103_2.png) [@Jakob\_v\_Schirmeister](https://discourse.mcneel.com/u/Jakob_v_Schirmeister)\
**Post date:** [May 26, 2025, 8:31am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/2 "2025-05-26T08:31:45Z")

</div>

the definition you uploaded does not contain a rebuild or adding knots.  
so we can not know how the curves are made, changed

---

<div class="post-metadata">

**Author:** ![TomTom](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tomtom/32/651939_2.png) [@TomTom](https://discourse.mcneel.com/u/TomTom)\
**Post date:** [May 26, 2025, 8:45am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/3 "2025-05-26T08:45:53Z")

</div>

I don’t know what you want to achieve. But rebuild is intended to clean-up curves. Deviation to the original curve is even desired to reach this goal. Arcs are special, because they are weighted. To replace an arc with a un-weighted Nurbs/Bezier curve, you need to do a bit more. In Rhino I’m not aware of a proper conversion, because a simple, unweighted Nurbs/Bezier curve cannot properly represent an arc or circle. For a circle, a good approximation with Beziers requires 4 “Order-7” Bezier curves

---

<div class="post-metadata">

**Author:** ![guido](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/guido/32/761602_2.png) [@guido](https://discourse.mcneel.com/u/guido)\
**Post date:** [May 27, 2025, 8:16am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/4 "2025-05-27T08:16:34Z")

</div>

Yeah, sorry it’s supposed to be a rhino post not a grasshopper one. The script is there just to measure the deviation. The construction is straightforward. Say you have an arc with 3 control points but you need more (in my case I need to manipulate it to create a bulge in elevation and an arc in plan and maintain end tangents)  
How to do that while minimising deviation? Somehow I thought rebuilding would be a good method. Clearly inserting knots returns a curve closer to the original. Not sure if you have better suggestions.

---

<div class="post-metadata">

**Author:** ![guido](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/guido/32/761602_2.png) [@guido](https://discourse.mcneel.com/u/guido)\
**Post date:** [May 27, 2025, 8:21am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/5 "2025-05-27T08:21:05Z")

</div>

I’m intrigued by why you would ever desire deviation

---

<div class="post-metadata">

**Author:** ![TomTom](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tomtom/32/651939_2.png) [@TomTom](https://discourse.mcneel.com/u/TomTom)\
**Post date:** [May 27, 2025, 8:30am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/6 "2025-05-27T08:30:39Z")

</div>

> [@guido](#):
>
> I’m intrigued by why you would ever desire deviation

Because you can not force a curve/surface to be “cleaner” in any circumstances.

It depends a bit on what your overall goal is. You did not elaborate yet.  
If you want to add or remove cps, you should use degree elevation. You can also refit/-approximate a curve. But Rhino does not offer the best functionality for this, IMHO.

In my understanding ‘rebuild’ improves the quality of the curve, by moving cps in a more relaxed position. This improves the overall flow-of-curvature etc.. But you cannot move cps without deviating. Its just not possible…

---

<div class="post-metadata">

**Author:** ![guido](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/guido/32/761602_2.png) [@guido](https://discourse.mcneel.com/u/guido)\
**Post date:** [May 27, 2025, 11:10am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/7 "2025-05-27T11:10:21Z")

</div>

I elaborated a little in response to Jakob:

> [@guido](#):
>
> Say you have an arc with 3 control points but you need more (in my case I need to manipulate it to create a bulge in elevation and an arc in plan and maintain end tangents)  
> How to do that while minimising deviation?

I guess you’re right, and I’m realising this was a pretty lazy post.  
The Rebuild icon in Grasshopper kind of proves your position

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/9/4/7945c76583b51fd7a4cb21b81de591463a8e2933.png)  
In addition, there are a bunch of rebuild options here that I’ve ignored:  
 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/7/d/47dd01aa081488b7e0a75685eecc534d87a38a40.png)  
“rebuild to master curve” and “rebuild non-uniform”  
I probably should test these out and come back.

---

<div class="post-metadata">

**Author:** ![TomTom](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tomtom/32/651939_2.png) [@TomTom](https://discourse.mcneel.com/u/TomTom)\
**Post date:** [May 27, 2025, 12:24pm UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/8 "2025-05-27T12:24:30Z")

</div>

[you can try change degree…](https://docs.mcneel.com/rhino/mac/help/en-us/commands/changedegree.htm) .

This adds control-points without deviation. But still. An arc is a weighted/rational nurbs. You might use a blend curve instead of an arc. I think there is no easy conversion to a non-rational Nurbs. But try changing the degree first.

---

<div class="post-metadata">

**Author:** ![Jakob\_v\_Schirmeister](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jakob_v_schirmeister/32/762103_2.png) [@Jakob\_v\_Schirmeister](https://discourse.mcneel.com/u/Jakob_v_Schirmeister)\
**Post date:** [May 27, 2025, 2:41pm UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/9 "2025-05-27T14:41:00Z")

</div>

I would expect rising degree to cause deviation too unless you work singlespan.

---

<div class="post-metadata">

**Author:** ![davidcockey](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidcockey/32/732604_2.png) [@davidcockey](https://discourse.mcneel.com/u/davidcockey)\
**Post date:** [May 27, 2025, 3:33pm UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/10 "2025-05-27T15:33:39Z")

</div>

**InsertKnot**  **does not change the degree or shape of the curve.** It will increase the number of spans by the number of knots inserted. InsertKnot works on rational curves including arcs as well as nonrational curves.

> [@Jakob\_v\_Schirmeister](#):
>
> I would expect rising degree to cause deviation too unless you work singlespan.

When **ChangeDegree** is used to increase degree of a **single span curve** the result has **zero deviation** from the input. and will be a single span curve.

When **ChangeDegree** with **Deformable=No** is used to increase degree of a **multispan curve** the result has **zero deviation** from the input, the number of spans is unchanged, and will has multiknots.

When **ChangeDegree** with **Deformable=Yes** is used to increase degree of a **multispan curve** the result will **usually deviate** from the input, the number of spans is unchanged, the result \*\* doesnot have multiknots\*\* (unless the input had multiknots).

> [@TomTom](#):
>
> An arc is a weighted/rational nurbs. You might use a blend curve instead of an arc. I think there is no easy conversion to a non-rational Nurbs. But try changing the degree first.

An arc cannot be represented exactly by a non-rational NURBS curve. An arc can be approximated by a non-ration NURBS curve within an desired accuracy by combinations of degree and number of spans.

For example a 90 degree arc with radius 1 can be approximated by:  
Degree 3 single span 4 control points - max deviation 0.0027  
Degree 3 two span 5 control points - max deviation 0.0004  
Degree 3 three span 6 control points - max deviation 0.00007  
Degree 5 single span 6 control points - max deviation 0.00002  
Degree 7 single span 8 control points - max deviation 0.00000007  
These approximations were obtained using Rebuild

---

<div class="post-metadata">

**Author:** ![davidcockey](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidcockey/32/732604_2.png) [@davidcockey](https://discourse.mcneel.com/u/davidcockey)\
**Post date:** [May 27, 2025, 4:15pm UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/11 "2025-05-27T16:15:19Z")

</div>

> [@TomTom](#):
>
> But rebuild is intended to clean-up curves. Deviation to the original curve is even desired to reach this goal.

> [@TomTom](#):
>
> In my understanding ‘rebuild’ improves the quality of the curve, by moving cps in a more relaxed position. This improves the overall flow-of-curvature etc.. But you cannot move cps without deviating. Its just not possible…

I have a very different understanding of the Rebuild command in Rhino. _My understanding is based on studying numerical methods, experimentation with Rhino, and occasional comments and answers to questions by McNeel staff on this forum. I do not have any direct knowledge of the Rhino code._

There is nothing in how Rebuild works which inherently leads to “moving cps in a more relaxed position. This improves the overall flow-of-curvature etc.” Depending on the shape of the input curve and the degree and number of control points selected for the rebuild, the resulting curves may have control points with large oscillations compared to the input curve. This is more likely the higher the degree of the result. (See the bottom of this post for a simple example of using Rebuild to a single span degree 7 curve from a single span degree 3 curve.)

Rebuild uses a simpler interpolation algorithm which only uses a small number of points on the input curve as input to the algorithm, and then fits a curve to those points.

The basic method used by the Rebuild command:  
Points with equal arc length spacing on the input curve are created. The number of points equals the number of control points specified for the result. The curve with the specified degree and number of control points is determined which has edit points coinciding with the points along the input curve.

If the “Preserve end tangent directions” and/or “make SubD friendly” options are selected then determination of the curve is modfied to satisfy those options, but it is still interpolation through a set of points.

Example of using Rebuild from single span degree 3 to single span degree 7:  
[Rebuild3to7 DC01.3dm](https://discourse.mcneel.com/uploads/short-url/yg9MMhUrKwfATyerrqkG9WyTlnn.3dm) (52.2 KB)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/d/8/c/d8c47d0cb6488bc82a1a948a477ca40e7259dce9.png)

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

---

<div class="post-metadata">

**Author:** ![Jakob\_v\_Schirmeister](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/jakob_v_schirmeister/32/762103_2.png) [@Jakob\_v\_Schirmeister](https://discourse.mcneel.com/u/Jakob_v_Schirmeister)\
**Post date:** [May 28, 2025, 6:57am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/12 "2025-05-28T06:57:34Z")

</div>

> [@davidcockey](#):
>
> When **ChangeDegree** with **Deformable=No** is used to increase degree of a **multispan curve** the result has **zero deviation** from the input, the number of spans is unchanged, and will has multiknots.

thank You for the explenation. _MULTIKNOTS_ - didn´t knew

---

<div class="post-metadata">

**Author:** ![TomTom](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tomtom/32/651939_2.png) [@TomTom](https://discourse.mcneel.com/u/TomTom)\
**Post date:** [May 28, 2025, 7:21am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/13 "2025-05-28T07:21:37Z")

</div>

> [@davidcockey](#):
>
> Degree 5 single span 6 control points - max deviation 0.00002

This is a typical blend curve and the deviation is very acceptable. Other than that, I was exactly writing this in the previous post. But maybe he doesn’t need to have an exact arc at all.

> [@davidcockey](#):
>
> Rebuild uses a simpler interpolation algorithm which only uses a small number of points on the input curve as input to the algorithm, and then fits a curve to those points.

Yes you are right here, but this essentially often leads to a better curve (if the desired cp-count is lower), even with strong oscillation. So yes, the second part of my statement was inaccurate. But its not the complete different. The interpolation will move the cps in a better, more equidistant position.  
I would also assume that there is a smoothing part in this algorithm. But that doesn’t mean that smoothing or interpolation always work as expected. This is also true for any fitting operation. And essentially this together sometimes leads to these strange result as shown.

---

<div class="post-metadata">

**Author:** ![davidcockey](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/davidcockey/32/732604_2.png) [@davidcockey](https://discourse.mcneel.com/u/davidcockey)\
**Post date:** [May 28, 2025, 10:52am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/15 "2025-05-28T10:52:16Z")

</div>

> [@TomTom](#):
>
> I would also assume that there is a smoothing part in this algorithm.

I have not seen any evidence in my experiments with the Rebuild command algorithm that suggest it includes any smoothing. The results are consistent with interpolation without modification.

The higher the degree of the polynomial used in interpolation through points the greater the tendency for oscillations to occur. That is how the math works. I first heard about this during a course in numerical methods almost fifty years ago. It was given as a primary reason to use multi-span splines of lower degree for interpolation in preference to higher degree single span curves.

The ChangeDegree command in Rhino appears to use a fundamentally different method, not interpolation, which does not result in such oscillations. I assume it uses a degree change algorithm which calcuates the new control points directly from the input control points such as described in “The NURBS Book”.

---

<div class="post-metadata">

**Author:** ![TomTom](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/tomtom/32/651939_2.png) [@TomTom](https://discourse.mcneel.com/u/TomTom)\
**Post date:** [May 28, 2025, 11:20am UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/16 "2025-05-28T11:20:22Z")

</div>

> [@davidcockey](#):
>
> The ChangeDegree command in Rhino appears to use a fundamentally different method, not interpolation,

You find degree elevation also explained here:

> **[t - A Primer on Bézier Curves](https://pomax.github.io/bezierinfo/#reordering)**
>
> Let's start with the good stuff: when we're talking about Bézier curves, we're talking about the things that you can see in the following graphics. They run from some start point to some end point, with their curvature influenced by one or more...

I have also seen various interpolation algorithms and I also implemented an interpolation algorithm for n-degree Bezier curves. Its not so difficult actually. You basically reverse the standard point-on-curve (de Casteljau/De Boor) algorithm and solve the equation system. The only thing you can vary is the parameter spacing. Maybe “rebuild” ends there, but I’ve heard that any good interpolation and approximation algorithm should always smooth-out afterwards and use some sort of energy minimising algorithm. But sure, this does not mean its actually implemented here.

---

<div class="post-metadata">

**Author:** ![guido](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/guido/32/761602_2.png) [@guido](https://discourse.mcneel.com/u/guido)\
**Post date:** [June 13, 2025, 9:32pm UTC](https://discourse.mcneel.com/t/rebuild-or-add-knots/205010/17 "2025-06-13T21:32:26Z")

</div>

interestingly RH9 has a new rebuild command called Elmo with more detailed rebuild options

> [@Elmo: A new command to rebuild curves in Rhino](https://discourse.mcneel.com/t/elmo-a-new-command-to-rebuild-curves-in-rhino/187814):
>
> We are excited to share Elmo, a new command to rebuild NURBS curves in 3D to a target control point count and degree. This command aims to preserve some of the good features of Rebuild while generating curves that match the global shape of the input curve with higher accuracy. More specifically, Elmo’s job is to find good control point locations of a new, non-rational curve with a prescribed degree that minimizes the distance between the input and the rebuilt curve as much as possible. Elmo giv…
