Curve.Rebuild: preserveTangents affects Degree of output

When preserveTangents = False, Curve.Rebuild’s output has a Degree equal to the degree argument.
However, when preserveTangents = True, Rebuild’s output has a Degree of 3 when:

  • degree = 2 & pointCount > 4
  • degree > 3 & pointCount > degree+1

Study_rgCurveRebuild.py (1.7 KB) demonstrates this.

This also occurs in V5.

Thank you,
Steve

Yes, that is because when a curve is interpolated with the tangents as additional input, degree three is required for the algorithm: you get one control point for each point through which the curve is interpolated + 2 control points to set the tangents.

Are you referring to Rebuild or CreateInterpolatedCurve? Although the script also shows that even-numbered degree curves are not created with the latter, the focus of this post is to inform that Rebuild with preserveTangents=True doesn’t honor the degree argument for most, but not all, values for pointCount.

For example, from a Degree 5 curve,
Rebuild(pointCount=6, degree=5, preservetangents=True) will create a Degree 5 curve
Rebuild(pointCount=(>6), degree=5, preservetangents=True) will create a Degree 3 curve

Printed output of the script: Study_rgCurveRebuild_Out.txt (7.7 KB)
‘<-’ marks where degree is not honored.

Hi @spb,

I can repeat the problem here.

https://mcneel.myjetbrains.com/youtrack/issue/RH-41239

– Dale