euv-core 0.56.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
use super::*;

/// Twist-free parallel-transport Bishop reference frame sampled along a `Spline3D`.
#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
pub struct SplineFrame3D {
    /// World-space curve position at this sample.
    #[get(type(copy))]
    pub(crate) position: Vec3,
    /// Unit forward tangent direction along increasing arc length.
    #[get(type(copy))]
    pub(crate) tangent: Vec3,
    /// Unit parallel-transported normal orthogonal to `tangent`.
    #[get(type(copy))]
    pub(crate) normal: Vec3,
    /// Unit binormal completing the right-handed basis (`tangent x normal`).
    #[get(type(copy))]
    pub(crate) binormal: Vec3,
    /// Cumulative arc length from spline start to this frame.
    #[get(type(copy))]
    pub(crate) arc_length: f32,
}

/// Parametric 3D spline supporting Catmull-Rom, Cubic Bezier, closed loops, arc-length LUTs, and Bishop frames.
#[derive(Clone, Data, Debug, PartialEq)]
pub struct Spline3D {
    /// Sanitized 3D control points defining the curve.
    pub(crate) control_points: Vec<Vec3>,
    /// Curve basis family (`CatmullRom` or `CubicBezier`).
    #[get(type(copy))]
    pub(crate) kind: SplineKind,
    /// Whether the spline closes smoothly back to its starting point.
    #[get(type(copy))]
    pub(crate) closed: bool,
    /// Precomputed `(parameter_t, cumulative_arc_length)` table for O(log N) arc-length queries.
    pub(crate) arc_table: Vec<(f32, f32)>,
    /// Total arc length across the spline domain.
    #[get(type(copy))]
    pub(crate) total_length: f32,
}