Hi there fellow Rhino Developers,
I have a question regarding Nurbs/Control Points and the PointAt() method of the rhino3dm Library.
Let me describe the situation:
There is a 3 Point curve, with equidistant control points (x=0, x=10, x=20). I use “CreateControlPointCurve()” to create a rhino3dm.Curve and change it’s Domain to 0-100 and use it’s PointAt() function to get parameters at 25, 50, 75. All shiny! The parameters are at X=25, x=50 and x=75. Evenly spaced on the curve.
Now the curve changes, it has non equidistant control points (x=0, x=5, x=20) PointAt(25,50,75) does not return the points I would like to get anymore… it gives me uneven spaced points on the curve. Same if I add more points to the curve (see image below). On this image you can see the crosshairs which simbolize parameters 0, 25, 50, 75 and 100 (0 and 100 are ok), the others are not, and you can see a little squares/dots which are the control point locations. You can see that the CP is not in the middle of the curve.
I have discovered a function called Reparameterize() - of which I suspect, that it would do what i want - that takes exactly one float argument and which, if I randomly try out different values, can produce “better” results… For instance for the example above calling it with 0.55 will yield almost perfect distribution of parameters on the curve(see image below), but I do not find any documentation for this and I don’t understand how to calculate the parameter for this function. Also it changes again with the CP count.
Can anyone point me into the right direction to get even/correctly spaced points on the curve say at Parameter = 25, 50, 75,etc. for this kind of setup? Is that even possible with rhino3dm? What would i need to code to make this work? Does it have anything to do with segment/knot count or degree… or … ?
Any advice is very much appreciated! Thank you
Best regards
Malte