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§
source§impl<S: Scalar> Arc<S>
impl<S: Scalar> Arc<S>
pub fn cast<NewS: NumCast>(self) -> Arc<NewS>
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)
pub fn for_each_quadratic_bezier_with_t<F>(&self, cb: &mut F)
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)
pub fn for_each_flattened_with_t<F>(&self, tolerance: S, callback: &mut F)
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> ⓘ
pub fn flattened(&self, tolerance: S) -> Flattened<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§
source§impl<S: Scalar> Segment for Arc<S>
impl<S: Scalar> Segment for Arc<S>
type Scalar = S
source§fn derivative(&self, t: S) -> Vector<S>
fn derivative(&self, t: S) -> Vector<S>
source§fn before_split(&self, t: S) -> Self
fn before_split(&self, t: S) -> Self
source§fn after_split(&self, t: S) -> Self
fn after_split(&self, t: S) -> Self
source§fn split_range(&self, t_range: Range<S>) -> Self
fn split_range(&self, t_range: Range<S>) -> Self
source§fn approximate_length(&self, tolerance: S) -> S
fn approximate_length(&self, tolerance: S) -> S
source§fn 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>), )
impl<S: Copy> Copy for Arc<S>
impl<S> StructuralPartialEq for Arc<S>
Auto Trait Implementations§
impl<S> Freeze for Arc<S>where
S: Freeze,
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§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)