From 761b6d15192aab5fbdebd1a819a7228c15daa90c Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 22 Feb 2024 15:17:12 +0100 Subject: [PATCH] Simplify `color` model --- models/color/src/lib.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/models/color/src/lib.rs b/models/color/src/lib.rs index 133966d57..513d7a0c9 100644 --- a/models/color/src/lib.rs +++ b/models/color/src/lib.rs @@ -1,9 +1,7 @@ use fj::core::{ objects::Solid, operations::{ - presentation::SetColor, - split::SplitFace, - update::{UpdateFace, UpdateShell, UpdateSolid}, + presentation::SetColor, split::SplitFace, update::UpdateSolid, }, }; @@ -14,19 +12,7 @@ pub fn model(core: &mut fj::core::Core) -> Solid { cuboid.update_shell( cuboid.shells().only(), |shell, core| { - let shell = shell.update_face( - shell.faces().first(), - |face, core| { - [face.update_region( - |region, core| { - region.set_color([0., 1., 0.], core); - region.clone() - }, - core, - )] - }, - core, - ); + shell.faces().first().region().set_color([0., 1., 0.], core); // Split colored face, to make sure the same color is applied to the // two derived faces.