Struct kurbo::offset::CubicOffset
source · 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) -> Self
pub fn new(c: CubicBez, d: f64) -> Self
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) -> Self
pub fn new_regularized(c: CubicBez, d: f64, dimension: f64) -> Self
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 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