Geometry2DExt

Trait Geometry2DExt 

Source
pub trait Geometry2DExt: Geometry {
    // Required methods
    fn aabb_2d(&self) -> AABB2D<Self::Scalar>;
    fn outer_ring(&self) -> &[(Self::Scalar, Self::Scalar)];
    fn holes(&self) -> &[Vec<(Self::Scalar, Self::Scalar)>];
    fn is_convex(&self) -> bool;
    fn convex_hull(&self) -> Vec<(Self::Scalar, Self::Scalar)>;
    fn perimeter(&self) -> Self::Scalar;

    // Provided method
    fn has_holes(&self) -> bool { ... }
}
Expand description

Extended trait for 2D geometries.

Required Methods§

Source

fn aabb_2d(&self) -> AABB2D<Self::Scalar>

Returns the 2D AABB.

Source

fn outer_ring(&self) -> &[(Self::Scalar, Self::Scalar)]

Returns the outer boundary as a sequence of points (polygon vertices).

Source

fn holes(&self) -> &[Vec<(Self::Scalar, Self::Scalar)>]

Returns any holes in the geometry.

Source

fn is_convex(&self) -> bool

Returns true if this geometry is convex.

Source

fn convex_hull(&self) -> Vec<(Self::Scalar, Self::Scalar)>

Returns the convex hull of this geometry.

Source

fn perimeter(&self) -> Self::Scalar

Returns the perimeter of this geometry.

Provided Methods§

Source

fn has_holes(&self) -> bool

Returns true if this geometry has holes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§