Fix SurfaceVertex duplication in Vertex sweep

This commit is contained in:
Hanno Braun 2022-10-12 15:00:17 +02:00
parent 2dcd433ee1
commit 74a9fa546b

View File

@ -92,32 +92,24 @@ impl Sweep for (Vertex, Handle<Surface>) {
) )
}; };
// And now the vertices. Again, nothing wild here. let vertices_surface = {
let vertices = { let [_, position] = points_surface;
// Can be cleaned up, once `zip` is stable: let [_, global_form] = vertices_global;
// https://doc.rust-lang.org/std/primitive.array.html#method.zip
let [a_surface, b_surface] = points_surface;
let [a_global, b_global] = vertices_global;
let vertices_surface =
[(a_surface, a_global), (b_surface, b_global)].map(
|(point_surface, vertex_global)| {
SurfaceVertex::new(
point_surface,
surface.clone(),
vertex_global,
objects,
)
},
);
vertices_surface.map(|surface_form| { [
vertex.surface_form().clone(),
SurfaceVertex::new(position, surface, global_form, objects),
]
};
// And now the vertices. Again, nothing wild here.
let vertices = vertices_surface.map(|surface_form| {
Vertex::new( Vertex::new(
[surface_form.position().v], [surface_form.position().v],
curve.clone(), curve.clone(),
surface_form, surface_form,
) )
}) });
};
// And finally, creating the output `Edge` is just a matter of // And finally, creating the output `Edge` is just a matter of
// assembling the pieces we've already created. // assembling the pieces we've already created.