pub struct Halfedge {
pub end_vertex: VertexId,
pub face: Option<FaceId>,
pub twin: Option<HalfedgeId>,
pub next: Option<HalfedgeId>,
}
Expand description
A directional edge that points from one vertex to another and is (optionally) part of a face. If it’s not part of a face, it’s called a boundary halfedge.
Fields§
§end_vertex: VertexId
The vertex that this halfedge points to.
face: Option<FaceId>
The face associated to this halfedge. None
if self
is a boundary halfedge.
twin: Option<HalfedgeId>
This is the halfedge opposite.
It points backwards compared to this halfedge (from end_vertex to start_vertex).
After the mesh graph is constructed, this field is always Some(...)
, meaning
that every halfedge has a twin.
next: Option<HalfedgeId>
The next halfedge in the face. None
if self
is a boundary halfedge.
Implementations§
Source§impl Halfedge
impl Halfedge
Sourcepub fn start_vertex(&self, mesh_graph: &MeshGraph) -> VertexId
pub fn start_vertex(&self, mesh_graph: &MeshGraph) -> VertexId
Start vertex from which this halfedge points away
Sourcepub fn twin(&self) -> HalfedgeId
pub fn twin(&self) -> HalfedgeId
Same as the field twin
but expects there to be a Some
which is the case if
the mesh graph is constructed correctly.
Sourcepub fn prev(&self, mesh_graph: &MeshGraph) -> Option<HalfedgeId>
pub fn prev(&self, mesh_graph: &MeshGraph) -> Option<HalfedgeId>
Previous halfedge that shares the same face. None
if self
is a boundary halfedge.
Sourcepub fn ccw_rotated_neighbour(
&self,
mesh_graph: &MeshGraph,
) -> Option<HalfedgeId>
pub fn ccw_rotated_neighbour( &self, mesh_graph: &MeshGraph, ) -> Option<HalfedgeId>
In counter-clockwise order next halfedge that has the same start vertex
Sourcepub fn cw_rotated_neighbour(&self, mesh_graph: &MeshGraph) -> Option<HalfedgeId>
pub fn cw_rotated_neighbour(&self, mesh_graph: &MeshGraph) -> Option<HalfedgeId>
In clockwise order next halfedge that has the same start vertex
Sourcepub fn length_squared(&self, mesh_graph: &MeshGraph) -> f32
pub fn length_squared(&self, mesh_graph: &MeshGraph) -> f32
Length of the halfedge squared.
Sourcepub fn is_boundary(&self) -> bool
pub fn is_boundary(&self) -> bool
Returns true
if there is no face adjacent to this halfedge.
Sourcepub fn is_adjacent_to_boundary(&self, mesh_graph: &MeshGraph) -> bool
pub fn is_adjacent_to_boundary(&self, mesh_graph: &MeshGraph) -> bool
Returns true
if the start or end vertex is a boundary vertex.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Halfedge
impl RefUnwindSafe for Halfedge
impl Send for Halfedge
impl Sync for Halfedge
impl Unpin for Halfedge
impl UnwindSafe for Halfedge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.