From f2d47ad9dfa7c961740fe3663efbcf3273e2a39c Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 4 May 2023 11:34:52 +0200 Subject: [PATCH] Refactor to prepare for follow-on change --- .../fj-kernel/src/operations/build/shell.rs | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/crates/fj-kernel/src/operations/build/shell.rs b/crates/fj-kernel/src/operations/build/shell.rs index 24cea846b..5bd57f56b 100644 --- a/crates/fj-kernel/src/operations/build/shell.rs +++ b/crates/fj-kernel/src/operations/build/shell.rs @@ -35,36 +35,30 @@ pub trait BuildShell { ) -> Tetrahedron { let [a, b, c, d] = points.map(Into::into); - let abc = Face::triangle([a, b, c], services).face; + let abc = Face::triangle([a, b, c], services); let bad = - Face::triangle([b, a, d], services) - .face - .update_exterior(|cycle| { - cycle - .join_to(abc.exterior(), 0..=0, 0..=0, services) - .insert(services) - }); + Face::triangle([b, a, d], services).update_exterior(|cycle| { + cycle + .join_to(abc.face.exterior(), 0..=0, 0..=0, services) + .insert(services) + }); let dac = - Face::triangle([d, a, c], services) - .face - .update_exterior(|cycle| { - cycle - .join_to(abc.exterior(), 1..=1, 2..=2, services) - .join_to(bad.exterior(), 0..=0, 1..=1, services) - .insert(services) - }); + Face::triangle([d, a, c], services).update_exterior(|cycle| { + cycle + .join_to(abc.face.exterior(), 1..=1, 2..=2, services) + .join_to(bad.face.exterior(), 0..=0, 1..=1, services) + .insert(services) + }); let cbd = - Face::triangle([c, b, d], services) - .face - .update_exterior(|cycle| { - cycle - .join_to(abc.exterior(), 0..=0, 1..=1, services) - .join_to(bad.exterior(), 1..=1, 2..=2, services) - .join_to(dac.exterior(), 2..=2, 2..=2, services) - .insert(services) - }); + Face::triangle([c, b, d], services).update_exterior(|cycle| { + cycle + .join_to(abc.face.exterior(), 0..=0, 1..=1, services) + .join_to(bad.face.exterior(), 1..=1, 2..=2, services) + .join_to(dac.face.exterior(), 2..=2, 2..=2, services) + .insert(services) + }); - let faces = [abc, bad, dac, cbd].map(|face| face.insert(services)); + let faces = [abc, bad, dac, cbd].map(|face| face.insert(services).face); let shell = Shell::new(faces.clone()); let [abc, bad, dac, cbd] = faces;