Add store for surfaces

This commit is contained in:
Hanno Braun 2024-12-20 20:30:17 +01:00
parent f776fedb68
commit 6e00260233
1 changed files with 4 additions and 3 deletions

View File

@ -6,17 +6,18 @@ use crate::{
}; };
pub fn model(shape: &mut Shape) { pub fn model(shape: &mut Shape) {
let mut surfaces = Store::<Plane>::new();
let mut vertices = Store::<Vertex>::new(); let mut vertices = Store::<Vertex>::new();
let mut triangles = Store::<Triangle>::new(); let mut triangles = Store::<Triangle>::new();
let bottom = Plane { let bottom = surfaces.insert(Plane {
origin: Point::from([0., 0., -0.5]), origin: Point::from([0., 0., -0.5]),
coords: Bivector { coords: Bivector {
a: Vector::from([1., 0., 0.]), a: Vector::from([1., 0., 0.]),
b: Vector::from([0., 1., 0.]), b: Vector::from([0., 1., 0.]),
}, },
}; });
let top = bottom.translate([0., 0., 1.]); let top = surfaces.insert(bottom.translate([0., 0., 1.]));
let sketch = let sketch =
Sketch::from([[-0.5, -0.5], [0.5, -0.5], [-0.5, 0.5], [0.5, 0.5]]); Sketch::from([[-0.5, -0.5], [0.5, -0.5], [-0.5, 0.5], [0.5, 0.5]]);