mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-13 02:35:53 +00:00
Simplify function parameters
This commit is contained in:
parent
6c29384c8c
commit
36e472c771
@ -24,9 +24,11 @@ pub fn model() -> AnyOp {
|
||||
|
||||
sketch.to_face(surface, &mut stores.vertices)
|
||||
};
|
||||
let bottom = top
|
||||
.flip(&mut stores.surfaces)
|
||||
.translate([0., 0., -1.], &mut stores);
|
||||
let bottom = top.flip(&mut stores.surfaces).translate(
|
||||
[0., 0., -1.],
|
||||
&mut stores.surfaces,
|
||||
&mut stores.vertices,
|
||||
);
|
||||
|
||||
let [a, b, c, d] = bottom.vertices().collect_array().unwrap();
|
||||
let [e, f, g, h] = top.vertices().collect_array().unwrap();
|
||||
|
@ -3,7 +3,7 @@ use spade::Triangulation;
|
||||
use crate::{
|
||||
geometry::{AnyOp, Handle, Operation, TriMesh, Triangle},
|
||||
math::{Plane, Point, Vector},
|
||||
storage::{Store, Stores},
|
||||
storage::Store,
|
||||
};
|
||||
|
||||
use super::Vertex;
|
||||
@ -39,16 +39,17 @@ impl Face {
|
||||
pub fn translate(
|
||||
&self,
|
||||
offset: impl Into<Vector<3>>,
|
||||
stores: &mut Stores,
|
||||
surfaces: &mut Store<Plane>,
|
||||
vertices: &mut Store<Vertex>,
|
||||
) -> Self {
|
||||
let offset = offset.into();
|
||||
|
||||
Self {
|
||||
surface: stores.surfaces.insert(self.surface.translate(offset)),
|
||||
surface: surfaces.insert(self.surface.translate(offset)),
|
||||
vertices: self
|
||||
.vertices
|
||||
.iter()
|
||||
.map(|vertex| stores.vertices.insert(vertex.translate(offset)))
|
||||
.map(|vertex| vertices.insert(vertex.translate(offset)))
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user