mirror of https://github.com/hannobraun/Fornjot
Add `UpdateSolid`
This commit is contained in:
parent
63bc10415e
commit
01ba108aa2
|
@ -12,5 +12,7 @@ pub use self::{
|
||||||
},
|
},
|
||||||
insert::{Insert, IsInserted, IsInsertedNo, IsInsertedYes},
|
insert::{Insert, IsInserted, IsInsertedNo, IsInsertedYes},
|
||||||
join::JoinCycle,
|
join::JoinCycle,
|
||||||
update::{UpdateCycle, UpdateFace, UpdateHalfEdge, UpdateShell},
|
update::{
|
||||||
|
UpdateCycle, UpdateFace, UpdateHalfEdge, UpdateShell, UpdateSolid,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,8 +2,9 @@ mod cycle;
|
||||||
mod edge;
|
mod edge;
|
||||||
mod face;
|
mod face;
|
||||||
mod shell;
|
mod shell;
|
||||||
|
mod solid;
|
||||||
|
|
||||||
pub use self::{
|
pub use self::{
|
||||||
cycle::UpdateCycle, edge::UpdateHalfEdge, face::UpdateFace,
|
cycle::UpdateCycle, edge::UpdateHalfEdge, face::UpdateFace,
|
||||||
shell::UpdateShell,
|
shell::UpdateShell, solid::UpdateSolid,
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
use crate::{
|
||||||
|
objects::{Shell, Solid},
|
||||||
|
storage::Handle,
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Update a [`Solid`]
|
||||||
|
pub trait UpdateSolid {
|
||||||
|
/// Add a shell to the solid
|
||||||
|
fn add_shell(&self, shell: Handle<Shell>) -> Solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl UpdateSolid for Solid {
|
||||||
|
fn add_shell(&self, shell: Handle<Shell>) -> Solid {
|
||||||
|
let shells = self.shells().cloned().chain([shell]);
|
||||||
|
Solid::new(shells)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue