mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-16 05:06:11 +00:00
Add methods to override single vertices
This commit is contained in:
parent
41317b13be
commit
844d1c08a1
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user