diff --git a/crates/fj-kernel/src/operations/mod.rs b/crates/fj-kernel/src/operations/mod.rs index 5c65569c4..1f5913e9a 100644 --- a/crates/fj-kernel/src/operations/mod.rs +++ b/crates/fj-kernel/src/operations/mod.rs @@ -12,5 +12,7 @@ pub use self::{ }, insert::{Insert, IsInserted, IsInsertedNo, IsInsertedYes}, join::JoinCycle, - update::{UpdateCycle, UpdateFace, UpdateHalfEdge, UpdateShell}, + update::{ + UpdateCycle, UpdateFace, UpdateHalfEdge, UpdateShell, UpdateSolid, + }, }; diff --git a/crates/fj-kernel/src/operations/update/mod.rs b/crates/fj-kernel/src/operations/update/mod.rs index 73f5d0874..431b97368 100644 --- a/crates/fj-kernel/src/operations/update/mod.rs +++ b/crates/fj-kernel/src/operations/update/mod.rs @@ -2,8 +2,9 @@ mod cycle; mod edge; mod face; mod shell; +mod solid; pub use self::{ cycle::UpdateCycle, edge::UpdateHalfEdge, face::UpdateFace, - shell::UpdateShell, + shell::UpdateShell, solid::UpdateSolid, }; diff --git a/crates/fj-kernel/src/operations/update/solid.rs b/crates/fj-kernel/src/operations/update/solid.rs new file mode 100644 index 000000000..9c0e340f7 --- /dev/null +++ b/crates/fj-kernel/src/operations/update/solid.rs @@ -0,0 +1,17 @@ +use crate::{ + objects::{Shell, Solid}, + storage::Handle, +}; + +/// Update a [`Solid`] +pub trait UpdateSolid { + /// Add a shell to the solid + fn add_shell(&self, shell: Handle) -> Solid; +} + +impl UpdateSolid for Solid { + fn add_shell(&self, shell: Handle) -> Solid { + let shells = self.shells().cloned().chain([shell]); + Solid::new(shells) + } +}