diff --git a/experiments/2024-12-09/src/geometry/shape.rs b/experiments/2024-12-09/src/geometry/shape.rs index 5a775dd11..45b1dd9ac 100644 --- a/experiments/2024-12-09/src/geometry/shape.rs +++ b/experiments/2024-12-09/src/geometry/shape.rs @@ -13,6 +13,13 @@ pub struct Shape { } impl Shape { + pub fn extend(&mut self) -> OperationResult<()> { + OperationResult { + operations: self, + results: (), + } + } + pub fn vertex( &mut self, vertex: impl Into, diff --git a/experiments/2024-12-09/src/model.rs b/experiments/2024-12-09/src/model.rs index c3cc9b115..5ffa8cb40 100644 --- a/experiments/2024-12-09/src/model.rs +++ b/experiments/2024-12-09/src/model.rs @@ -2,6 +2,7 @@ use crate::geometry::Shape; pub fn model(shape: &mut Shape) { let (a, b, c, d, e, f, g, h) = shape + .extend() .vertex([-0.5, -0.5, -0.5]) .vertex([0.5, -0.5, -0.5]) .vertex([-0.5, 0.5, -0.5]) @@ -13,6 +14,7 @@ pub fn model(shape: &mut Shape) { .results(); shape + .extend() .triangle([&a, &e, &g]) // left .triangle([&a, &g, &c]) .triangle([&b, &d, &h]) // right