Skip to content

Commit

Permalink
Simplify color model
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jan 17, 2024
1 parent 854e561 commit 814d156
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions models/color/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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<Solid> {
Expand All @@ -20,12 +18,7 @@ pub fn model(services: &mut Services) -> Handle<Solid> {
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)
})
Expand Down

0 comments on commit 814d156

Please sign in to comment.