pub struct CircleSegment {
pub center: Point,
pub outer_radius: f64,
pub inner_radius: f64,
pub start_angle: f64,
pub sweep_angle: f64,
}
Expand description
A segment of a circle.
If inner_radius > 0
, then the shape will be a doughnut segment.
Fields§
§center: Point
The center.
outer_radius: f64
The outer radius.
inner_radius: f64
The inner radius.
start_angle: f64
The angle to start drawing the segment (in radians).
sweep_angle: f64
The arc length of the segment (in radians).
Implementations§
source§impl CircleSegment
impl CircleSegment
sourcepub fn new(
center: impl Into<Point>,
outer_radius: f64,
inner_radius: f64,
start_angle: f64,
sweep_angle: f64,
) -> Self
pub fn new( center: impl Into<Point>, outer_radius: f64, inner_radius: f64, start_angle: f64, sweep_angle: f64, ) -> Self
Create a CircleSegment
out of its constituent parts.
Trait Implementations§
source§impl Add<Vec2> for CircleSegment
impl Add<Vec2> for CircleSegment
source§impl Clone for CircleSegment
impl Clone for CircleSegment
source§fn clone(&self) -> CircleSegment
fn clone(&self) -> CircleSegment
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CircleSegment
impl Debug for CircleSegment
source§impl PartialEq for CircleSegment
impl PartialEq for CircleSegment
source§impl Shape for CircleSegment
impl Shape for CircleSegment
source§type PathElementsIter<'iter> = Chain<Chain<Chain<Chain<Once<PathEl>, Once<PathEl>>, ArcAppendIter>, Once<PathEl>>, ArcAppendIter>
type PathElementsIter<'iter> = Chain<Chain<Chain<Chain<Once<PathEl>, Once<PathEl>>, ArcAppendIter>, Once<PathEl>>, ArcAppendIter>
The iterator returned by the
path_elements
method.source§fn path_elements(
&self,
tolerance: f64,
) -> Chain<Chain<Chain<Chain<Once<PathEl>, Once<PathEl>>, ArcAppendIter>, Once<PathEl>>, ArcAppendIter> ⓘ
fn path_elements( &self, tolerance: f64, ) -> Chain<Chain<Chain<Chain<Once<PathEl>, Once<PathEl>>, ArcAppendIter>, Once<PathEl>>, ArcAppendIter> ⓘ
source§fn bounding_box(&self) -> Rect
fn bounding_box(&self) -> Rect
The smallest rectangle that encloses the shape.
source§fn into_path(self, tolerance: f64) -> BezPathwhere
Self: Sized,
fn into_path(self, tolerance: f64) -> BezPathwhere
Self: Sized,
Convert into a Bézier path. Read more
source§fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
fn path_segments(&self, tolerance: f64) -> Segments<Self::PathElementsIter<'_>> ⓘ
source§fn as_rounded_rect(&self) -> Option<RoundedRect>
fn as_rounded_rect(&self) -> Option<RoundedRect>
If the shape is a rounded rectangle, make it available.
source§impl Sub<Vec2> for CircleSegment
impl Sub<Vec2> for CircleSegment
impl Copy for CircleSegment
impl StructuralPartialEq for CircleSegment
Auto Trait Implementations§
impl Freeze for CircleSegment
impl RefUnwindSafe for CircleSegment
impl Send for CircleSegment
impl Sync for CircleSegment
impl Unpin for CircleSegment
impl UnwindSafe for CircleSegment
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
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)