Trait fenris_geometry::ConvexPolygon3d
source · 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§
fn num_vertices(&self) -> usize
fn get_vertex(&self, index: usize) -> Option<Point3<T>>
Provided Methods§
fn compute_plane(&self) -> Option<Plane<T>>where
T: Real,
fn compute_half_space(&self) -> Option<HalfSpace<T>>where
T: Real,
sourcefn compute_area_vector(&self) -> Vector3<T>where
T: Real,
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.
sourcefn compute_normal(&self) -> Vector3<T>where
T: Real,
fn compute_normal(&self) -> Vector3<T>where
T: Real,
Computes an outwards-facing normalized vector perpendicular to the polygon.