pub struct Shape { /* private fields */ }Expand description
Multipolygon ink / halo geometry.
Implementations§
Source§impl Shape
impl Shape
pub fn empty() -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn from_ring(ring: &[(f64, f64)]) -> Self
pub fn from_ring(ring: &[(f64, f64)]) -> Self
Single exterior ring (lib-simplify cleans winding / collinear).
Sourcepub fn from_contours_evenodd(contours: &[Vec<(f64, f64)>]) -> Self
pub fn from_contours_evenodd(contours: &[Vec<(f64, f64)>]) -> Self
Independent contours → even-odd / XOR shape (glyph counters).
pub fn disk(cx: f64, cy: f64, radius: f64, quad_segs: u32) -> Self
pub fn capsule(x1: f64, y1: f64, x2: f64, y2: f64, radius: f64) -> Self
pub fn polyline_buffer(pts: &[(f64, f64)], radius: f64) -> Self
pub fn multipoint_buffer(pts: &[(f64, f64)], radius: f64) -> Self
pub fn annular(cx: f64, cy: f64, r: f64, stroke_width: f64) -> Self
pub fn union(&self, other: &Self) -> Self
pub fn difference(&self, other: &Self) -> Self
pub fn xor(&self, other: &Self) -> Self
pub fn point_count(&self) -> usize
pub fn has_holes(&self) -> bool
pub fn translate(&self, dx: f64, dy: f64) -> Self
pub fn scale(&self, sx: f64, sy: f64, ox: f64, oy: f64) -> Self
pub fn bounds(&self) -> Option<(f64, f64, f64, f64)>
pub fn area(&self) -> f64
pub fn centroid(&self) -> Option<(f64, f64)>
pub fn contains(&self, x: f64, y: f64) -> bool
pub fn to_svg_d(&self) -> String
Sourcepub fn horizontal_span_at(&self, y: f64) -> f64
pub fn horizontal_span_at(&self, y: f64) -> f64
Leftmost horizontal chord length at y (stem-width helper).
pub fn polygons_rings(&self) -> Vec<(Vec<(f64, f64)>, Vec<Vec<(f64, f64)>>)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Shape
impl RefUnwindSafe for Shape
impl Send for Shape
impl Sync for Shape
impl Unpin for Shape
impl UnsafeUnpin for Shape
impl UnwindSafe for Shape
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