Trait mgf::Polygon
[−]
[src]
pub trait Polygon: Shape { type FaceType: Contains<Point3<f32>> + Into<Plane> + Clone; fn num_vertices(&self) -> usize; fn vertex(&self, _: usize) -> Point3<f32>; fn num_edges(&self) -> usize; fn edge(&self, _: usize) -> (usize, usize); fn face(&self) -> &Self::FaceType; }
A type that is composed of vertices, edges and has a face.
Besides being able to present their vertices and edges, a Polygon can produce a reference to some a face, which is a type that can be decomposed into a plane and determine if it contains a point.
Associated Types
type FaceType: Contains<Point3<f32>> + Into<Plane> + Clone
Type of the face object the polygon returns.
Required Methods
fn num_vertices(&self) -> usize
The number of edges available to query.
fn vertex(&self, _: usize) -> Point3<f32>
Returns the ith vertex as a Point.
fn num_edges(&self) -> usize
The number of edges available to query.
fn edge(&self, _: usize) -> (usize, usize)
Returns the ith edge of the polygon as a pair of indices.