<p>A simple effective way to do this is simply not to remove the point at all, instead compute a straight line between the points on either side of the point to be removed. Then move the point that we want removed to the midpoint of that line. Mark it as hidden and then draw everything as normal except don't draw the hidden points.</p>
<p>Another approach is to keep the relative distances from the two ends proportional and place the new point at the proportional distance from the other two.</p>

CC BY-SA 4.0
2024-02-28T13:24:44.147Z
This does not answer my question, I'm not looking for a way to move a point and 'hide it'. I'm looking for a way to remove a control point from a NURBS curve and update the knot vector accordingly.
Lorenzo Celli
CC BY-SA 4.0
2024-02-28T14:42:13.560Z
Oh, well in that case you'll find the answer to you question in "The NURBS book."
pmw1234
CC BY-SA 4.0
2024-02-28T23:51:25.887Z
What chapter? I looked, but I only found information about knot removal, whereas in this case I am trying to remove a control point instead of a knot
Lorenzo Celli
CC BY-SA 4.0
2024-02-29T12:06:01.440Z
How was the curve computed in the first place? This detail isn't in the question yet it is critical to answering *the exact* question being asked. In other words you can't just pull out 1 control point and recompute 1 knot, and the computation varies depending on how the curve was originally computed. The thing that is perplexing about this question is: how could the curve have been computed in the first place if you don't know how to compute it after removing a control point because the two operations are similar. Hence the simple answer. Good Luck.
pmw1234
CC BY-SA 4.0
2024-02-29T15:16:14.060Z
I edited the question and added that the curve comes from a step file. Why do you say 'you can't just pull out 1 control point and recompute 1 knot'?
Lorenzo Celli
CC BY-SA 4.0
2024-02-29T15:24:20.780Z
'how could the curve have been computed in the first place if you don't know how to compute it after removing a control point': the curve (control points, weights and knots) is defined in the step file. I know how to remove the control point, the question is how to update the knot vector. Which knot should I remove,  should I update the other knots, and how.
Lorenzo Celli
CC BY-SA 4.0
2024-02-28T12:43:27.327Z
2024-02-28T12:43:27.327Z
pmw1234
<p>I am trying to write an algorithm to remove a control point from a NURBS curve, similarly to what can be achieved using the <a href="https://help.autodesk.com/view/ACDMAC/2023/ENU/?guid=GUID-7BF8CDE4-9440-4860-9D84-9341006E600A" rel="nofollow noreferrer">CVREMOVE</a> command in AutoCAD.</p>
<p><a href="https://i.sstatic.net/KbGZs.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KbGZs.png" alt="control point removal" /></a></p>
<p>I searched online but I was unable to find a single article about this topic, so here I am.
Thanks a lot in advance for any hint you may have!</p>
<p>Edit: the NURBS curve definition comes from a STEP file.</p>

CC BY-SA 4.0
2024-02-27T16:18:19.200Z
I don't understand why you're having a problem. How are you generating the curve to begin with? Check out this library: https://github.com/sjhalayka/catmull_rom_mandelbrot/tree/main/bspline_library
shawn_halayka
CC BY-SA 4.0
2024-02-27T16:18:44.783Z
P.S. I did not make that library. I've just lost track of the original author.
shawn_halayka
CC BY-SA 4.0
2024-02-28T08:55:13.417Z
Hi! Thanks for sharing the library. I am not generating the curve myself, I am reading it from a STEP file. I looked into the code you shared but it does not seem to do what I need. I'm looking for a way to remove a control point and adjust the knot vector accordingly.
Lorenzo Celli
CC BY-SA 4.0
2024-11-25T21:23:13.320Z
Have you looked at the code for 'c++ nurbs curve arbitrary number of points' on ChatGPT?
shawn_halayka
<curve><nurbs>
How to remove a control point from a NURBS curve?
Lorenzo Celli
# How to remove a control point from a NURBS curve?

(Asked by: username_0 on 2024-02-27)

I am trying to write an algorithm to remove a control point from a NURBS curve, similarly to what can be achieved using the [CVREMOVE](https://help.autodesk.com/view/ACDMAC/2023/ENU/?guid=GUID-7BF8CDE4-9440-4860-9D84-9341006E600A) command in AutoCAD.

[![control point removal](https://i.sstatic.net/KbGZs.png)](https://i.sstatic.net/KbGZs.png)

I searched online but I was unable to find a single article about this topic, so here I am.
Thanks a lot in advance for any hint you may have!

Edit: the NURBS curve definition comes from a STEP file.

**Tags:** curve, nurbs

> **Comments:**
> **username_1**: I don't understand why you're having a problem. How are you generating the curve to begin with? Check out this library: https://github.com/sjhalayka/catmull_rom_mandelbrot/tree/main/bspline_library  
> **username_1**: P.S. I did not make that library. I've just lost track of the original author.  
> **username_0**: Hi! Thanks for sharing the library. I am not generating the curve myself, I am reading it from a STEP file. I looked into the code you shared but it does not seem to do what I need. I'm looking for a way to remove a control point and adjust the knot vector accordingly.  
> **username_1**: Have you looked at the code for 'c++ nurbs curve arbitrary number of points' on ChatGPT?  

---

## 1 answers

### Answer by username_2 on 2024-02-28. Score: 0

A simple effective way to do this is simply not to remove the point at all, instead compute a straight line between the points on either side of the point to be removed. Then move the point that we want removed to the midpoint of that line. Mark it as hidden and then draw everything as normal except don't draw the hidden points.

Another approach is to keep the relative distances from the two ends proportional and place the new point at the proportional distance from the other two.

> **Comments:**
> **username_0**: This does not answer my question, I'm not looking for a way to move a point and 'hide it'. I'm looking for a way to remove a control point from a NURBS curve and update the knot vector accordingly.  
> **username_2**: Oh, well in that case you'll find the answer to you question in "The NURBS book."  
> **username_0**: What chapter? I looked, but I only found information about knot removal, whereas in this case I am trying to remove a control point instead of a knot  
> **username_2**: How was the curve computed in the first place? This detail isn't in the question yet it is critical to answering *the exact* question being asked. In other words you can't just pull out 1 control point and recompute 1 knot, and the computation varies depending on how the curve was originally computed. The thing that is perplexing about this question is: how could the curve have been computed in the first place if you don't know how to compute it after removing a control point because the two operations are similar. Hence the simple answer. Good Luck.  
> **username_0**: I edited the question and added that the curve comes from a step file. Why do you say 'you can't just pull out 1 control point and recompute 1 knot'?  
> **username_0**: 'how could the curve have been computed in the first place if you don't know how to compute it after removing a control point': the curve (control points, weights and knots) is defined in the step file. I know how to remove the control point, the question is how to update the knot vector. Which knot should I remove,  should I update the other knots, and how.  

---

