Skip to content

Commit

Permalink
Add UpdateShell::add_faces
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Jul 3, 2023
1 parent 63539c4 commit 2927aa1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/fj-core/src/operations/update/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ use crate::{

/// Update a [`Shell`]
pub trait UpdateShell {
/// Add faces to the shell
fn add_faces(&self, faces: impl IntoIterator<Item = Handle<Face>>) -> Self;

/// Update a face of the shell
fn replace_face(
&self,
Expand All @@ -17,6 +20,11 @@ pub trait UpdateShell {
}

impl UpdateShell for Shell {
fn add_faces(&self, faces: impl IntoIterator<Item = Handle<Face>>) -> Self {
let faces = self.faces().into_iter().cloned().chain(faces);
Shell::new(faces)
}

fn replace_face(
&self,
original: &Handle<Face>,
Expand Down

0 comments on commit 2927aa1

Please sign in to comment.