4
$\begingroup$

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 command in AutoCAD.

control point removal

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.

$\endgroup$
3
  • $\begingroup$ I don't understand why you're having a problem. How are you generating the curve to begin with? Check out this library: github.com/sjhalayka/catmull_rom_mandelbrot/tree/main/… $\endgroup$ Commented Feb 27 at 16:18
  • $\begingroup$ P.S. I did not make that library. I've just lost track of the original author. $\endgroup$ Commented Feb 27 at 16:18
  • $\begingroup$ 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. $\endgroup$ Commented Feb 28 at 8:55

1 Answer 1

0
$\begingroup$

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.

$\endgroup$
6
  • $\begingroup$ 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. $\endgroup$ Commented Feb 28 at 13:24
  • $\begingroup$ Oh, well in that case you'll find the answer to you question in "The NURBS book." $\endgroup$
    – pmw1234
    Commented Feb 28 at 14:42
  • $\begingroup$ 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 $\endgroup$ Commented Feb 28 at 23:51
  • $\begingroup$ 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. $\endgroup$
    – pmw1234
    Commented Feb 29 at 12:06
  • $\begingroup$ 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'? $\endgroup$ Commented Feb 29 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.