Skip to content

Commit

Permalink
Add Merge operation
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jun 19, 2023
1 parent 5d474c4 commit ba3c26e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/fj-core/src/operations/merge.rs
Original file line number Diff line number Diff line change
@@ -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())
}
}
2 changes: 2 additions & 0 deletions crates/fj-core/src/operations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
mod build;
mod insert;
mod join;
mod merge;
mod reverse;
mod update;

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

0 comments on commit ba3c26e

Please sign in to comment.