mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-13 14:28:27 +00:00
Prepare to improve clarity of algorithm
This commit is contained in:
parent
b8ac751397
commit
59e3f92254
@ -33,16 +33,17 @@ pub trait ConnectExt {
|
|||||||
impl ConnectExt for Handle<Face> {
|
impl ConnectExt for Handle<Face> {
|
||||||
fn connect(self, other: Self) -> Solid {
|
fn connect(self, other: Self) -> Solid {
|
||||||
let bottom = self;
|
let bottom = self;
|
||||||
|
let top = other;
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
bottom.half_edges.len(),
|
bottom.half_edges.len(),
|
||||||
other.half_edges.len(),
|
top.half_edges.len(),
|
||||||
"Can only connect faces that have the same number of vertices.",
|
"Can only connect faces that have the same number of vertices.",
|
||||||
);
|
);
|
||||||
|
|
||||||
let side_faces = bottom
|
let side_faces = bottom
|
||||||
.half_edges_with_end_vertex()
|
.half_edges_with_end_vertex()
|
||||||
.zip(other.half_edges_with_end_vertex())
|
.zip(top.half_edges_with_end_vertex())
|
||||||
.map(|((a, b), (d, c))| {
|
.map(|((a, b), (d, c))| {
|
||||||
let is_internal = match [a.is_internal, d.is_internal] {
|
let is_internal = match [a.is_internal, d.is_internal] {
|
||||||
[true, true] => true,
|
[true, true] => true,
|
||||||
@ -75,6 +76,6 @@ impl ConnectExt for Handle<Face> {
|
|||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
Solid::new([bottom, other].into_iter().chain(side_faces))
|
Solid::new([bottom, top].into_iter().chain(side_faces))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user