Add methods to override single vertices

This commit is contained in:
Hanno Braun 2022-10-12 15:50:31 +02:00
parent 41317b13be
commit 844d1c08a1

View File

@ -60,6 +60,30 @@ impl PartialHalfEdge {
self
}
/// Update the partial half-edge with the given from vertex
pub fn with_from_vertex(
mut self,
vertex: Option<impl Into<MaybePartial<Vertex>>>,
) -> Self {
if let Some(vertex) = vertex {
let [from, _] = &mut self.vertices;
*from = Some(vertex.into());
}
self
}
/// Update the partial half-edge with the given from vertex
pub fn with_to_vertex(
mut self,
vertex: Option<impl Into<MaybePartial<Vertex>>>,
) -> Self {
if let Some(vertex) = vertex {
let [_, to] = &mut self.vertices;
*to = Some(vertex.into());
}
self
}
/// Update the partial half-edge with the given vertices
pub fn with_vertices(
mut self,