mirror of
https://github.com/hannobraun/Fornjot
synced 2025-07-20 00:46:10 +00:00
Add Face::translate
This commit is contained in:
parent
e92296a1f0
commit
467b66750f
@ -2,8 +2,8 @@ use spade::Triangulation;
|
||||
|
||||
use crate::{
|
||||
geometry::{AnyOp, Handle, Operation, Sketch, TriMesh, Triangle},
|
||||
math::{Plane, Point},
|
||||
storage::Store,
|
||||
math::{Plane, Point, Vector},
|
||||
storage::{Store, Stores},
|
||||
};
|
||||
|
||||
use super::Vertex;
|
||||
@ -45,6 +45,24 @@ impl Face {
|
||||
vertices: self.vertices.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused)] // code that uses it is being worked on
|
||||
pub fn translate(
|
||||
&self,
|
||||
offset: impl Into<Vector<3>>,
|
||||
stores: &mut Stores,
|
||||
) -> Self {
|
||||
let offset = offset.into();
|
||||
|
||||
Self {
|
||||
surface: stores.get().insert(self.surface.translate(offset)),
|
||||
vertices: self
|
||||
.vertices
|
||||
.iter()
|
||||
.map(|vertex| stores.get().insert(vertex.translate(offset)))
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Operation for Face {
|
||||
|
Loading…
x
Reference in New Issue
Block a user