Clean up as_line_segment_from_points

This commit is contained in:
Hanno Braun 2022-10-07 14:03:50 +02:00
parent 80784a1c3b
commit 8e8ff94849

View File

@ -104,14 +104,14 @@ impl PartialHalfEdge {
points: [impl Into<Point<2>>; 2], points: [impl Into<Point<2>>; 2],
) -> Self { ) -> Self {
let surface = self.surface.clone(); let surface = self.surface.clone();
self.with_vertices(Some(points.map(|point| { let vertices = points.map(|point| {
Vertex::partial().with_surface_form(Some( let surface_form = SurfaceVertex::partial()
SurfaceVertex::partial()
.with_surface(surface.clone()) .with_surface(surface.clone())
.with_position(Some(point)), .with_position(Some(point));
)) Vertex::partial().with_surface_form(Some(surface_form))
}))) });
.as_line_segment()
self.with_vertices(Some(vertices)).as_line_segment()
} }
/// Update partial half-edge as a line segment, reusing existing vertices /// Update partial half-edge as a line segment, reusing existing vertices