Struct kurbo::Arc[][src]

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

Create an iterator generating Bezier path elements.

The generated elements can be appended to an existing bezier path.

Converts an Arc into a series of cubic bezier segments.

Closure will be invoked for each segment.

Creates an Arc from a SvgArc.

Returns None if arc is actually a straight line.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

The name of the generated JSON Schema. Read more

Generates a JSON Schema for this type. Read more

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Note: shape isn’t closed so area is not well defined.

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.

Note: shape isn’t closed, so a point’s winding number is not well defined.

The iterator returned by the path_elements method. Read more

Returns an iterator over this shape expressed as PathEls; that is, as Bézier path elements. Read more

The smallest rectangle that encloses the shape.

Convert to a Bézier path. Read more

Convert into a Bézier path. Read more

Returns an iterator over this shape expressed as Bézier path segments (PathSegs). Read more

Returns true if the Point is inside this shape. Read more

If the shape is a line, make it available.

If the shape is a rectangle, make it available.

If the shape is a rounded rectangle, make it available.

If the shape is a circle, make it available.

If the shape is stored as a slice of path elements, make that available. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.