Struct kurbo::CircleSegment
source · 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§
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<'de> Deserialize<'de> for CircleSegment
impl<'de> Deserialize<'de> for CircleSegment
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl JsonSchema for CircleSegment
impl JsonSchema for CircleSegment
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl PartialEq for CircleSegment
impl PartialEq for CircleSegment
source§fn eq(&self, other: &CircleSegment) -> bool
fn eq(&self, other: &CircleSegment) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CircleSegment
impl Serialize for CircleSegment
source§impl Shape for CircleSegment
impl Shape for CircleSegment
§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 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 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