pub struct Dcel<VW, HEW = (), FW = (), VC = Vec<Vertex<VW>>, HEC = Vec<HalfEdge<HEW>>, FC = Vec<Face<FW>>> { /* private fields */ }Expand description
A doubly-connected edge list (DCEL).
Implementations§
Source§impl<VW, HEW, FW, VC, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
Sourcepub fn vertices(&self) -> &VC
pub fn vertices(&self) -> &VC
Returns an immutable reference to the collection holding the data of the vertices.
Sourcepub fn half_edges(&self) -> &HEC
pub fn half_edges(&self) -> &HEC
Returns an immutable reference to the collection holding the data of the half-edges.
Sourcepub fn faces(&self) -> &FC
pub fn faces(&self) -> &FC
Returns an immutable reference to the collection holding the data of the faces.
Sourcepub fn dissolve(self) -> (VC, HEC, FC)
pub fn dissolve(self) -> (VC, HEC, FC)
Dissolve the DCEL, ceding ownership and returning the datas of its vertices, half-edges, and faces.
Source§impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
Sourcepub fn vertex_representative(&self, vertex: VertexId) -> HalfEdgeId
pub fn vertex_representative(&self, vertex: VertexId) -> HalfEdgeId
Returns the vertex’s representative half-edge.
This is always an outgoing half-edge, never an incoming one. That is, the vertex is always the source (origin) vertex of its representative half-edge, never the target vertex.
The representative half-edge of a vertex is one of its two outgoing half-edges that is stored in the vertex datum to make it possible to use the vertex id to access the vertex’s surroundings.
In DCEL terminology, the representative half-edge of a vertex is usually just called “the incident half-edge”, but we prefer to call it differently to distinguish it from the other incident half-edges of the same vertex.
Source§impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
Sourcepub fn find_half_edge_from_to(
&self,
source: VertexId,
target: VertexId,
) -> Option<HalfEdgeId>
pub fn find_half_edge_from_to( &self, source: VertexId, target: VertexId, ) -> Option<HalfEdgeId>
Find the half-edge from source to target, if there is one.
This is done by iterating over all the half-spokes of source, looking
for one whose target is target.
Sourcepub fn find_edge_between(
&self,
source: VertexId,
target: VertexId,
) -> Option<EdgeId>
pub fn find_edge_between( &self, source: VertexId, target: VertexId, ) -> Option<EdgeId>
Find the edge between two vertices, if there is one.
This is done by iterating over all the half-spokes of source, looking
for one whose target is target, and upgrading it to a full edge if
found.
Sourcepub fn find_vertices_common_face(
&self,
vertex1: VertexId,
vertex2: VertexId,
) -> Option<FaceId>
pub fn find_vertices_common_face( &self, vertex1: VertexId, vertex2: VertexId, ) -> Option<FaceId>
Find the common face between two vertices, if there is one.
This is done by iterating over the interspokes of both vertices, looking for a shared one.
Sourcepub fn check_if_boundary_vertex(&self, vertex: VertexId) -> bool
pub fn check_if_boundary_vertex(&self, vertex: VertexId) -> bool
Check if the vertex lies on the DCEL’s boundary.
This is determined by iterating over the vertex spokes and checking if any of them borders the unbounded face.
Source§impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
Sourcepub fn vertex_weight(&self, vertex: VertexId) -> &VW
pub fn vertex_weight(&self, vertex: VertexId) -> &VW
Returns the weight of the vertex.
Source§impl<VW, HEW, FW, VC, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
Sourcepub fn source(&self, half_edge: HalfEdgeId) -> VertexId
pub fn source(&self, half_edge: HalfEdgeId) -> VertexId
Returns the source (origin) vertex of the half-edge.
In DCEL terminology, this vertex is usually called the “origin”. However, here we have opted to use terms from graph theory, where the terms “source vertex” (for this vertex) and “target vertex” (for the vertex on the other end) are used instead.
Sourcepub fn target(&self, half_edge: HalfEdgeId) -> VertexId
pub fn target(&self, half_edge: HalfEdgeId) -> VertexId
Returns the target vertex of the half-edge.
This is the same as the source vertex of the next half-edge.
Sourcepub fn twin(&self, half_edge: HalfEdgeId) -> HalfEdgeId
pub fn twin(&self, half_edge: HalfEdgeId) -> HalfEdgeId
Returns the twin (opposite) of the half-edge.
Sourcepub fn full_edge(&self, half_edge: HalfEdgeId) -> EdgeId
pub fn full_edge(&self, half_edge: HalfEdgeId) -> EdgeId
Returns the edge the half-edge is half of.
Sourcepub fn incident_face(&self, half_edge: HalfEdgeId) -> FaceId
pub fn incident_face(&self, half_edge: HalfEdgeId) -> FaceId
Returns the indicent face of the half-edge.
Sourcepub fn opposite_face(&self, half_edge: HalfEdgeId) -> FaceId
pub fn opposite_face(&self, half_edge: HalfEdgeId) -> FaceId
Returns the opposite face of the half-edge.
This is the same as the incident face of the twin half-edge.
Sourcepub fn edge_endpoints(&self, edge: EdgeId) -> (VertexId, VertexId)
pub fn edge_endpoints(&self, edge: EdgeId) -> (VertexId, VertexId)
Returns the endpoint vertices of the edge.
Sourcepub fn edge_faces(&self, edge: EdgeId) -> (FaceId, FaceId)
pub fn edge_faces(&self, edge: EdgeId) -> (FaceId, FaceId)
Returns the pair of faces adjacent to the edge: the incident face and the opposite face.
Sourcepub fn prev(&self, half_edge: HalfEdgeId) -> HalfEdgeId
pub fn prev(&self, half_edge: HalfEdgeId) -> HalfEdgeId
Returns the previous half-edge in the circulation around the same incident face.
Sourcepub fn next(&self, half_edge: HalfEdgeId) -> HalfEdgeId
pub fn next(&self, half_edge: HalfEdgeId) -> HalfEdgeId
Returns the next half-edge in the circulation around the same incident face.
Sourcepub fn turn_back(&self, half_edge: HalfEdgeId) -> HalfEdgeId
pub fn turn_back(&self, half_edge: HalfEdgeId) -> HalfEdgeId
Returns the half-edge that follows in the rotation around the same source vertex.
This is the same as the twin of the previous half-edge.
Sourcepub fn turn(&self, half_edge: HalfEdgeId) -> HalfEdgeId
pub fn turn(&self, half_edge: HalfEdgeId) -> HalfEdgeId
Returns the half-edge that precedes in the rotation around the same source vertex.
This is the same as the next half-edge of the twin half-edge.
Sourcepub fn half_edge_weight(&self, half_edge: HalfEdgeId) -> &HEW
pub fn half_edge_weight(&self, half_edge: HalfEdgeId) -> &HEW
Returns the weight of the half-edge.
Sourcepub fn edge_weights(&self, edge: EdgeId) -> (&HEW, &HEW)
pub fn edge_weights(&self, edge: EdgeId) -> (&HEW, &HEW)
Returns the pair of half-edge weights of the edge, ascendingly sorted by half-edge indices.
Source§impl<VW, HEW, FW, VC, HEC, FC: Get<usize, Value = Face<FW>>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC, HEC, FC: Get<usize, Value = Face<FW>>> Dcel<VW, HEW, FW, VC, HEC, FC>
Sourcepub fn face_representative(&self, face: FaceId) -> Option<HalfEdgeId>
pub fn face_representative(&self, face: FaceId) -> Option<HalfEdgeId>
Returns the face’s representative half-edge.
The representative half-edge of a face is one of incident half-edges that is stored in the face datum to make it possible to use the face id to access the face’s surroundings.
In DCEL terminology, the representative half-edge of a face is usually just called “the incident half-edge”, but we prefer to call it differently to distinguish it from the other incident half-edges of the same face.
Sourcepub fn face_weight(&self, face: FaceId) -> &FW
pub fn face_weight(&self, face: FaceId) -> &FW
Returns the weight of the face.
Source§impl<VW, HEW, FW, VC, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
Sourcepub fn unbounded_face(&self) -> FaceId
pub fn unbounded_face(&self) -> FaceId
Returns the unbounded face.
The unbounded face is always the first element of the face list.
Source§impl<VW: Clone + Eq + Ord, HEW: Clone + Default, FW: Clone + Default, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW: Clone + Eq + Ord, HEW: Clone + Default, FW: Clone + Default, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn insert_mesh( &mut self, face_polygons: impl IntoIterator<Item = impl IntoIterator<Item = VW>>, ) -> Vec<FaceId>
pub fn insert_mesh_in_face( &mut self, face_polygons: impl IntoIterator<Item = impl IntoIterator<Item = VW>>, ) -> Vec<FaceId>
Source§impl<VW: Clone, HEW: Clone + Default, FW: Clone + Default, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW: Clone, HEW: Clone + Default, FW: Clone + Default, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn insert_polygon( &mut self, vertex_weights: impl IntoIterator<Item = VW>, ) -> FaceId
pub fn insert_polygon_in_face( &mut self, outer_face: FaceId, vertex_weights: impl IntoIterator<Item = VW>, ) -> FaceId
Source§impl<VW: Clone, HEW: Clone, FW: Clone, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW: Clone, HEW: Clone, FW: Clone, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn insert_polygon_with_all_weights( &mut self, vertex_weights: impl IntoIterator<Item = VW>, edge_weights: impl IntoIterator<Item = (HEW, HEW)>, face_weight: FW, ) -> FaceId
pub fn insert_polygon_in_face_with_all_weights( &mut self, outer_face: FaceId, vertex_weights: impl IntoIterator<Item = VW>, edge_weights: impl IntoIterator<Item = (HEW, HEW)>, face_weight: FW, ) -> FaceId
Source§impl<VW: Clone, HEW: Clone + Default, FW: Clone + Default, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW: Clone, HEW: Clone + Default, FW: Clone + Default, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn insert_edge( &mut self, from: VertexId, to: VertexId, ) -> ((HalfEdgeId, HalfEdgeId), FaceId)
pub fn insert_edge_chain( &mut self, from: VertexId, to: VertexId, vertex_weights: impl IntoIterator<Item = VW>, ) -> (Vec<(HalfEdgeId, HalfEdgeId)>, FaceId)
Source§impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn vertex_half_spokes( &self, vertex: VertexId, ) -> HalfSpokesIter<'_, VW, HEW, FW, VC, HEC, FC> ⓘ
pub fn vertex_half_spokes_reverse( &self, vertex: VertexId, ) -> HalfSpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC> ⓘ
Source§impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn vertex_rim_vertices( &self, vertex: VertexId, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn vertex_rim_vertices_reverse( &self, vertex: VertexId, ) -> CirculateVertexesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
Source§impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn vertex_rim_half_edges( &self, vertex: VertexId, ) -> CirculateHalfEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn vertex_rim_half_edges_reverse( &self, vertex: VertexId, ) -> CirculateHalfEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
Source§impl<VW, HEW, FW, VC, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn half_spokes( &self, initial_half_edge: HalfEdgeId, ) -> HalfSpokesIter<'_, VW, HEW, FW, VC, HEC, FC> ⓘ
pub fn half_spokes_reverse( &self, initial_half_edge: HalfEdgeId, ) -> HalfSpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC> ⓘ
Source§impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn vertex_spokes( &self, vertex: VertexId, ) -> SpokesIter<'_, VW, HEW, FW, VC, HEC, FC> ⓘ
pub fn vertex_spokes_reverse( &self, vertex: VertexId, ) -> SpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC> ⓘ
Source§impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn vertex_rim_edges( &self, vertex: VertexId, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn vertex_rim_edges_reverse( &self, vertex: VertexId, ) -> CirculateEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
Source§impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn vertex_interspokes( &self, vertex: VertexId, ) -> InterspokesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn vertex_interspokes_reverse( &self, vertex: VertexId, ) -> InterspokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
Source§impl<VW, HEW, FW, VC, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn spokes( &self, initial_half_edge: HalfEdgeId, ) -> SpokesIter<'_, VW, HEW, FW, VC, HEC, FC> ⓘ
pub fn spokes_reverse( &self, initial_half_edge: HalfEdgeId, ) -> SpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC> ⓘ
pub fn interspokes( &self, initial_half_edge: HalfEdgeId, ) -> InterspokesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn interspokes_reverse( &self, initial_half_edge: HalfEdgeId, ) -> InterspokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
Source§impl<VW, HEW, FW, VC, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC, HEC: Get<usize, Value = HalfEdge<HEW>>, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn circulate_vertices( &self, initial_half_edge: HalfEdgeId, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_vertices_reverse( &self, initial_half_edge: HalfEdgeId, ) -> CirculateVertexesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_vertices_with_excludes( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_vertices_with_excludes_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateVertexesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_half_edges( &self, initial_half_edge: HalfEdgeId, ) -> CirculateHalfEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_half_edges_reverse( &self, initial_half_edge: HalfEdgeId, ) -> CirculateHalfEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_half_edges_with_excludes( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateHalfEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_half_edges_with_excludes_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateHalfEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_edges( &self, initial_half_edge: HalfEdgeId, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_edges_reverse( &self, initial_half_edge: HalfEdgeId, ) -> CirculateEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_edges_with_excludes( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulate_edges_with_excludes_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_half_spokes( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateHalfSpokesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_half_spokes_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateHalfSpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_spokes( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculationSpokesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_spokes_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculationSpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_interspokes( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculationInterspokesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_interspokes_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculationInterspokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_rim_half_edges( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateHalfEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_rim_half_edges_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateHalfEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_rim_edges( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_rim_edges_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_rim_vertices( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn circulation_rim_vertices_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateVertexesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
Source§impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC: Get<usize, Value = Face<FW>>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC: Get<usize, Value = Vertex<VW>>, HEC: Get<usize, Value = HalfEdge<HEW>>, FC: Get<usize, Value = Face<FW>>> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn face_vertices( &self, face: FaceId, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_vertices_reverse( &self, face: FaceId, ) -> CirculateVertexesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
Source§impl<VW, HEW, FW, VC, HEC, FC: Get<usize, Value = Face<FW>>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC, HEC, FC: Get<usize, Value = Face<FW>>> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn face_half_edges( &self, face: FaceId, ) -> CirculateHalfEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_half_edges_reverse( &self, face: FaceId, ) -> CirculateHalfEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_edges( &self, face: FaceId, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_edges_reverse( &self, face: FaceId, ) -> CirculateEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
Source§impl<VW, HEW, FW, VC, HEC: Get<usize, Value = HalfEdge<HEW>>, FC: Get<usize, Value = Face<FW>>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW, HEW, FW, VC, HEC: Get<usize, Value = HalfEdge<HEW>>, FC: Get<usize, Value = Face<FW>>> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn face_half_spokes( &self, face: FaceId, ) -> CirculateHalfSpokesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_half_spokes_reverse( &self, face: FaceId, ) -> CirculateHalfSpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_spokes( &self, face: FaceId, ) -> CirculationSpokesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_spokes_reverse( &self, face: FaceId, ) -> CirculationSpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_interspokes( &self, face: FaceId, ) -> CirculationInterspokesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_interspokes_reverse( &self, face: FaceId, ) -> CirculationInterspokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_rim_half_edges( &self, face: FaceId, ) -> CirculateHalfEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_rim_half_edges_reverse( &self, face: FaceId, ) -> CirculateHalfEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_rim_vertices( &self, face: FaceId, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_rim_vertices_reverse( &self, face: FaceId, ) -> CirculateVertexesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_rim_edges( &self, face: FaceId, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>
pub fn face_rim_edges_reverse( &self, face: FaceId, ) -> CirculateEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>
Source§impl<VW: Clone, HEW: Clone, FW: Clone, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + StableRemove<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + StableRemove<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + StableRemove<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW: Clone, HEW: Clone, FW: Clone, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + StableRemove<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + StableRemove<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + StableRemove<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
Sourcepub fn smoothen_vertex(&mut self, vertex: VertexId)
pub fn smoothen_vertex(&mut self, vertex: VertexId)
Remove a degree-2 vertex, merging its incident edges into one.
In mathematics, this is called graph smoothing, hence the function name.
If the degree of the passed vertex is not two, the behavior of this method is undefined.
Sourcepub fn merge_faces_around_vertex(&mut self, inner_vertex: VertexId)
pub fn merge_faces_around_vertex(&mut self, inner_vertex: VertexId)
Remove a degree-2 vertex together with its incident edges, merging all of its incident faces into one.
The id of one of the incident faces is reused as the id of the resulting single merged face. If you want to choose which face it should be, call [absorb_faces_around_vertex()] instead.
Sourcepub fn absorb_faces_around_vertex(
&mut self,
absorbing_face: FaceId,
inner_vertex: VertexId,
)
pub fn absorb_faces_around_vertex( &mut self, absorbing_face: FaceId, inner_vertex: VertexId, )
Remove a degree-2 vertex together with its incident edges, absorbing all of its incident faces into a chosen one of them.
This method does the same as [merge_faces_around_vertex()], but the
face whose id is to be reused for the resulting single merged face is
specified by an additional argument, absorbing_face.
Sourcepub fn merge_faces(&mut self, faces: impl IntoIterator<Item = FaceId>)
pub fn merge_faces(&mut self, faces: impl IntoIterator<Item = FaceId>)
Merge a contiguous set of faces into one, removing their shared vertices and edges.
The set of input faces must be contiguous: the faces together must form a single connected component. Otherwise, the behavior of this method is undefined.
The id of one of the incident faces is reused as the id of the resulting single merged face. If you want to choose which face it should be, call [absorb_faces()] instead.
Sourcepub fn absorb_faces(
&mut self,
absorbing_face: FaceId,
faces: impl IntoIterator<Item = FaceId>,
)
pub fn absorb_faces( &mut self, absorbing_face: FaceId, faces: impl IntoIterator<Item = FaceId>, )
Absorb a contiguous set of faces into one.
The set of input faces must be contiguous: the faces together must form a single connected component. Otherwise, the behavior of this method is undefined.
This method does the same as [merge_faces()], but the face whose id is
to be reused for the resulting single merged face is specified by an
additional argument, absorbing_face.
Source§impl<VW: Clone, HEW: Clone, FW: Clone, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + StableRemove<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + StableRemove<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + StableRemove<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW: Clone, HEW: Clone, FW: Clone, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + StableRemove<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + StableRemove<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + StableRemove<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn remove_face(&mut self, face: FaceId) -> (Vec<EdgeId>, Vec<FaceId>)
pub fn remove_edge(&mut self, edge: EdgeId) -> FaceId
pub fn remove_edge_chain( &mut self, edges: impl IntoIterator<Item = EdgeId>, ) -> FaceId
Source§impl<VW: Clone, HEW: Clone + Default, FW: Clone + Default, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW: Clone, HEW: Clone + Default, FW: Clone + Default, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn split_edge_by_vertex( &mut self, edge_to_split: EdgeId, vertex: VW, ) -> (VertexId, EdgeId)
pub fn split_face_by_edge( &mut self, from: VertexId, to: VertexId, face_to_split: FaceId, ) -> ((HalfEdgeId, HalfEdgeId), FaceId)
pub fn split_face_by_edge_chain( &mut self, from: VertexId, to: VertexId, vertex_weights: impl IntoIterator<Item = VW>, face_to_split: FaceId, ) -> (Vec<(HalfEdgeId, HalfEdgeId)>, FaceId)
Source§impl<VW: Clone, HEW: Clone, FW: Clone, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW: Clone, HEW: Clone, FW: Clone, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
pub fn split_face_by_edge_chain_with_all_weights( &mut self, from: VertexId, to: VertexId, vertex_weights: impl IntoIterator<Item = VW>, edge_weights: impl IntoIterator<Item = (HEW, HEW)>, face_to_split: FaceId, new_face_weight: FW, ) -> (Vec<(HalfEdgeId, HalfEdgeId)>, FaceId)
Source§impl<VW: Clone, HEW: Clone + Default, FW: Clone + Default, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
impl<VW: Clone, HEW: Clone + Default, FW: Clone + Default, VC: Get<usize, Value = Vertex<VW>> + Insert<usize> + Push<usize>, HEC: Get<usize, Value = HalfEdge<HEW>> + Insert<usize> + Push<usize>, FC: Get<usize, Value = Face<FW>> + Insert<usize> + Push<usize>> Dcel<VW, HEW, FW, VC, HEC, FC>
Sourcepub fn triangulate_face_around_point(
&mut self,
perimeter_face: FaceId,
inner_vertex_weight: VW,
) -> (VertexId, Vec<EdgeId>, Vec<FaceId>)
pub fn triangulate_face_around_point( &mut self, perimeter_face: FaceId, inner_vertex_weight: VW, ) -> (VertexId, Vec<EdgeId>, Vec<FaceId>)
Partition a face into triangles by inserting a vertex inside and adding edges between it and the original face’s vertices.
The original face is reused for the first triangle. New faces are created for all the other triangles.
Returns the new vertex id together with the ids of all the newly created edges and faces (the reused already existing edges and face are not included).