Crate stroke

Crate stroke 

Source
Expand description

A const-generic, no-std spline library for Bezier and B-spline curves.

The core abstraction is the Point trait, which models a fixed-dimension vector space element. Optional capability traits such as PointIndex, PointDot, and PointNorm enable component access and geometric helpers when required.

§Examples

use stroke::{Bezier, PointN};

let curve = Bezier::<PointN<f32, 2>, 3>::new([
    PointN::new([0.0, 0.0]),
    PointN::new([1.0, 0.0]),
    PointN::new([1.0, 1.0]),
]);

let mid = curve.eval(0.5);

§Feature flags

  • nalgebra: implements Point for nalgebra::SVector<T, D> (add nalgebra as a dependency).

Re-exports§

pub use bezier::Bezier;
pub use bspline::BSpline;
pub use bspline_path::BSplinePath;
pub use cubic_bezier::CubicBezier;
pub use find_root::FindRoot;
pub use line::LineSegment;
pub use path::BezierPath;
pub use point::Point;
pub use point::PointDot;
pub use point::PointIndex;
pub use point::PointNorm;
pub use point_generic::PointN;
pub use quadratic_bezier::QuadraticBezier;

Modules§

bezier
Const-generic Bezier curves of arbitrary degree.
bezier_segment
Sum type for specialized Bezier segments.
bspline
Const-generic B-spline curves.
bspline_path
B-spline path utilities.
cubic_bezier
Cubic Bezier curve specialization.
find_root
Root-finding helpers for curve types that support per-axis evaluation.
line
Line segment curve type.
path
Mixed Bezier path utilities.
point
Point traits and capability helpers.
point_generic
Const-generic point type for users who do not want external math dependencies.
quadratic_bezier
Quadratic Bezier curve specialization.