diff --git a/crates/fj-core/src/operations/merge.rs b/crates/fj-core/src/operations/merge.rs new file mode 100644 index 000000000..968a6b3c5 --- /dev/null +++ b/crates/fj-core/src/operations/merge.rs @@ -0,0 +1,15 @@ +use crate::objects::Solid; + +use super::UpdateSolid; + +/// Merge two [`Solid`]s +pub trait Merge { + /// Merge this solid with another + fn merge(&self, other: &Self) -> Self; +} + +impl Merge for Solid { + fn merge(&self, other: &Self) -> Self { + self.add_shells(other.shells().cloned()) + } +} diff --git a/crates/fj-core/src/operations/mod.rs b/crates/fj-core/src/operations/mod.rs index 5d43064e4..3cd87865a 100644 --- a/crates/fj-core/src/operations/mod.rs +++ b/crates/fj-core/src/operations/mod.rs @@ -3,6 +3,7 @@ mod build; mod insert; mod join; +mod merge; mod reverse; mod update; @@ -19,6 +20,7 @@ pub use self::{ }, insert::{Insert, IsInserted, IsInsertedNo, IsInsertedYes}, join::cycle::JoinCycle, + merge::Merge, reverse::Reverse, update::{ cycle::UpdateCycle, edge::UpdateHalfEdge, face::UpdateFace,