I was looking for something that allow the changing of the CV of a NurbsCurve.
I have already made something with the InsertKnot method, but it doesn’t return always what I expected ( the points I insert are not in the desired position ).
I see that in Rhinoceros there is a command “_InsertControlPoint” that allows the user, do what I need.
There isn’t any similar function in C++ that can do the same? I look in all examples and in the help, but I haven’t found anything usefull.
InsertControlPoint doesn’t do anything clever. It just makes a new NURBS from the control points that you want. It also drastically changes the shape of the curve. Probably the best thing would be to, as Menno suggests, add a knot in a reasonable place, then move the points to where you want them.
I already do that, but the result is not what I expected. The knot point is not the same as the control point, so there is no correspondence between the two points. Sometimes, the control points is too far away from the other.
I have already done, the things that @chuck as mentioned. I insert the knot, evaluate ALL control point of the nurbs searching of the point that is nearest of the knot I have inserted (this because I suppose, that the point that is inserted, is near from the knot) and then set the CV as the desired point. But this is not performing and in nurbs with lot of point, this means a lot of time spent searching parameters.
And I have to this operations a lot of time. So I was searching for something that is secure, quickly to do and optimized.
I guess I’m confused. It seems that you have a NURBS, with it’s control points and knots. You now want another NURBS with an additional control point. This new NURBS has one more knot than the other. You’ve already decided where you want the new knot so you now have a knot vector and a set of control points for the new NURBS. Just create a NURBS with that knot vector and those CVs. There is no seaching to be done.
Unless your seach is done to figure out where the new control point fits between existing ones. If this is the case, then you could do it like InsertControlPoint, which only lets you add one along the control polygon. That way, you know where it fits.
I have already a NURBS, with its knots and control points. I want to add one control point in a specific position of that NURBS.
The behavior is:
I have two NURBS curve as in the picture, I want to add a control point in the point where the two NURBS intersect each other (on the biggest one)
This to ensure the greatest possible control to the other NURBS, that have to follow the the biggest on every change that I apply to it (it is mainly scaled).
The only way to add a control point and have it be directly on the NURBS at a particular location is to add a fully multiple knot there. This, of course, will change the locations of some of the other control points nearby and increase the number of points by the degree of the NURBS. It is equivalent to splitting at that location and appending the results into a single NURBS.