Hi all, I am creating a tool and it uses GrevillePoints to better edit the NurbsCurve.
Below is a simplified snippet of what I am trying to do.
var pt1 = new Point3d(1, 2, 0);
var pt2 = new Point3d(2, 3, 0);
var pt3 = new Point3d(5, 12, 0);
var pt4 = new Point3d(12, 3, 0);
var dynamic_points = new[] { pt1, pt2, pt3, pt4 };
var curve = new NurbsCurve(3, 4);
curve.SetGrevillePoints(dynamic_points); //always return with false
curve.SetGrevillePoints(dynamic_points);
the above line fails to execute. What am I missing here?
I have read the below thread, but I am still unable to grasp how to better manipulate a curve with Edit / Greville Points in RhinoCommon.
For those who are wondering, this is how it is done in C#
var dynamic_points = new List<Point3d>
{
new Point3d(1, 2, 0),
new Point3d(2, 3, 0),
new Point3d(1, 12, 0),
new Point3d(5, 3, 0),
};
var curve = new NurbsCurve(3, dynamic_points.Count);
for (int i = 0; i < dynamic_points.Count; i++)
curve.Points[i] = new ControlPoint(0, i, 0);
curve.Knots.CreateUniformKnots(1);
curve.SetGrevillePoints(dynamic_points);