Skip to main content

Dcel

Struct Dcel 

Source
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>

Source

pub fn vertices(&self) -> &VC

Returns an immutable reference to the collection holding the data of the vertices.

Source

pub fn half_edges(&self) -> &HEC

Returns an immutable reference to the collection holding the data of the half-edges.

Source

pub fn faces(&self) -> &FC

Returns an immutable reference to the collection holding the data of the faces.

Source

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>

Source

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>

Source

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.

Source

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.

Source

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.

Source

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>

Source

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>

Source

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.

Source

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.

Source

pub fn twin(&self, half_edge: HalfEdgeId) -> HalfEdgeId

Returns the twin (opposite) of the half-edge.

Source

pub fn full_edge(&self, half_edge: HalfEdgeId) -> EdgeId

Returns the edge the half-edge is half of.

Source

pub fn incident_face(&self, half_edge: HalfEdgeId) -> FaceId

Returns the indicent face of the half-edge.

Source

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.

Source

pub fn edge_endpoints(&self, edge: EdgeId) -> (VertexId, VertexId)

Returns the endpoint vertices of the edge.

Source

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.

Source

pub fn prev(&self, half_edge: HalfEdgeId) -> HalfEdgeId

Returns the previous half-edge in the circulation around the same incident face.

Source

pub fn next(&self, half_edge: HalfEdgeId) -> HalfEdgeId

Returns the next half-edge in the circulation around the same incident face.

Source

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.

Source

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.

Source

pub fn half_edge_weight(&self, half_edge: HalfEdgeId) -> &HEW

Returns the weight of the half-edge.

Source

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>

Source

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.

Source

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>

Source

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>

Source

pub fn insert_mesh( &mut self, face_polygons: impl IntoIterator<Item = impl IntoIterator<Item = VW>>, ) -> Vec<FaceId>

Source

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>

Source

pub fn insert_polygon( &mut self, vertex_weights: impl IntoIterator<Item = VW>, ) -> FaceId

Source

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>

Source

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

Source

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>

Source

pub fn insert_edge( &mut self, from: VertexId, to: VertexId, ) -> ((HalfEdgeId, HalfEdgeId), FaceId)

Source

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>

Source

pub fn vertex_half_spokes( &self, vertex: VertexId, ) -> HalfSpokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn vertex_rim_vertices( &self, vertex: VertexId, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn vertex_rim_half_edges( &self, vertex: VertexId, ) -> CirculateHalfEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn half_spokes( &self, initial_half_edge: HalfEdgeId, ) -> HalfSpokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn vertex_spokes( &self, vertex: VertexId, ) -> SpokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn vertex_rim_edges( &self, vertex: VertexId, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn vertex_interspokes( &self, vertex: VertexId, ) -> InterspokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn spokes( &self, initial_half_edge: HalfEdgeId, ) -> SpokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn spokes_reverse( &self, initial_half_edge: HalfEdgeId, ) -> SpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn interspokes( &self, initial_half_edge: HalfEdgeId, ) -> InterspokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn circulate_vertices( &self, initial_half_edge: HalfEdgeId, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn circulate_vertices_reverse( &self, initial_half_edge: HalfEdgeId, ) -> CirculateVertexesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

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>

Source

pub fn circulate_half_edges( &self, initial_half_edge: HalfEdgeId, ) -> CirculateHalfEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn circulate_half_edges_reverse( &self, initial_half_edge: HalfEdgeId, ) -> CirculateHalfEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

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>

Source

pub fn circulate_edges( &self, initial_half_edge: HalfEdgeId, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn circulate_edges_reverse( &self, initial_half_edge: HalfEdgeId, ) -> CirculateEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

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>

Source

pub fn circulation_half_spokes( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateHalfSpokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn circulation_spokes( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculationSpokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn circulation_spokes_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculationSpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn circulation_interspokes( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculationInterspokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn circulation_interspokes_reverse( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculationInterspokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

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>

Source

pub fn circulation_rim_edges( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn circulation_rim_vertices( &self, initial_half_edge: HalfEdgeId, excluded_half_edges: impl IntoIterator<Item = HalfEdgeId>, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn face_vertices( &self, face: FaceId, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn face_half_edges( &self, face: FaceId, ) -> CirculateHalfEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_half_edges_reverse( &self, face: FaceId, ) -> CirculateHalfEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_edges( &self, face: FaceId, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

pub fn face_half_spokes( &self, face: FaceId, ) -> CirculateHalfSpokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_half_spokes_reverse( &self, face: FaceId, ) -> CirculateHalfSpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_spokes( &self, face: FaceId, ) -> CirculationSpokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_spokes_reverse( &self, face: FaceId, ) -> CirculationSpokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_interspokes( &self, face: FaceId, ) -> CirculationInterspokesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_interspokes_reverse( &self, face: FaceId, ) -> CirculationInterspokesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_rim_half_edges( &self, face: FaceId, ) -> CirculateHalfEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_rim_half_edges_reverse( &self, face: FaceId, ) -> CirculateHalfEdgesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_rim_vertices( &self, face: FaceId, ) -> CirculateVertexesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_rim_vertices_reverse( &self, face: FaceId, ) -> CirculateVertexesWithExcludesReverseIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

pub fn face_rim_edges( &self, face: FaceId, ) -> CirculateEdgesWithExcludesIter<'_, VW, HEW, FW, VC, HEC, FC>

Source

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>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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>

Source

pub fn remove_face(&mut self, face: FaceId) -> (Vec<EdgeId>, Vec<FaceId>)

Source

pub fn remove_edge(&mut self, edge: EdgeId) -> FaceId

Source

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>

Source

pub fn split_edge_by_vertex( &mut self, edge_to_split: EdgeId, vertex: VW, ) -> (VertexId, EdgeId)

Source

pub fn split_face_by_edge( &mut self, from: VertexId, to: VertexId, face_to_split: FaceId, ) -> ((HalfEdgeId, HalfEdgeId), FaceId)

Source

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>

Source

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>

Source

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).

Source

pub fn fan_triangulate( &mut self, perimeter_face: FaceId, apex: VertexId, ) -> (Vec<EdgeId>, Vec<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>

Source

pub fn triangulate_face_around_point_with_all_weights( &mut self, perimeter_face: FaceId, inner_vertex_weight: VW, inner_edge_weights: impl IntoIterator<Item = (HEW, HEW)>, triangle_face_weights: impl IntoIterator<Item = FW>, ) -> (VertexId, Vec<EdgeId>, Vec<FaceId>)

Source

pub fn fan_triangulate_with_all_weights( &mut self, perimeter_face: FaceId, apex: VertexId, inner_edge_weights: impl IntoIterator<Item = (HEW, HEW)>, triangle_face_weights: impl IntoIterator<Item = FW>, ) -> (Vec<EdgeId>, Vec<FaceId>)

Source§

impl<VW, HEW, FW: Default, VC: Default, HEC: Default, FC: Default + Push<usize, Value = Face<FW>>> Dcel<VW, HEW, FW, VC, HEC, FC>

Source

pub fn new() -> Self

Create a new DCEL.

Source§

impl<VW, HEW, FW, VC, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>

Source

pub fn from_collections(vertices: VC, half_edges: HEC, faces: FC) -> Self

Source§

impl<VW, HEW, FW, VC, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
where for<'a> &'a VC: IntoIterator<Item = &'a usize>,

Source

pub fn vertex_ids(&self) -> impl Iterator<Item = VertexId>

Source§

impl<VW, HEW, FW, VC, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
where for<'a> &'a HEC: IntoIterator<Item = &'a usize>,

Source

pub fn half_edge_ids(&self) -> impl Iterator<Item = HalfEdgeId>

Source§

impl<VW, HEW, FW, VC, HEC, FC> Dcel<VW, HEW, FW, VC, HEC, FC>
where for<'a> &'a FC: IntoIterator<Item = &'a usize>,

Source

pub fn face_ids(&self) -> impl Iterator<Item = FaceId>

Trait Implementations§

Source§

impl<VW: Clone, HEW: Clone, FW: Clone, VC: Clone, HEC: Clone, FC: Clone> Clone for Dcel<VW, HEW, FW, VC, HEC, FC>

Source§

fn clone(&self) -> Dcel<VW, HEW, FW, VC, HEC, FC>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<VW: Debug, HEW: Debug, FW: Debug, VC: Debug, HEC: Debug, FC: Debug> Debug for Dcel<VW, HEW, FW, VC, HEC, FC>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<VW, HEW, FW: Default, VC: Default, HEC: Default, FC: Default + Push<usize, Value = Face<FW>>> Default for Dcel<VW, HEW, FW, VC, HEC, FC>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<VW, HEW, FW, VC, HEC, FC> Freeze for Dcel<VW, HEW, FW, VC, HEC, FC>
where VC: Freeze, HEC: Freeze, FC: Freeze,

§

impl<VW, HEW, FW, VC, HEC, FC> RefUnwindSafe for Dcel<VW, HEW, FW, VC, HEC, FC>

§

impl<VW, HEW, FW, VC, HEC, FC> Send for Dcel<VW, HEW, FW, VC, HEC, FC>
where VC: Send, HEC: Send, FC: Send, VW: Send, HEW: Send, FW: Send,

§

impl<VW, HEW, FW, VC, HEC, FC> Sync for Dcel<VW, HEW, FW, VC, HEC, FC>
where VC: Sync, HEC: Sync, FC: Sync, VW: Sync, HEW: Sync, FW: Sync,

§

impl<VW, HEW, FW, VC, HEC, FC> Unpin for Dcel<VW, HEW, FW, VC, HEC, FC>
where VC: Unpin, HEC: Unpin, FC: Unpin, VW: Unpin, HEW: Unpin, FW: Unpin,

§

impl<VW, HEW, FW, VC, HEC, FC> UnsafeUnpin for Dcel<VW, HEW, FW, VC, HEC, FC>
where VC: UnsafeUnpin, HEC: UnsafeUnpin, FC: UnsafeUnpin,

§

impl<VW, HEW, FW, VC, HEC, FC> UnwindSafe for Dcel<VW, HEW, FW, VC, HEC, FC>
where VC: UnwindSafe, HEC: UnwindSafe, FC: UnwindSafe, VW: UnwindSafe, HEW: UnwindSafe, FW: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.