pub struct Spline3D { /* private fields */ }Expand description
Parametric 3D spline supporting Catmull-Rom, Cubic Bezier, closed loops, arc-length LUTs, and Bishop frames.
Implementations§
Source§impl Spline3D
Evaluation, arc-length parameterization, and Bishop frame transport for Spline3D.
impl Spline3D
Evaluation, arc-length parameterization, and Bishop frame transport for Spline3D.
Sourcepub fn catmull_rom(points: Vec<Vec3>, closed: bool) -> Self
pub fn catmull_rom(points: Vec<Vec3>, closed: bool) -> Self
Sourcepub fn cubic_bezier(points: Vec<Vec3>, closed: bool) -> Self
pub fn cubic_bezier(points: Vec<Vec3>, closed: bool) -> Self
Constructs a chained piecewise Cubic Bezier Spline3D with a precomputed arc-length lookup table.
§Arguments
Vec<Vec3>- Anchor and handle control points ([P0, C0, C1, P1, ...]).bool- Whether the spline closes back to the initial anchor.
§Returns
Self- ConstructedSpline3Dwith precomputed arc-length LUT.
Sourcepub fn segment_count(&self) -> usize
pub fn segment_count(&self) -> usize
Returns the number of piecewise cubic segments in this spline.
§Returns
usize- Number of curve segments (0when fewer than 2 control points exist).
Sourcepub fn sample_point(&self, t: f32) -> Vec3
pub fn sample_point(&self, t: f32) -> Vec3
Sourcepub fn sample_tangent(&self, t: f32) -> Vec3
pub fn sample_tangent(&self, t: f32) -> Vec3
Sourcepub fn sample_t_at_distance(&self, distance: f32) -> f32
pub fn sample_t_at_distance(&self, distance: f32) -> f32
Sourcepub fn sample_by_arc_length(&self, distance: f32) -> Vec3
pub fn sample_by_arc_length(&self, distance: f32) -> Vec3
Sourcepub fn sample_bishop_frames(&self, samples: usize) -> Vec<SplineFrame3D>
pub fn sample_bishop_frames(&self, samples: usize) -> Vec<SplineFrame3D>
Source§impl Spline3D
Implements impl #impl_generics #name #ty_generics #where_clause.
impl Spline3D
Implements impl #impl_generics #name #ty_generics #where_clause.
pub fn get_control_points(&self) -> &Vec<Vec3>
pub fn get_mut_control_points(&mut self) -> &mut Vec<Vec3>
pub fn set_control_points(&mut self, val: Vec<Vec3>) -> &mut Self
pub fn get_kind(&self) -> SplineKind
pub fn get_mut_kind(&mut self) -> &mut SplineKind
pub fn set_kind(&mut self, val: SplineKind) -> &mut Self
pub fn get_closed(&self) -> bool
pub fn get_mut_closed(&mut self) -> &mut bool
pub fn set_closed(&mut self, val: bool) -> &mut Self
pub fn get_arc_table(&self) -> &Vec<(f32, f32)>
pub fn get_mut_arc_table(&mut self) -> &mut Vec<(f32, f32)>
pub fn set_arc_table(&mut self, val: Vec<(f32, f32)>) -> &mut Self
pub fn get_total_length(&self) -> f32
pub fn get_mut_total_length(&mut self) -> &mut f32
pub fn set_total_length(&mut self, val: f32) -> &mut Self
Trait Implementations§
impl StructuralPartialEq for Spline3D
Auto Trait Implementations§
impl Forget for Spline3D
impl Freeze for Spline3D
impl Move for Spline3D
impl RefUnwindSafe for Spline3D
impl Send for Spline3Dwhere
RawVecInner: Send,
impl Sync for Spline3Dwhere
RawVecInner: Sync,
impl Unpin for Spline3D
impl UnsafeUnpin for Spline3Dwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Vec3>: UnsafeUnpin,
PhantomData<(f32, f32)>: UnsafeUnpin,
impl UnwindSafe for Spline3Dwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more