From 6e00260233fdef01dd636a50ab3314bcf58883bf Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 20 Dec 2024 20:30:17 +0100 Subject: [PATCH] Add store for surfaces --- experiments/2024-12-09/src/model.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/experiments/2024-12-09/src/model.rs b/experiments/2024-12-09/src/model.rs index e6aa6cc8a..40622034e 100644 --- a/experiments/2024-12-09/src/model.rs +++ b/experiments/2024-12-09/src/model.rs @@ -6,17 +6,18 @@ use crate::{ }; pub fn model(shape: &mut Shape) { + let mut surfaces = Store::::new(); let mut vertices = Store::::new(); let mut triangles = Store::::new(); - let bottom = Plane { + let bottom = surfaces.insert(Plane { origin: Point::from([0., 0., -0.5]), coords: Bivector { a: Vector::from([1., 0., 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 = Sketch::from([[-0.5, -0.5], [0.5, -0.5], [-0.5, 0.5], [0.5, 0.5]]);