According to Wikipedia and other sources number of knots is:
knots = number_control_points + curve_degree +1
Then why does this happen?
import rhinoscriptsyntax as rs
control_points = rs.CurvePoints(nurbs_curve)
weights = rs.CurveWeights(nurbs_curve)
knots = rs.CurveKnots(nurbs_curve)
degree = rs.CurveDegree(nurbs_curve)
Knots_Count_failed.gh (13.8 KB)
According to Rhino - What are NURBS?
Rhino uses knots = number_control_points + curve_degree - 1
, since with the +1 definition, the first and last ones are not useful.
You script seems to do the right thing then.
Ok but why don’t Rhino NUBRS comply with the actual definition?
Thanks @dale ,
Interesting article. I understand now, however if one is trying to write import/export tool to/from Rhino will end up confused because all other modern tools use these extra knots.