pub struct HalfEdgeMesh<C: Config = PolyConfig> { /* private fields */ }Expand description
Implementation of the half edge mesh. This data structure is widely used in geometry processing due to its many capabilities paired with fairly good speed and memory consumption.
This data structure allows you to represent polygon meshes where each face can have differently many vertices. (However, you can restrict this mesh to triangle meshes via the configuration.) Furthermore, it can answer all adjacency queries and exposes full edges.
The half edge mesh is a half-edge based data structure, with most of the connectivity stored per half edge. Each face and vertex just store one arbitrary half edge handle. This diagram illustrates the fields stored per half edge. (Not shown in the diagram: each half edge also stores the handle of its face.)
§References
Introduced in: Mäntylä, Martti. An introduction to solid modeling. Computer science press, 1988.
Trait Implementations§
Source§impl<C: Config> BasicAdj for HalfEdgeMesh<C>
impl<C: Config> BasicAdj for HalfEdgeMesh<C>
type VerticesAroundFaceIter<'s> = FaceToVertexIter<'s, C>
Source§fn vertices_around_triangle(&self, face: FaceHandle) -> [VertexHandle; 3]where
Self: TriMesh,
fn vertices_around_triangle(&self, face: FaceHandle) -> [VertexHandle; 3]where
Self: TriMesh,
Source§fn vertices_around_face(
&self,
face: FaceHandle,
) -> Self::VerticesAroundFaceIter<'_>
fn vertices_around_face( &self, face: FaceHandle, ) -> Self::VerticesAroundFaceIter<'_>
Source§fn is_vertex_around_face(&self, vertex: VertexHandle, face: FaceHandle) -> bool
fn is_vertex_around_face(&self, vertex: VertexHandle, face: FaceHandle) -> bool
Source§impl<C: Config> Clone for HalfEdgeMesh<C>
impl<C: Config> Clone for HalfEdgeMesh<C>
Source§impl<C: Config> Debug for HalfEdgeMesh<C>
impl<C: Config> Debug for HalfEdgeMesh<C>
Source§impl<C: Config> EdgeAdj for HalfEdgeMesh<C>
impl<C: Config> EdgeAdj for HalfEdgeMesh<C>
Source§type EdgesAroundVertexIter<'s> = VertexToEdgeIter<'s, C>
type EdgesAroundVertexIter<'s> = VertexToEdgeIter<'s, C>
Self::edges_around_vertex.Source§type EdgesAroundFaceIter<'s> = FaceToEdgeIter<'s, C>
type EdgesAroundFaceIter<'s> = FaceToEdgeIter<'s, C>
Self::edges_around_vertex.Source§fn endpoints_of_edge(&self, edge: EdgeHandle) -> [VertexHandle; 2]
fn endpoints_of_edge(&self, edge: EdgeHandle) -> [VertexHandle; 2]
Source§fn faces_of_edge(&self, edge: EdgeHandle) -> DiList<FaceHandle>
fn faces_of_edge(&self, edge: EdgeHandle) -> DiList<FaceHandle>
Source§fn edges_around_vertex(
&self,
vertex: VertexHandle,
) -> Self::EdgesAroundVertexIter<'_>
fn edges_around_vertex( &self, vertex: VertexHandle, ) -> Self::EdgesAroundVertexIter<'_>
Source§fn edges_around_face(&self, face: FaceHandle) -> Self::EdgesAroundFaceIter<'_>
fn edges_around_face(&self, face: FaceHandle) -> Self::EdgesAroundFaceIter<'_>
Source§fn edges_around_triangle(&self, face: FaceHandle) -> [EdgeHandle; 3]where
Self: TriMesh,
fn edges_around_triangle(&self, face: FaceHandle) -> [EdgeHandle; 3]where
Self: TriMesh,
Source§fn is_boundary_edge(&self, edge: EdgeHandle) -> bool
fn is_boundary_edge(&self, edge: EdgeHandle) -> bool
Source§fn edge_between_vertices(
&self,
a: VertexHandle,
b: VertexHandle,
) -> Option<EdgeHandle>
fn edge_between_vertices( &self, a: VertexHandle, b: VertexHandle, ) -> Option<EdgeHandle>
None if the two
vertices are not connected.Source§impl<C: Config> Empty for HalfEdgeMesh<C>
impl<C: Config> Empty for HalfEdgeMesh<C>
Source§impl<C: Config> FullAdj for HalfEdgeMesh<C>
impl<C: Config> FullAdj for HalfEdgeMesh<C>
type FacesAroundFaceIter<'s> = FaceToFaceIter<'s, C>
Source§type FacesAroundVertexIter<'s> = VertexToFaceIter<'s, C>
type FacesAroundVertexIter<'s> = VertexToFaceIter<'s, C>
Self::faces_around_vertex.Source§type VerticesAroundVertexIter<'s> = VertexToVertexIter<'s, C>
type VerticesAroundVertexIter<'s> = VertexToVertexIter<'s, C>
Self::vertices_around_vertex.Source§fn faces_around_triangle(&self, face: FaceHandle) -> TriList<FaceHandle>where
Self: TriMesh,
fn faces_around_triangle(&self, face: FaceHandle) -> TriList<FaceHandle>where
Self: TriMesh,
Source§fn faces_around_face(&self, face: FaceHandle) -> Self::FacesAroundFaceIter<'_>
fn faces_around_face(&self, face: FaceHandle) -> Self::FacesAroundFaceIter<'_>
Source§fn faces_around_vertex(
&self,
vh: VertexHandle,
) -> Self::FacesAroundVertexIter<'_>
fn faces_around_vertex( &self, vh: VertexHandle, ) -> Self::FacesAroundVertexIter<'_>
Source§fn vertices_around_vertex(
&self,
vh: VertexHandle,
) -> Self::VerticesAroundVertexIter<'_>
fn vertices_around_vertex( &self, vh: VertexHandle, ) -> Self::VerticesAroundVertexIter<'_>
Source§fn is_boundary_face(&self, face: FaceHandle) -> bool
fn is_boundary_face(&self, face: FaceHandle) -> bool
Source§fn is_boundary_vertex(&self, vertex: VertexHandle) -> bool
fn is_boundary_vertex(&self, vertex: VertexHandle) -> bool
Source§fn is_isolated_vertex(&self, vertex: VertexHandle) -> bool
fn is_isolated_vertex(&self, vertex: VertexHandle) -> bool
Source§fn are_faces_adjacent(&self, a: FaceHandle, b: FaceHandle) -> bool
fn are_faces_adjacent(&self, a: FaceHandle, b: FaceHandle) -> bool
Source§fn are_vertices_adjacent(&self, a: VertexHandle, b: VertexHandle) -> bool
fn are_vertices_adjacent(&self, a: VertexHandle, b: VertexHandle) -> bool
Source§impl<C: Config> Mesh for HalfEdgeMesh<C>
impl<C: Config> Mesh for HalfEdgeMesh<C>
Source§type Orientable = True
type Orientable = True
Source§fn num_vertices(&self) -> hsize
fn num_vertices(&self) -> hsize
Source§fn next_vertex_handle_from(&self, start: VertexHandle) -> Option<VertexHandle>
fn next_vertex_handle_from(&self, start: VertexHandle) -> Option<VertexHandle>
start’s
index, or None if there is no such handle. Read moreSource§fn next_face_handle_from(&self, start: FaceHandle) -> Option<FaceHandle>
fn next_face_handle_from(&self, start: FaceHandle) -> Option<FaceHandle>
start’s
index, or None if there is no such handle. Read moreSource§fn last_vertex_handle(&self) -> Option<VertexHandle>
fn last_vertex_handle(&self) -> Option<VertexHandle>
None if there are no vertices in the mesh. Read moreSource§fn last_face_handle(&self) -> Option<FaceHandle>
fn last_face_handle(&self) -> Option<FaceHandle>
None if there are no vertices in the mesh. Read moreSource§fn contains_vertex(&self, vertex: VertexHandle) -> bool
fn contains_vertex(&self, vertex: VertexHandle) -> bool
Source§fn contains_face(&self, face: FaceHandle) -> bool
fn contains_face(&self, face: FaceHandle) -> bool
Source§fn next_edge_handle_from(&self, start: EdgeHandle) -> Option<EdgeHandle>where
Self: EdgeMesh,
fn next_edge_handle_from(&self, start: EdgeHandle) -> Option<EdgeHandle>where
Self: EdgeMesh,
start’s
index, or None if there is no such handle. Read moreSource§fn last_edge_handle(&self) -> Option<EdgeHandle>where
Self: EdgeMesh,
fn last_edge_handle(&self) -> Option<EdgeHandle>where
Self: EdgeMesh,
None if there are no vertices in the mesh. Read moreSource§fn contains_edge(&self, edge: EdgeHandle) -> boolwhere
Self: EdgeMesh,
fn contains_edge(&self, edge: EdgeHandle) -> boolwhere
Self: EdgeMesh,
Source§fn check_integrity(&self)
fn check_integrity(&self)
Source§fn get_ref<H: Handle>(&self, handle: H) -> ElementRef<'_, H, Self>
fn get_ref<H: Handle>(&self, handle: H) -> ElementRef<'_, H, Self>
ElementRef with the given handle referencing this mesh.Source§fn vertex_handles(&self) -> HandleIter<'_, Self, VertexHandle> ⓘ
fn vertex_handles(&self) -> HandleIter<'_, Self, VertexHandle> ⓘ
Source§fn vertex_handles_mut(&mut self) -> HandleIterMut<'_, Self, VertexHandle> ⓘ
fn vertex_handles_mut(&mut self) -> HandleIterMut<'_, Self, VertexHandle> ⓘ
Source§fn vertices(&self) -> ElementRefIter<'_, Self, VertexHandle> ⓘ
fn vertices(&self) -> ElementRefIter<'_, Self, VertexHandle> ⓘ
Source§fn face_handles(&self) -> HandleIter<'_, Self, FaceHandle> ⓘ
fn face_handles(&self) -> HandleIter<'_, Self, FaceHandle> ⓘ
Source§fn face_handles_mut(&mut self) -> HandleIterMut<'_, Self, FaceHandle> ⓘ
fn face_handles_mut(&mut self) -> HandleIterMut<'_, Self, FaceHandle> ⓘ
Source§fn faces(&self) -> ElementRefIter<'_, Self, FaceHandle> ⓘ
fn faces(&self) -> ElementRefIter<'_, Self, FaceHandle> ⓘ
Source§fn edge_handles(&self) -> HandleIter<'_, Self, EdgeHandle> ⓘwhere
Self: EdgeMesh,
fn edge_handles(&self) -> HandleIter<'_, Self, EdgeHandle> ⓘwhere
Self: EdgeMesh,
Source§fn edge_handles_mut(&mut self) -> HandleIterMut<'_, Self, EdgeHandle> ⓘwhere
Self: EdgeMesh,
fn edge_handles_mut(&mut self) -> HandleIterMut<'_, Self, EdgeHandle> ⓘwhere
Self: EdgeMesh,
Source§fn edges(&self) -> ElementRefIter<'_, Self, EdgeHandle> ⓘwhere
Self: EdgeMesh,
fn edges(&self) -> ElementRefIter<'_, Self, EdgeHandle> ⓘwhere
Self: EdgeMesh,
Source§fn is_tri_mesh(&self) -> bool
fn is_tri_mesh(&self) -> bool
true if Self is a TriMesh, meaning that all faces are
triangles. If false is returned, that means that you can’t assume all
faces are triangles, but it could still be the case.Source§impl<C: Config> MeshMut for HalfEdgeMesh<C>
impl<C: Config> MeshMut for HalfEdgeMesh<C>
Source§fn add_vertex(&mut self) -> VertexHandle
fn add_vertex(&mut self) -> VertexHandle
Source§fn add_triangle(&mut self, [a, b, c]: [VertexHandle; 3]) -> FaceHandle
fn add_triangle(&mut self, [a, b, c]: [VertexHandle; 3]) -> FaceHandle
Source§fn add_face(&mut self, vertices: &[VertexHandle]) -> FaceHandlewhere
Self: PolyMesh,
fn add_face(&mut self, vertices: &[VertexHandle]) -> FaceHandlewhere
Self: PolyMesh,
Source§fn remove_isolated_vertex(&mut self, v: VertexHandle)
fn remove_isolated_vertex(&mut self, v: VertexHandle)
vertex from the mesh. You have to make
sure that the given vertex is indeed isolated! Read moreSource§fn remove_face(&mut self, f: FaceHandle)
fn remove_face(&mut self, f: FaceHandle)
Source§fn reserve_for_vertices(&mut self, count: hsize)
fn reserve_for_vertices(&mut self, count: hsize)
count additional vertices. Read moreSource§fn reserve_for_faces(&mut self, count: hsize)
fn reserve_for_faces(&mut self, count: hsize)
count additional faces. Read moreSource§fn remove_all_vertices(&mut self)
fn remove_all_vertices(&mut self)
Source§fn remove_all_faces(&mut self)
fn remove_all_faces(&mut self)
remove_face for each face individually. Also
removes all edges.Source§fn split_face(&mut self, f: FaceHandle) -> VertexHandle
fn split_face(&mut self, f: FaceHandle) -> VertexHandle
f into k new faces (where k is the valence of f) by
inserting a center vertex. This new vertex is returned. This operation
is sometimes called “1-to-n split”. Read moreSource§fn flip_edge(&mut self, edge: EdgeHandle)
fn flip_edge(&mut self, edge: EdgeHandle)
e. Requires e to be an
interior edge (i.e. being adjacent to two faces). Read more