HalfEdge

Trait HalfEdge 

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

    // Required methods
    fn length(&self) -> f64;
    fn angle(&self) -> f64;
    fn inside(&self) -> Self::Face;
    fn start(&self) -> Self::Vertex;
    fn twin(&self) -> Self;
    fn prev(&self) -> Self;
    fn next(&self) -> Self;

    // Provided methods
    fn side_index(&self) -> usize { ... }
    fn outgoing_index(&self) -> usize { ... }
}
Expand description

Represents one “side” or direction of an edge on a Sphere.

Half-edge data structures are used to conveniently represent the topology of a sphere and traverse between different elements.

Required Associated Types§

Source

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

The type of Face on the sphere.

Source

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

The type of Vertex on the sphere.

Required Methods§

Source

fn length(&self) -> f64

The length of the edge.

For edges that are geodesics, this is equivalent to the util::dist between its endpoints.

Source

fn angle(&self) -> f64

The interior angle between the previous half-edge and this half-edge.

The sum of the angles of all outgoing half-edges at a vertex should be 2 π.

If both this edge, and the previous edge, are geodesics, the angle is equivalent to util::angle where the b vertex is given by self.start().

Source

fn inside(&self) -> Self::Face

Gets the Face whose interior boundary contains this half-edge.

Source

fn start(&self) -> Self::Vertex

Gets the Vertex at the “start” of this half-edge.

Source

fn twin(&self) -> Self

Gets the complementary half-edge on the opposite side of the edge.

The returned half-edge will go in the opposite direction along the same edge. It will have the opposite start and inside. This method is its own inverse, i.e. for all half-edges e, e.twin().twin() == e.

Source

fn prev(&self) -> Self

Gets the half-edge which shares the inside face of this half-edge and precedes it in counter-clockwise order around the face.

Source

fn next(&self) -> Self

Gets the half-edge which shares the inside face of this half-edge and follows it in counter-clockwise order around the face.

Provided Methods§

Source

fn side_index(&self) -> usize

The index of this half-edge within the Face::sides list of its inside.

Source

fn outgoing_index(&self) -> usize

The index of this half-edge within the Vertex::outgoings list of its 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.

Implementors§

Source§

impl HalfEdge for subsphere::basetri::HalfEdge

Source§

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

Source§

type Face = Face<Proj>

Source§

type Vertex = Vertex<Proj>

Source§

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

Source§

type Face = Face<Proj>

Source§

type Vertex = Vertex<Proj>