toSegment

fun CatmullRom2.toSegment(): Segment2D(source)

Converts spline to a Segment.


fun CatmullRom3.toSegment(): Segment3D(source)

Converts the current 3D Catmull-Rom spline segment into a cubic Bézier curve representation.

This function calculates the four control points required for a cubic Bézier curve using the Catmull-Rom spline's positions and its alpha value determining the tension. The resulting cubic Bézier curve spans between p1 and p2 of the Catmull-Rom segment.

Return

A Segment3D object representing the equivalent cubic Bézier curve of the Catmull-Rom spline segment.