Skip to content

Commit

Permalink
Simplify color model
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Feb 22, 2024
1 parent 9cd2417 commit 761b6d1
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions models/color/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use fj::core::{
objects::Solid,
operations::{
presentation::SetColor,
split::SplitFace,
update::{UpdateFace, UpdateShell, UpdateSolid},
presentation::SetColor, split::SplitFace, update::UpdateSolid,
},
};

Expand All @@ -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.
Expand Down

0 comments on commit 761b6d1

Please sign in to comment.