pub struct Arc<S> {
pub center: Point<S>,
pub radii: Vector<S>,
pub start_angle: Angle<S>,
pub sweep_angle: Angle<S>,
pub x_rotation: Angle<S>,
}
Expand description
An elliptic arc curve segment.
Fields
center: Point<S>
radii: Vector<S>
start_angle: Angle<S>
sweep_angle: Angle<S>
x_rotation: Angle<S>
Implementations
sourceimpl<S: Scalar> Arc<S>
impl<S: Scalar> Arc<S>
sourcepub fn from_svg_arc(arc: &SvgArc<S>) -> Arc<S>
pub fn from_svg_arc(arc: &SvgArc<S>) -> Arc<S>
Convert from the SVG arc notation.
sourcepub fn to_svg_arc(&self) -> SvgArc<S>
pub fn to_svg_arc(&self) -> SvgArc<S>
Convert to the SVG arc notation.
sourcepub fn for_each_quadratic_bezier<F>(&self, cb: &mut F) where
F: FnMut(&QuadraticBezierSegment<S>),
pub fn for_each_quadratic_bezier<F>(&self, cb: &mut F) where
F: FnMut(&QuadraticBezierSegment<S>),
Approximate the arc with a sequence of quadratic bézier curves.
sourcepub fn for_each_quadratic_bezier_with_t<F>(&self, cb: &mut F) where
F: FnMut(&QuadraticBezierSegment<S>, Range<S>),
pub fn for_each_quadratic_bezier_with_t<F>(&self, cb: &mut F) where
F: FnMut(&QuadraticBezierSegment<S>, Range<S>),
Approximate the arc with a sequence of quadratic bézier curves.
sourcepub fn for_each_cubic_bezier<F>(&self, cb: &mut F) where
F: FnMut(&CubicBezierSegment<S>),
pub fn for_each_cubic_bezier<F>(&self, cb: &mut F) where
F: FnMut(&CubicBezierSegment<S>),
Approximate the arc with a sequence of cubic bézier curves.
pub fn x(&self, t: S) -> S
pub fn y(&self, t: S) -> S
sourcepub fn sample_tangent(&self, t: S) -> Vector<S>
pub fn sample_tangent(&self, t: S) -> Vector<S>
Sample the curve’s tangent at t (expecting t between 0 and 1).
sourcepub fn get_angle(&self, t: S) -> Angle<S>
pub fn get_angle(&self, t: S) -> Angle<S>
Sample the curve’s angle at t (expecting t between 0 and 1).
pub fn end_angle(&self) -> Angle<S>
pub fn from(&self) -> Point<S>
pub fn to(&self) -> Point<S>
sourcepub fn split_range(&self, t_range: Range<S>) -> Self
pub fn split_range(&self, t_range: Range<S>) -> Self
Return the sub-curve inside a given range of t.
This is equivalent splitting at the range’s end points.
sourcepub fn before_split(&self, t: S) -> Arc<S>
pub fn before_split(&self, t: S) -> Arc<S>
Return the curve before the split point.
sourcepub fn after_split(&self, t: S) -> Arc<S>
pub fn after_split(&self, t: S) -> Arc<S>
Return the curve after the split point.
sourcepub fn for_each_flattened<F>(&self, tolerance: S, callback: &mut F) where
F: FnMut(&LineSegment<S>),
pub fn for_each_flattened<F>(&self, tolerance: S, callback: &mut F) where
F: FnMut(&LineSegment<S>),
Approximates the curve with sequence of line segments.
The tolerance
parameter defines the maximum distance between the curve and
its approximation.
sourcepub fn for_each_flattened_with_t<F>(&self, tolerance: S, callback: &mut F) where
F: FnMut(&LineSegment<S>, Range<S>),
pub fn for_each_flattened_with_t<F>(&self, tolerance: S, callback: &mut F) where
F: FnMut(&LineSegment<S>, Range<S>),
Approximates the curve with sequence of line segments.
The tolerance
parameter defines the maximum distance between the curve and
its approximation.
The end of the t parameter range at the final segment is guaranteed to be equal to 1.0
.
sourcepub fn flattened(&self, tolerance: S) -> Flattened<S>ⓘNotable traits for Flattened<S>impl<S: Scalar> Iterator for Flattened<S> type Item = Point<S>;
pub fn flattened(&self, tolerance: S) -> Flattened<S>ⓘNotable traits for Flattened<S>impl<S: Scalar> Iterator for Flattened<S> type Item = Point<S>;
Returns the flattened representation of the curve as an iterator, starting after the current point.
sourcepub fn fast_bounding_box(&self) -> Box2D<S>
pub fn fast_bounding_box(&self) -> Box2D<S>
Returns a conservative rectangle that contains the curve.
sourcepub fn bounding_box(&self) -> Box2D<S>
pub fn bounding_box(&self) -> Box2D<S>
Returns a conservative rectangle that contains the curve.
pub fn for_each_local_x_extremum_t<F>(&self, cb: &mut F) where
F: FnMut(S),
pub fn for_each_local_y_extremum_t<F>(&self, cb: &mut F) where
F: FnMut(S),
pub fn bounding_range_x(&self) -> (S, S)
pub fn bounding_range_y(&self) -> (S, S)
pub fn fast_bounding_range_x(&self) -> (S, S)
pub fn fast_bounding_range_y(&self) -> (S, S)
pub fn approximate_length(&self, tolerance: S) -> S
Trait Implementations
sourceimpl<S: Scalar> Segment for Arc<S>
impl<S: Scalar> Segment for Arc<S>
type Scalar = S
sourcefn derivative(&self, t: S) -> Vector<S>
fn derivative(&self, t: S) -> Vector<S>
Sample the derivative at t (expecting t between 0 and 1).
sourcefn split_range(&self, t_range: Range<S>) -> Self
fn split_range(&self, t_range: Range<S>) -> Self
Return the curve inside a given range of t. Read more
sourcefn split(&self, t: S) -> (Self, Self)
fn split(&self, t: S) -> (Self, Self)
Split this curve into two sub-curves.
sourcefn before_split(&self, t: S) -> Self
fn before_split(&self, t: S) -> Self
Return the curve before the split point.
sourcefn after_split(&self, t: S) -> Self
fn after_split(&self, t: S) -> Self
Return the curve after the split point.
sourcefn approximate_length(&self, tolerance: S) -> S
fn approximate_length(&self, tolerance: S) -> S
Compute the length of the segment using a flattened approximation.
sourcefn for_each_flattened_with_t(
&self,
tolerance: Self::Scalar,
callback: &mut dyn FnMut(&LineSegment<S>, Range<S>)
)
fn for_each_flattened_with_t(
&self,
tolerance: Self::Scalar,
callback: &mut dyn FnMut(&LineSegment<S>, Range<S>)
)
Approximates the curve with sequence of line segments. Read more
impl<S: Copy> Copy for Arc<S>
impl<S> StructuralPartialEq for Arc<S>
Auto Trait Implementations
impl<S> RefUnwindSafe for Arc<S> where
S: RefUnwindSafe,
impl<S> Send for Arc<S> where
S: Send,
impl<S> Sync for Arc<S> where
S: Sync,
impl<S> Unpin for Arc<S> where
S: Unpin,
impl<S> UnwindSafe for Arc<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more