Skip to main content

SimpleShape

Trait SimpleShape 

Source
pub trait SimpleShape<I: IntNumber> {
    // Required methods
    fn is_simple(&self) -> bool;
    fn simplified(&self) -> Option<IntShape<I>>;
}
Expand description

A trait for determining if a shape, composed of multiple contours, is simple, and for obtaining a simplified version.

Required Methods§

Source

fn is_simple(&self) -> bool

Checks if the shape is simple, meaning all its contours are simple.

§Returns
  • true if all contours in the shape are simple.
  • false if any contour is complex.
Source

fn simplified(&self) -> Option<IntShape<I>>

Returns an optional simplified version of the shape.

§Returns
  • Some(IntShape) containing the simplified shape if simplification is possible.
  • None if the shape is degenerate or empty.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<I: IntNumber> SimpleShape<I> for [IntContour<I>]

Implementors§