Skip to main content

Crate prime_splines

Crate prime_splines 

Source
Expand description

prime-splines — Curve interpolation: Bezier, Hermite, Catmull-Rom, B-spline, slerp.

All public functions are pure (LOAD + COMPUTE only). No &mut, no side effects, no hidden state. Same inputs always produce the same output.

§Temporal Assembly Model

  • LOAD — read function parameters
  • COMPUTE — pure math

STORE and JUMP do not exist here.

§Included

  • bezier_quadratic / bezier_quadratic_3d — quadratic Bezier (3 control points)
  • bezier_cubic / bezier_cubic_3d — cubic Bezier (4 control points)
  • hermite / hermite_3d — cubic Hermite (position + tangent at endpoints)
  • catmull_rom / catmull_rom_3d — Catmull-Rom (smooth through control points)
  • b_spline_cubic / b_spline_cubic_3d — uniform cubic B-spline segment
  • slerp — spherical linear interpolation for unit quaternions
  • bezier_cubic_arc_length / bezier_cubic_arc_length_3d — approximate arc length
  • bezier_cubic_t_at_length / bezier_cubic_t_at_length_3d — inverse arc-length parameterisation

Functions§

b_spline_cubic
Uniform cubic B-spline segment.
b_spline_cubic_3d
Uniform cubic B-spline segment on (x, y, z) tuples.
bezier_cubic
Cubic Bezier interpolation (4 control points).
bezier_cubic_3d
Cubic Bezier interpolation on (x, y, z) tuples.
bezier_cubic_arc_length
Approximate arc length of a 1-D cubic Bezier by subdividing into steps linear segments.
bezier_cubic_arc_length_3d
Approximate arc length of a 3-D cubic Bezier by subdividing into steps linear segments.
bezier_cubic_t_at_length
Find the parameter t corresponding to a target arc length along a 1-D cubic Bezier.
bezier_cubic_t_at_length_3d
Find the parameter t corresponding to a target arc length along a 3-D cubic Bezier.
bezier_quadratic
Quadratic Bezier interpolation (3 control points).
bezier_quadratic_3d
Quadratic Bezier interpolation on (x, y, z) tuples.
catmull_rom
Uniform Catmull-Rom spline segment.
catmull_rom_3d
Catmull-Rom spline segment on (x, y, z) tuples.
hermite
Cubic Hermite interpolation: endpoints and tangents.
hermite_3d
Cubic Hermite interpolation on (x, y, z) tuples.
slerp
Spherical linear interpolation between two unit quaternions.