pub trait Face: Clone + Eq {
type Vertex: Vertex<Face = Self, HalfEdge = Self::HalfEdge>;
type HalfEdge: HalfEdge<Face = Self, Vertex = Self::Vertex>;
// Required methods
fn index(&self) -> usize;
fn area(&self) -> f64;
fn num_sides(&self) -> usize;
fn side(&self, index: usize) -> Self::HalfEdge;
// Provided methods
fn vertex(&self, index: usize) -> Self::Vertex { ... }
fn vertices(&self) -> impl Iterator<Item = Self::Vertex> { ... }
fn sides(&self) -> impl Iterator<Item = Self::HalfEdge> { ... }
}Expand description
Required Associated Types§
Required Methods§
Sourcefn index(&self) -> usize
fn index(&self) -> usize
The index of this vertex within the Sphere::faces list.
Sourcefn area(&self) -> f64
fn area(&self) -> f64
The area of this face.
This is also known as the solid angle
subtended by the face. The sum of the areas of all faces on a sphere is 4 π.
For faces whose edges are all geodesics, this is equivalent to the util::poly_area
of the vertices of the face.
Provided Methods§
Sourcefn vertex(&self, index: usize) -> Self::Vertex
fn vertex(&self, index: usize) -> Self::Vertex
Gets a Vertex of this face given its index within Face::vertices.
This should be equivalent to side(index).start().
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.