pub trait Sphere {
type Face: Face<Vertex = Self::Vertex, HalfEdge = Self::HalfEdge>;
type Vertex: Vertex<Face = Self::Face, HalfEdge = Self::HalfEdge>;
type HalfEdge: HalfEdge<Face = Self::Face, Vertex = Self::Vertex>;
// Required methods
fn num_faces(&self) -> usize;
fn face(&self, index: usize) -> Self::Face;
fn faces(&self) -> impl Iterator<Item = Self::Face>;
fn face_at(&self, point: [f64; 3]) -> Self::Face;
fn num_vertices(&self) -> usize;
fn vertex(&self, index: usize) -> Self::Vertex;
fn vertices(&self) -> impl Iterator<Item = Self::Vertex>;
}Expand description
Partitions the surface of the unit sphere into a set of spherical polygons (Faces).
There are numerous requirements for a valid Sphere implementation. Custom implementations
may use util::validate to check that these requirements are met.
Required Associated Types§
Sourcetype Face: Face<Vertex = Self::Vertex, HalfEdge = Self::HalfEdge>
type Face: Face<Vertex = Self::Vertex, HalfEdge = Self::HalfEdge>
The type of Face on this sphere.
Required Methods§
Sourcefn face_at(&self, point: [f64; 3]) -> Self::Face
fn face_at(&self, point: [f64; 3]) -> Self::Face
Determines which face contains the given point on the unit sphere.
If the point is between faces (i.e. on a vertex or edge), one of the faces that contains it inclusively will be returned.
Sourcefn num_vertices(&self) -> usize
fn num_vertices(&self) -> usize
The number of vertices on this sphere.
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.