Fix SurfaceVertex duplication in ShellBuilder

This commit is contained in:
Hanno Braun 2022-10-13 16:18:38 +02:00
parent 68850d865f
commit 7009aa4c36

View File

@ -141,18 +141,12 @@ impl<'a> ShellBuilder<'a> {
.clone() .clone()
.into_iter() .into_iter()
.zip(sides_down.clone()) .zip(sides_down.clone())
.zip(&surfaces) .map(|(side_up, side_down)| {
.map(|((side_up, side_down), surface)| {
let [_, from] = side_up.vertices(); let [_, from] = side_up.vertices();
let [to, _] = side_down.vertices(); let [to, _] = side_down.vertices();
let from = from.surface_form().clone(); let from = from.surface_form().clone();
let to = Handle::<SurfaceVertex>::partial() let to = to.surface_form().clone();
.with_position(Some(
from.position() + [-edge_length, Z],
))
.with_surface(Some(surface.clone()))
.with_global_form(Some(to.global_form().clone()));
let from = Vertex::partial().with_surface_form(Some(from)); let from = Vertex::partial().with_surface_form(Some(from));
let to = Vertex::partial().with_surface_form(Some(to)); let to = Vertex::partial().with_surface_form(Some(to));