pub trait Polygon2d<T>where
    T: Real,
{ fn vertices(&self) -> &[Point2<T>]; fn num_edges(&self) -> usize; fn get_edge(&self, index: usize) -> Option<LineSegment2d<T>>; fn pseudonormal_on_edge(&self, edge_index: usize, t: T) -> Option<Vector2<T>>; fn num_vertices(&self) -> usize { ... } fn for_each_edge(&self, func: impl FnMut(usize, LineSegment2d<T>)) { ... } fn closest_edge(&self, x: &Point2<T>) -> Option<ClosestEdge<T>> { ... } fn intersects_segment(&self, segment: &LineSegment2d<T>) -> bool { ... } fn signed_area(&self) -> T { ... } fn area(&self) -> T { ... } fn orientation(&self) -> Orientation { ... } }

Required Methods§

source

fn vertices(&self) -> &[Point2<T>]

source

fn num_edges(&self) -> usize

source

fn get_edge(&self, index: usize) -> Option<LineSegment2d<T>>

source

fn pseudonormal_on_edge(&self, edge_index: usize, t: T) -> Option<Vector2<T>>

Returns the given pseudonormal (angle-weighted normal) given an edge index and a parameter representing a point on edge.

If t == 0, then the average normal of this edge and its predecessor neighbor is returned. If t == 1, then the average normal of this edge and its successor neighbor is returned. Otherwise the normal of the edge is returned.

Provided Methods§

source

fn num_vertices(&self) -> usize

source

fn for_each_edge(&self, func: impl FnMut(usize, LineSegment2d<T>))

source

fn closest_edge(&self, x: &Point2<T>) -> Option<ClosestEdge<T>>

source

fn intersects_segment(&self, segment: &LineSegment2d<T>) -> bool

source

fn signed_area(&self) -> T

Computes the signed area of the (simple) polygon.

The signed area of a simple polygon is positive if the polygon has a counter-clockwise orientation, or negative if it is oriented clockwise.

source

fn area(&self) -> T

Computes the area of the (simple) polygon.

source

fn orientation(&self) -> Orientation

Implementors§

source§

impl<T> Polygon2d<T> for SimplePolygon2d<T>where
    T: Real,