Trait mgf::Polygon
[−]
[src]
pub trait Polygon: Copy + Shape + Contains<Point3<f32>> + Into<Plane> { const NUM_VERTICES: usize; fn vertex(&self, _: usize) -> Point3<f32>; fn edge(&self, _: usize) -> (usize, usize); }
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 Constants
const NUM_VERTICES: usize
The number of vertices and edges available to query.
Required Methods
fn vertex(&self, _: usize) -> Point3<f32>
Returns the ith vertex as a Point.
fn edge(&self, _: usize) -> (usize, usize)
Returns the ith edge of the polygon as a pair of indices.
In the future this is hoped to be deprecate in favore of a constant associated array. Unfortunately it is impossible as of this yet moment to have arrays depend on associated constants yet.