fj_core/operations/
merge.rs

1//! # Operations to merge objects
2//!
3//! See [`Merge`], which is currently the only trait in this module, for more
4//! information.
5
6use crate::{objects::Solid, Core};
7
8use super::update::UpdateSolid;
9
10/// Merge two [`Solid`]s
11pub trait Merge {
12    /// Merge this solid with another
13    #[must_use]
14    fn merge(&self, other: &Self, core: &mut Core) -> Self;
15}
16
17impl Merge for Solid {
18    fn merge(&self, other: &Self, core: &mut Core) -> Self {
19        self.add_shells(other.shells().iter().cloned(), core)
20    }
21}