pub struct CubicBezier3 { /* private fields */ }Expand description
One cubic Bezier in three dimensions, with checked finite control points. Construction and all operations use fixed storage and allocate nothing. See the module’s executable recipe for every operation.
Implementations§
Source§impl CubicBezier3
impl CubicBezier3
Sourcepub fn new(control_points: [Vec3; 4]) -> Result<CubicBezier3, CurveError>
pub fn new(control_points: [Vec3; 4]) -> Result<CubicBezier3, CurveError>
Checks all four points, including for constant/degenerate curves.
Sourcepub fn control_points(&self) -> [Vec3; 4]
pub fn control_points(&self) -> [Vec3; 4]
Original ordered points, suitable for editing and checked reconstruction.
Sourcepub fn position(&self, parameter: f64) -> Result<Vec3, CurveError>
pub fn position(&self, parameter: f64) -> Result<Vec3, CurveError>
Samples a finite parameter in 0..=1, using f64 de Casteljau
interpolation before rounding to Vec3. Endpoints preserve their original
bits, including signed zeros. No extrapolation or clamping occurs.
Sourcepub fn tangent(&self, parameter: f64) -> Result<[f64; 3], CurveError>
pub fn tangent(&self, parameter: f64) -> Result<[f64; 3], CurveError>
Unnormalized derivative of the authored polynomial, before position rounding, as finite f64 components. Extreme f32 controls cannot overflow the tangent. Exact computed zero at a cusp/constant curve remains zero; small derivatives are not discarded by an epsilon. There is no unit-tangent fallback.
Sourcepub fn tessellate_into(
&self,
output: &mut [Vec3],
options: TessellationOptions,
) -> Result<Tessellation, CurveError>
pub fn tessellate_into( &self, output: &mut [Vec3], options: TessellationOptions, ) -> Result<Tessellation, CurveError>
Adaptively bisects left-first into caller storage. Invalid options leave the entire output unchanged. Valid requests overwrite only the reported prefix, including on saturation. A constant curve emits two equal points on completion, preserving both endpoint parameters.
Only Complete is a whole-curve tolerance certificate. A partial result
is safe to inspect, but callers must explicitly choose whether to use
that shorter path. Increasing a budget starts a fresh run. Stack storage
is fixed (33 nodes); work and output never grow implicitly. See the
module recipe and the bound described in the module documentation.
Trait Implementations§
Source§impl Clone for CubicBezier3
impl Clone for CubicBezier3
Source§fn clone(&self) -> CubicBezier3
fn clone(&self) -> CubicBezier3
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more