pub struct Arc<S> {
pub center: TypedPoint2D<S, UnknownUnit>,
pub radii: TypedVector2D<S, UnknownUnit>,
pub start_angle: Angle<S>,
pub sweep_angle: Angle<S>,
pub x_rotation: Angle<S>,
}Expand description
An ellipic arc curve segment.
Fields§
§center: TypedPoint2D<S, UnknownUnit>§radii: TypedVector2D<S, UnknownUnit>§start_angle: Angle<S>§sweep_angle: Angle<S>§x_rotation: Angle<S>Implementations§
Source§impl<S> Arc<S>where
S: Scalar,
impl<S> Arc<S>where
S: Scalar,
pub fn from_svg_arc(arc: &SvgArc<S>) -> Arc<S>
pub fn to_svg_arc(&self) -> SvgArc<S>
pub fn for_each_quadratic_bezier<F>(&self, cb: &mut F)where
F: FnMut(&QuadraticBezierSegment<S>),
Sourcepub fn sample(&self, t: S) -> TypedPoint2D<S, UnknownUnit>
pub fn sample(&self, t: S) -> TypedPoint2D<S, UnknownUnit>
Sample the curve at t (expecting t between 0 and 1).
pub fn x(&self, t: S) -> S
pub fn y(&self, t: S) -> S
Sourcepub fn sample_tangent(&self, t: S) -> TypedVector2D<S, UnknownUnit>
pub fn sample_tangent(&self, t: S) -> TypedVector2D<S, UnknownUnit>
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) -> TypedPoint2D<S, UnknownUnit>
pub fn to(&self) -> TypedPoint2D<S, UnknownUnit>
Sourcepub fn split_range(&self, t_range: Range<S>) -> Arc<S>
pub fn split_range(&self, t_range: Range<S>) -> Arc<S>
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, call_back: &mut F)
pub fn for_each_flattened<F>(&self, tolerance: S, call_back: &mut F)
Approximates the arc with a sequence of line segments.
Sourcepub fn flattening_step(&self, tolerance: S) -> S
pub fn flattening_step(&self, tolerance: S) -> S
Finds the interval of the begining of the curve that can be approximated with a line segment.
Sourcepub fn flattened(&self, tolerance: S) -> Flattened<S, Arc<S>>
pub fn flattened(&self, tolerance: S) -> Flattened<S, Arc<S>>
Returns the flattened representation of the curve as an iterator, starting after the current point.
Sourcepub fn bounding_rect(&self) -> TypedRect<S>
pub fn bounding_rect(&self) -> TypedRect<S>
Returns a conservative rectangle that contains the curve.
pub fn bounding_range_x(&self) -> (S, S)
pub fn bounding_range_y(&self) -> (S, S)
pub fn approximate_length(&self, tolerance: S) -> S
Trait Implementations§
Source§impl<S> FlatteningStep for Arc<S>where
S: Scalar,
impl<S> FlatteningStep for Arc<S>where
S: Scalar,
Source§fn flattening_step(&self, tolerance: S) -> S
fn flattening_step(&self, tolerance: S) -> S
Find the interval of the begining of the curve that can be approximated with a
line segment.
Source§impl<S> Segment for Arc<S>where
S: Scalar,
impl<S> Segment for Arc<S>where
S: Scalar,
type Scalar = S
Source§fn from(&self) -> TypedPoint2D<S, UnknownUnit>
fn from(&self) -> TypedPoint2D<S, UnknownUnit>
Start of the curve.
Source§fn to(&self) -> TypedPoint2D<S, UnknownUnit>
fn to(&self) -> TypedPoint2D<S, UnknownUnit>
End of the curve.
Source§fn sample(&self, t: S) -> TypedPoint2D<S, UnknownUnit>
fn sample(&self, t: S) -> TypedPoint2D<S, UnknownUnit>
Sample the curve at t (expecting t between 0 and 1).
Source§fn derivative(&self, t: S) -> TypedVector2D<S, UnknownUnit>
fn derivative(&self, t: S) -> TypedVector2D<S, UnknownUnit>
Sample the derivative at t (expecting t between 0 and 1).
Source§fn split_range(&self, t_range: Range<S>) -> Arc<S>
fn split_range(&self, t_range: Range<S>) -> Arc<S>
Return the curve inside a given range of t. Read more
Source§fn before_split(&self, t: S) -> Arc<S>
fn before_split(&self, t: S) -> Arc<S>
Return the curve before the split point.
Source§fn after_split(&self, t: S) -> Arc<S>
fn after_split(&self, t: S) -> Arc<S>
Return the curve after the split point.
Source§fn approximate_length(&self, tolerance: S) -> S
fn approximate_length(&self, tolerance: S) -> S
Compute the length of the segment using a flattened approximation.
impl<S> Copy for Arc<S>where
S: Copy,
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
Mutably borrows from an owned value. Read more