[go: up one dir, main page]

Struct Arc

Source
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,

Source

pub fn from_svg_arc(arc: &SvgArc<S>) -> Arc<S>

Source

pub fn to_svg_arc(&self) -> SvgArc<S>

Source

pub fn for_each_quadratic_bezier<F>(&self, cb: &mut F)

Source

pub fn sample(&self, t: S) -> TypedPoint2D<S, UnknownUnit>

Sample the curve at t (expecting t between 0 and 1).

Source

pub fn x(&self, t: S) -> S

Source

pub fn y(&self, t: S) -> S

Source

pub fn sample_tangent(&self, t: S) -> TypedVector2D<S, UnknownUnit>

Sample the curve’s tangent at t (expecting t between 0 and 1).

Source

pub fn get_angle(&self, t: S) -> Angle<S>

Sample the curve’s angle at t (expecting t between 0 and 1).

Source

pub fn end_angle(&self) -> Angle<S>

Source

pub fn from(&self) -> TypedPoint2D<S, UnknownUnit>

Source

pub fn to(&self) -> TypedPoint2D<S, UnknownUnit>

Source

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.

Source

pub fn split(&self, t: S) -> (Arc<S>, Arc<S>)

Split this curve into two sub-curves.

Source

pub fn before_split(&self, t: S) -> Arc<S>

Return the curve before the split point.

Source

pub fn after_split(&self, t: S) -> Arc<S>

Return the curve after the split point.

Source

pub fn flip(&self) -> Arc<S>

Swap the direction of the segment.

Source

pub fn for_each_flattened<F>(&self, tolerance: S, call_back: &mut F)

Approximates the arc with a sequence of line segments.

Source

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.

Source

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.

Source

pub fn bounding_rect(&self) -> TypedRect<S>

Returns a conservative rectangle that contains the curve.

Source

pub fn bounding_range_x(&self) -> (S, S)

Source

pub fn bounding_range_y(&self) -> (S, S)

Source

pub fn approximate_length(&self, tolerance: S) -> S

Trait Implementations§

Source§

impl<S> Clone for Arc<S>
where S: Clone,

Source§

fn clone(&self) -> Arc<S>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S> Debug for Arc<S>
where S: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<S> FlatteningStep for Arc<S>
where S: Scalar,

Source§

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§

fn flattened(self, tolerance: Self::Scalar) -> Flattened<Self::Scalar, Self>

Returns the flattened representation of the curve as an iterator, starting after the current point.
Source§

impl<S> Into<Arc<S>> for SvgArc<S>
where S: Scalar,

Source§

fn into(self) -> Arc<S>

Converts this type into the (usually inferred) input type.
Source§

impl<S> PartialEq for Arc<S>
where S: PartialEq,

Source§

fn eq(&self, other: &Arc<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<S> Segment for Arc<S>
where S: Scalar,

Source§

type Scalar = S

Source§

fn from(&self) -> TypedPoint2D<S, UnknownUnit>

Start of the curve.
Source§

fn to(&self) -> TypedPoint2D<S, UnknownUnit>

End of the curve.
Source§

fn sample(&self, t: S) -> TypedPoint2D<S, UnknownUnit>

Sample the curve at t (expecting t between 0 and 1).
Source§

fn x(&self, t: S) -> S

Sample x at t (expecting t between 0 and 1).
Source§

fn y(&self, t: S) -> S

Sample y at t (expecting t between 0 and 1).
Source§

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>

Return the curve inside a given range of t. Read more
Source§

fn split(&self, t: S) -> (Arc<S>, Arc<S>)

Split this curve into two sub-curves.
Source§

fn before_split(&self, t: S) -> Arc<S>

Return the curve before the split point.
Source§

fn after_split(&self, t: S) -> Arc<S>

Return the curve after the split point.
Source§

fn flip(&self) -> Arc<S>

Swap the direction of the segment.
Source§

fn approximate_length(&self, tolerance: S) -> S

Compute the length of the segment using a flattened approximation.
Source§

fn dx(&self, t: Self::Scalar) -> Self::Scalar

Sample x derivative at t (expecting t between 0 and 1).
Source§

fn dy(&self, t: Self::Scalar) -> Self::Scalar

Sample y derivative at t (expecting t between 0 and 1).
Source§

impl<S> Copy for Arc<S>
where S: Copy,

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> FlattenedForEach for T
where T: FlatteningStep,

Source§

fn for_each_flattened<F>( &self, tolerance: <T as Segment>::Scalar, call_back: &mut F, )

Iterates through the curve invoking a callback at each point.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.