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