I couldn’t match the NurbsKnotsList of the new nurbscurve to the old one, resulting a pinched kink in the newly created curve on the right.
The output shows the two curves have different NurbsCurveKnotList
Below is my code:
private NurbsCurve CreateNurbsFromGrevillePoints(IEnumerable<Point3d> grevillePoints, int degree, double knots)
{
var curve = new NurbsCurve(degree, grevillePoints.Count());
for (int i = 0; i < grevillePoints.Count(); i++)
curve.Points[i] = new ControlPoint(0, i, 0);
curve.Knots.CreatePeriodicKnots(0.5 * Math.PI);
curve.Knots.ClampEnd(CurveEnd.Both);
curve.SetGrevillePoints(grevillePoints);
return curve;
}
I think you’re trying to re-create a periodic nurbs curve, which does not have clamped knots. So, if you remove the second to last line which clamps the knots, would it work any better?
If not, please attach the gh file, so others can take a look.
Brilliant!
But I actually want to have more of a control of the knotlist.
The above example is just a demonstration of how the NurbsCurveKnotList is hard to be manipulated.
for instance sometimes I would like to add a kink when t=0.2
or i would like to convert the kink when t=0.2 back to an ordinary edit point.