c4d.utils.SplineLengthData

Helper class to obtain the length of splines and the natural position along its path.

Members

SplineLengthData.__init__()
Return type:c4d.utils.SplineLengthData
Returns:A new spline length data object.
SplineLengthData.Init(op, segment)

Initialize the spline length data object with a spline.

Parameters:
  • op (c4d.SplineObject) – The spline object to use.
  • segment (int) – The segment of the spline.
Raises:

IndexError – If the segment index is out of range : 0<=segment<SplineObject.GetSegmentCount().

SplineLengthData.Free()

Called to free the spline.

SplineLengthData.UniformToNatural(t)

Get the natural position along the spline. The uniform position is with respect to the actual length of the spline, whereas the natural position only cares about the interpolation of the curve parameter.

Parameters:t (float) – The uniform position along the spline.
Return type:float
Returns:The natural position in the segment.
SplineLengthData.GetLength()

Returns the length of the spline data object.

Return type:float
Returns:The length.
SplineLengthData.GetSegmentLength(a, b)

Get the length of the segement.

Parameters:
  • a (int) – Start of the segment.
  • b (int) – End of the segment.