Trait Vertex

Source
pub trait Vertex: Clone + Eq {
    type Face: Face<Vertex = Self, HalfEdge = Self::HalfEdge>;
    type HalfEdge: HalfEdge<Face = Self::Face, Vertex = Self>;

    // Required methods
    fn index(&self) -> usize;
    fn pos(&self) -> [f64; 3];
    fn degree(&self) -> usize;
    fn outgoing(&self, index: usize) -> Self::HalfEdge;

    // Provided methods
    fn face(&self, index: usize) -> Self::Face { ... }
    fn faces(&self) -> impl Iterator<Item = Self::Face> { ... }
    fn outgoings(&self) -> impl Iterator<Item = Self::HalfEdge> { ... }
}
Expand description

Represents a vertex on a Sphere.

Required Associated Types§

Source

type Face: Face<Vertex = Self, HalfEdge = Self::HalfEdge>

The type of Face on the sphere.

Source

type HalfEdge: HalfEdge<Face = Self::Face, Vertex = Self>

The type of HalfEdge on the sphere.

Required Methods§

Source

fn index(&self) -> usize

The index of this vertex within the Sphere::vertices list.

Source

fn pos(&self) -> [f64; 3]

The position of this vertex.

This is guaranteed to be a unit-length vector.

Source

fn degree(&self) -> usize

The number of edges (or equivalently, Faces) that are connected to this vertex.

Source

fn outgoing(&self, index: usize) -> Self::HalfEdge

Gets an outgoing HalfEdge based on its index within the Vertex::outgoings list.

Provided Methods§

Source

fn face(&self, index: usize) -> Self::Face

Gets a connected Face based on its index within the Vertex::faces list.

Source

fn faces(&self) -> impl Iterator<Item = Self::Face>

Iterates over the Faces which are connected to this vertex.

Source

fn outgoings(&self) -> impl Iterator<Item = Self::HalfEdge>

Iterates over the outgoing HalfEdges which have this vertex as their start.

Edges will be returned in counter-clockwise order around the vertex.

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.

Implementors§

Source§

impl Vertex for subsphere::basetri::Vertex

Source§

impl<Proj: Eq + Clone + BaseTriProjector> Vertex for subsphere::hex::Vertex<Proj>

Source§

type Face = Face<Proj>

Source§

type HalfEdge = HalfEdge<Proj>

Source§

impl<Proj: Eq + Clone + BaseTriProjector> Vertex for subsphere::tri::Vertex<Proj>

Source§

type Face = Face<Proj>

Source§

type HalfEdge = HalfEdge<Proj>