pub struct Arc {
pub center: Point,
pub radii: Vec2,
pub start_angle: f64,
pub sweep_angle: f64,
pub x_rotation: f64,
}
Expand description
A single arc segment.
Fields§
§center: Point
The arc’s centre point.
radii: Vec2
The arc’s radii, where the vector’s x-component is the radius in the
positive x direction after applying x_rotation
.
start_angle: f64
The start angle in radians.
sweep_angle: f64
The angle between the start and end of the arc, in radians.
x_rotation: f64
How much the arc is rotated, in radians.
Implementations§
§impl Arc
impl Arc
pub fn append_iter(&self, tolerance: f64) -> ArcAppendIter
pub fn append_iter(&self, tolerance: f64) -> ArcAppendIter
Create an iterator generating Bezier path elements.
The generated elements can be appended to an existing bezier path.
Trait Implementations§
§impl Shape for Arc
impl Shape for Arc
§fn perimeter(&self, accuracy: f64) -> f64
fn perimeter(&self, accuracy: f64) -> f64
The perimeter of the ellipse.
Note: Finding the perimeter of an ellipse is fairly involved, so for now we just approximate by using the bezier curve representation.
§fn winding(&self, pt: Point) -> i32
fn winding(&self, pt: Point) -> i32
Note: shape isn’t closed, so a point’s winding number is not well defined.
§type PathElementsIter = Chain<Once<PathEl>, ArcAppendIter>
type PathElementsIter = Chain<Once<PathEl>, ArcAppendIter>
The iterator returned by the
path_elements
method.§fn path_elements(&self, tolerance: f64) -> <Arc as Shape>::PathElementsIter<'_>
fn path_elements(&self, tolerance: f64) -> <Arc as Shape>::PathElementsIter<'_>
§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the shape.
§fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
§fn as_rounded_rect(&self) -> Option<RoundedRect>
fn as_rounded_rect(&self) -> Option<RoundedRect>
If the shape is a rounded rectangle, make it available.
§fn as_path_slice(&self) -> Option<&[PathEl]>
fn as_path_slice(&self) -> Option<&[PathEl]>
If the shape is stored as a slice of path elements, make
that available. Read more
impl Copy for Arc
impl StructuralPartialEq for Arc
Auto Trait Implementations§
impl RefUnwindSafe for Arc
impl Send for Arc
impl Sync for Arc
impl Unpin for Arc
impl UnwindSafe for Arc
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.