Skip to content

Commit

Permalink
Add CurveBoundaries::symmetric_difference
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Oct 16, 2023
1 parent 68955b1 commit 45558c9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/fj-core/src/geometry/boundary/multiple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@ impl CurveBoundaries<()> {

self
}

/// Compute the symmetric difference between this instance and another one
///
/// # Implementation Note
///
/// This method is only available for `CurveBoundaries` instances without
/// payloads, simply because more wasn't needed so far. Support for payloads
/// can be added by expanding [`CurveBoundariesPayload`] accordingly, and
/// integrating the new method here.
pub fn symmetric_difference(self, other: impl Into<Self>) -> Self {
let other = other.into();
self.clone()
.difference(other.clone())
.union(other.difference(self))
}
}

impl<T: CurveBoundariesPayload> Default for CurveBoundaries<T> {
Expand Down

0 comments on commit 45558c9

Please sign in to comment.