mirror of
https://github.com/hannobraun/Fornjot
synced 2025-01-30 11:55:57 +00:00
Fix SurfaceVertex
duplication in Vertex
sweep
This commit is contained in:
parent
2dcd433ee1
commit
74a9fa546b
@ -92,33 +92,25 @@ impl Sweep for (Vertex, Handle<Surface>) {
|
||||
)
|
||||
};
|
||||
|
||||
// And now the vertices. Again, nothing wild here.
|
||||
let vertices = {
|
||||
// Can be cleaned up, once `zip` is stable:
|
||||
// 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,
|
||||
)
|
||||
},
|
||||
);
|
||||
let vertices_surface = {
|
||||
let [_, position] = points_surface;
|
||||
let [_, global_form] = vertices_global;
|
||||
|
||||
vertices_surface.map(|surface_form| {
|
||||
Vertex::new(
|
||||
[surface_form.position().v],
|
||||
curve.clone(),
|
||||
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(
|
||||
[surface_form.position().v],
|
||||
curve.clone(),
|
||||
surface_form,
|
||||
)
|
||||
});
|
||||
|
||||
// And finally, creating the output `Edge` is just a matter of
|
||||
// assembling the pieces we've already created.
|
||||
HalfEdge::new(vertices, edge_global)
|
||||
|
Loading…
Reference in New Issue
Block a user