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§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Arc
impl<'de> Deserialize<'de> for Arc
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 Arc
impl JsonSchema for Arc
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. 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 Shape for Arc
impl Shape for Arc
source§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.
source§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<'iter> = Chain<Once<PathEl>, ArcAppendIter>
type PathElementsIter<'iter> = Chain<Once<PathEl>, ArcAppendIter>
The iterator returned by the
path_elements
method.source§fn path_elements(&self, tolerance: f64) -> Self::PathElementsIter<'_>
fn path_elements(&self, tolerance: f64) -> Self::PathElementsIter<'_>
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.