Track internal faces

This commit is contained in:
Hanno Braun 2025-02-25 12:20:54 +01:00
parent a0d5716687
commit fdd0338da5
5 changed files with 11 additions and 2 deletions

View File

@ -47,7 +47,7 @@ impl Sketch {
},
);
Face::new(surface, half_edges)
Face::new(surface, half_edges, false)
}
}

View File

@ -57,6 +57,7 @@ impl ConnectExt for Handle<Face> {
is_internal: false,
})
}),
q.is_internal,
);
Handle::new(face)
})

View File

@ -6,6 +6,10 @@ pub trait FlipExt {
impl FlipExt for &Face {
fn flip(self) -> Face {
Face::new(self.surface.flip(), self.half_edges.clone())
Face::new(
self.surface.flip(),
self.half_edges.clone(),
self.is_internal,
)
}
}

View File

@ -17,6 +17,7 @@ impl TranslateExt for Face {
self.half_edges
.iter()
.map(|half_edge| Handle::new(half_edge.translate(offset))),
self.is_internal,
)
}
}

View File

@ -15,16 +15,19 @@ use super::{half_edge::HalfEdge, vertex::Vertex};
pub struct Face {
pub surface: Plane,
pub half_edges: Vec<Handle<HalfEdge>>,
pub is_internal: bool,
}
impl Face {
pub fn new(
surface: Plane,
half_edges: impl IntoIterator<Item = Handle<HalfEdge>>,
is_internal: bool,
) -> Self {
Self {
surface,
half_edges: half_edges.into_iter().collect(),
is_internal,
}
}