pub struct CubicOffset { /* private fields */ }
Expand description
The offset curve of a cubic Bézier.
This is a representation of the offset curve of a cubic Bézier segment, for purposes of curve fitting.
See the module-level documentation for a bit more discussion of the approach, and how this struct is to be used.
Implementations§
Source§impl CubicOffset
impl CubicOffset
Sourcepub fn new(c: CubicBez, d: f64) -> CubicOffset
pub fn new(c: CubicBez, d: f64) -> CubicOffset
Create a new curve from Bézier segment and offset.
This method should only be used if the Bézier is smooth. Use
new_regularized
instead to deal with a wider range of inputs.
Sourcepub fn new_regularized(c: CubicBez, d: f64, dimension: f64) -> CubicOffset
pub fn new_regularized(c: CubicBez, d: f64, dimension: f64) -> CubicOffset
Create a new curve from Bézier segment and offset, with numerical robustness tweaks.
The dimension represents a minimum feature size; the regularization is allowed to perturb the curve by this amount in order to improve the robustness.
Trait Implementations§
Source§impl ParamCurveFit for CubicOffset
impl ParamCurveFit for CubicOffset
Source§fn sample_pt_tangent(&self, t: f64, sign: f64) -> CurveFitSample
fn sample_pt_tangent(&self, t: f64, sign: f64) -> CurveFitSample
Evaluate the curve and its tangent at parameter
t
. Read moreSource§fn sample_pt_deriv(&self, t: f64) -> (Point, Vec2)
fn sample_pt_deriv(&self, t: f64) -> (Point, Vec2)
Evaluate the point and derivative at parameter
t
. Read moreAuto Trait Implementations§
impl Freeze for CubicOffset
impl RefUnwindSafe for CubicOffset
impl Send for CubicOffset
impl Sync for CubicOffset
impl Unpin for CubicOffset
impl UnwindSafe for CubicOffset
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
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.