Struct lyon::geom::Arc
[−]
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>, }
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>
Methods
impl<S> Arc<S> where
S: Scalar,
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>),
F: FnMut(&QuadraticBezierSegment<S>),
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
pub fn sample_tangent(&self, t: S) -> TypedVector2D<S, UnknownUnit>
Sample the curve's tangent at t (expecting t between 0 and 1).
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>
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.
pub fn split(&self, t: S) -> (Arc<S>, Arc<S>)
Split this curve into two sub-curves.
pub fn before_split(&self, t: S) -> Arc<S>
Return the curve before the split point.
pub fn after_split(&self, t: S) -> Arc<S>
Return the curve after the split point.
pub fn flip(&self) -> Arc<S>
Swap the direction of the segment.
pub fn for_each_flattened<F>(&self, tolerance: S, call_back: &mut F) where
F: FnMut(TypedPoint2D<S, UnknownUnit>),
F: FnMut(TypedPoint2D<S, UnknownUnit>),
Approximates the arc with a sequence of line segments.
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.
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.
pub fn bounding_rect(&self) -> TypedRect<S, UnknownUnit>
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
impl<S> Into<Arc<S>> for SvgArc<S> where
S: Scalar,
S: Scalar,
impl<S> Copy for Arc<S> where
S: Copy,
S: Copy,
impl<S> PartialEq<Arc<S>> for Arc<S> where
S: PartialEq<S>,
S: PartialEq<S>,
fn eq(&self, __arg_0: &Arc<S>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Arc<S>) -> bool
This method tests for !=
.
impl<S> Segment for Arc<S> where
S: Scalar,
S: Scalar,
type Scalar = S
fn from(&self) -> TypedPoint2D<S, UnknownUnit>
Start of the curve.
fn to(&self) -> TypedPoint2D<S, UnknownUnit>
End of the curve.
fn sample(&self, t: S) -> TypedPoint2D<S, UnknownUnit>
Sample the curve at t (expecting t between 0 and 1).
fn x(&self, t: S) -> S
Sample x at t (expecting t between 0 and 1).
fn y(&self, t: S) -> S
Sample y at t (expecting t between 0 and 1).
fn derivative(&self, t: S) -> TypedVector2D<S, UnknownUnit>
Sample the derivative at t (expecting t between 0 and 1).
fn split_range(&self, t_range: Range<S>) -> Arc<S>
Return the curve inside a given range of t. Read more
fn split(&self, t: S) -> (Arc<S>, Arc<S>)
Split this curve into two sub-curves.
fn before_split(&self, t: S) -> Arc<S>
Return the curve before the split point.
fn after_split(&self, t: S) -> Arc<S>
Return the curve after the split point.
fn flip(&self) -> Arc<S>
Swap the direction of the segment.
fn approximate_length(&self, tolerance: S) -> S
Compute the length of the segment using a flattened approximation.
fn dx(&self, t: Self::Scalar) -> Self::Scalar
Sample x derivative at t (expecting t between 0 and 1).
fn dy(&self, t: Self::Scalar) -> Self::Scalar
Sample y derivative at t (expecting t between 0 and 1).
impl<S> Clone for Arc<S> where
S: Clone,
S: Clone,
fn clone(&self) -> Arc<S>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S> FlatteningStep for Arc<S> where
S: Scalar,
S: Scalar,
fn flattening_step(&self, tolerance: S) -> S
Find the interval of the begining of the curve that can be approximated with a line segment. Read more
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. Read more
impl<S> Debug for Arc<S> where
S: Debug,
S: Debug,