mirror of https://github.com/hannobraun/Fornjot
commit
b28cf86d49
|
@ -28,12 +28,12 @@ impl Region {
|
|||
/// Construct an instance of `Region`
|
||||
pub fn new(
|
||||
exterior: Handle<Cycle>,
|
||||
interiors: Vec<Handle<Cycle>>,
|
||||
interiors: impl IntoIterator<Item = Handle<Cycle>>,
|
||||
color: Option<Color>,
|
||||
) -> Self {
|
||||
Self {
|
||||
exterior,
|
||||
interiors,
|
||||
interiors: interiors.into_iter().collect(),
|
||||
color,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,6 @@ impl Face {
|
|||
interiors: impl IntoIterator<Item = Handle<Cycle>>,
|
||||
color: Option<Color>,
|
||||
) -> Self {
|
||||
let interiors = interiors.into_iter().collect();
|
||||
|
||||
Self {
|
||||
surface,
|
||||
region: Region::new(exterior, interiors, color),
|
||||
|
@ -111,17 +109,6 @@ impl FaceSet {
|
|||
pub fn new() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Find the given face
|
||||
pub fn find(&self, face: &Handle<Face>) -> Option<Handle<Face>> {
|
||||
for f in self {
|
||||
if f == face {
|
||||
return Some(f.clone());
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl Extend<Handle<Face>> for FaceSet {
|
||||
|
|
|
@ -26,9 +26,4 @@ impl Shell {
|
|||
pub fn faces(&self) -> &FaceSet {
|
||||
&self.faces
|
||||
}
|
||||
|
||||
/// Find the given face in the shell
|
||||
pub fn find_face(&self, face: &Handle<Face>) -> Option<Handle<Face>> {
|
||||
self.faces().find(face)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
use std::collections::BTreeSet;
|
||||
|
||||
use crate::{
|
||||
objects::{Face, Shell},
|
||||
storage::Handle,
|
||||
};
|
||||
use crate::{objects::Shell, storage::Handle};
|
||||
|
||||
/// A 3-dimensional shape, built from [`Shell`]s. Many Solids will contains only
|
||||
/// one shell, but if the Solid contains cavities they will be represented by a
|
||||
|
@ -30,15 +27,4 @@ impl Solid {
|
|||
pub fn shells(&self) -> impl Iterator<Item = &Handle<Shell>> {
|
||||
self.shells.iter()
|
||||
}
|
||||
|
||||
/// Find the given face in the solid
|
||||
pub fn find_face(&self, face: &Handle<Face>) -> Option<Handle<Face>> {
|
||||
for shell in self.shells() {
|
||||
if let Some(face) = shell.find_face(face) {
|
||||
return Some(face);
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue