Type Alias RoundConvexPolygon

Source
pub type RoundConvexPolygon = RoundShape<ConvexPolygon>;
Expand description

A convex polygon dilated by a sphere (so it has round corners).

Aliased Type§

#[repr(C)]
pub struct RoundConvexPolygon { pub inner_shape: ConvexPolygon, pub border_radius: f32, }

Fields§

§inner_shape: ConvexPolygon

The shape being rounded.

This is the original, “inner” shape before the border radius is applied. The rounded shape’s surface will be at a distance of border_radius from this inner shape’s surface.

§border_radius: f32

The radius of the rounded border.

This value determines how much the shape is expanded outward. A larger border radius creates a more “padded” shape. Must be non-negative (typically positive).

For example, if border_radius is 0.5, every point on the original shape’s surface will be moved 0.5 units outward along its surface normal.

Implementations§

Source§

impl RoundConvexPolygon

Source

pub fn to_polyline(&self, border_subdivs: u32) -> Vec<Point2<f32>>

Discretize the boundary of this round convex polygon as a polygonal line.