From 814d156812ade7e7d0a518892fece4317f5c28dc Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 17 Jan 2024 10:38:39 +0100 Subject: [PATCH] Simplify `color` model --- models/color/src/lib.rs | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/models/color/src/lib.rs b/models/color/src/lib.rs index de72ac883..0bae8de02 100644 --- a/models/color/src/lib.rs +++ b/models/color/src/lib.rs @@ -1,14 +1,12 @@ -use fj::{ - core::{ - objects::{Region, Solid}, - operations::{ - insert::Insert, - update::{UpdateFace, UpdateShell, UpdateSolid}, - }, - services::Services, - storage::Handle, +use fj::core::{ + objects::Solid, + operations::{ + insert::Insert, + presentation::SetColor, + update::{UpdateFace, UpdateShell, UpdateSolid}, }, - interop::Color, + services::Services, + storage::Handle, }; pub fn model(services: &mut Services) -> Handle { @@ -20,12 +18,7 @@ pub fn model(services: &mut Services) -> Handle { shell .update_face(shell.faces().first(), |face| { face.update_region(|region| { - Region::new( - region.exterior().clone(), - region.interiors().into_iter().cloned(), - Some(Color::from([0., 1., 0.])), - ) - .insert(services) + region.set_color([0., 1., 0.]).insert(services) }) .insert(services) })