mirror of
https://github.com/hannobraun/Fornjot
synced 2025-07-20 08:56:22 +00:00
Extract building connecting face to dedicated fn
This commit is contained in:
parent
5fa10def8b
commit
1ac4a73cd9
@ -2,7 +2,10 @@ use crate::{
|
|||||||
handle::Handle,
|
handle::Handle,
|
||||||
math::Plane,
|
math::Plane,
|
||||||
topology::{
|
topology::{
|
||||||
curve::Curve, face::Face, half_edge::HalfEdge, solid::Solid,
|
curve::Curve,
|
||||||
|
face::{Face, HalfEdgeWithEndVertex},
|
||||||
|
half_edge::HalfEdge,
|
||||||
|
solid::Solid,
|
||||||
surface::Surface,
|
surface::Surface,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -54,10 +57,15 @@ fn build_connecting_faces(bottom: &Face, top: &Face) -> Vec<Handle<Face>> {
|
|||||||
bottom
|
bottom
|
||||||
.half_edges_with_end_vertex()
|
.half_edges_with_end_vertex()
|
||||||
.zip(top.half_edges_with_end_vertex())
|
.zip(top.half_edges_with_end_vertex())
|
||||||
.map(|(bottom, top)| {
|
.map(|(bottom, top)| build_single_connecting_face([bottom, top]))
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn build_single_connecting_face(
|
||||||
|
[bottom, top]: [HalfEdgeWithEndVertex; 2],
|
||||||
|
) -> Handle<Face> {
|
||||||
let is_internal =
|
let is_internal =
|
||||||
match [bottom.half_edge.is_internal, top.half_edge.is_internal]
|
match [bottom.half_edge.is_internal, top.half_edge.is_internal] {
|
||||||
{
|
|
||||||
[true, true] => true,
|
[true, true] => true,
|
||||||
[false, false] => false,
|
[false, false] => false,
|
||||||
_ => {
|
_ => {
|
||||||
@ -90,6 +98,4 @@ fn build_connecting_faces(bottom: &Face, top: &Face) -> Vec<Handle<Face>> {
|
|||||||
is_internal,
|
is_internal,
|
||||||
);
|
);
|
||||||
Handle::new(face)
|
Handle::new(face)
|
||||||
})
|
|
||||||
.collect::<Vec<_>>()
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user