pub trait ConvexPolygon3d<'a, T: Scalar>: Debug {
    fn num_vertices(&self) -> usize;
    fn get_vertex(&self, index: usize) -> Option<Point3<T>>;

    fn compute_plane(&self) -> Option<Plane<T>>
    where
        T: Real
, { ... } fn compute_half_space(&self) -> Option<HalfSpace<T>>
    where
        T: Real
, { ... } fn compute_area_vector(&self) -> Vector3<T>
    where
        T: Real
, { ... } fn compute_normal(&self) -> Vector3<T>
    where
        T: Real
, { ... } fn closest_point(&self, point: &Point3<T>) -> PolygonClosestPoint<T, U3>
    where
        T: Real
, { ... } }
Expand description

A convex polygon in 3D.

Vertices are assumed to be ordered counter-clockwise.

Required Methods§

source

fn num_vertices(&self) -> usize

source

fn get_vertex(&self, index: usize) -> Option<Point3<T>>

Provided Methods§

source

fn compute_plane(&self) -> Option<Plane<T>>where
    T: Real,

source

fn compute_half_space(&self) -> Option<HalfSpace<T>>where
    T: Real,

source

fn compute_area_vector(&self) -> Vector3<T>where
    T: Real,

Computes a vector normal to the polygon (oriented outwards w.r.t. a counter-clockwise orientation), whose absolute magnitude is the area of the polygon.

Note that if the polygon is non-planar or not properly oriented, there are no guarantees on the quality of the result.

source

fn compute_normal(&self) -> Vector3<T>where
    T: Real,

Computes an outwards-facing normalized vector perpendicular to the polygon.

source

fn closest_point(&self, point: &Point3<T>) -> PolygonClosestPoint<T, U3>where
    T: Real,

Implementors§

source§

impl<'a, T> ConvexPolygon3d<'a, T> for Quad3d<T>where
    T: Scalar,

source§

impl<'a, T: Real> ConvexPolygon3d<'a, T> for Triangle3d<T>

source§

impl<'a, T: Scalar> ConvexPolygon3d<'a, T> for PolyMeshFace<'a, T, U3>