Skip to content

Commit e954eed

Browse files
committed
Add Mesh::translated convenience function
1 parent 22d599b commit e954eed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mesh.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ where
243243
self.transform_vertices(|p| *p += translation);
244244
}
245245

246+
/// Consumes the mesh and returns it translated by the given translation vector.
247+
pub fn translated(mut self, translation: &OVector<T, D>) -> Self {
248+
self.translate(&translation);
249+
self
250+
}
251+
246252
/// Transform all vertices of the mesh by the given transformation function.
247253
pub fn transform_vertices<F>(&mut self, mut transformation: F)
248254
where

0 commit comments

Comments
 (0)