Rewrite surface selection with merge

This commit is contained in:
Hanno Braun 2022-11-12 17:42:23 +01:00
parent 9c2b67c9bf
commit fe2fa1b8b7

View File

@ -5,8 +5,9 @@ use crate::{
insert::Insert,
objects::{Curve, Objects, Surface, Vertex, VerticesInNormalizedOrder},
partial::{
MaybePartial, PartialCurve, PartialGlobalEdge, PartialGlobalVertex,
PartialHalfEdge, PartialSurfaceVertex, PartialVertex,
MaybePartial, MergeWith, PartialCurve, PartialGlobalEdge,
PartialGlobalVertex, PartialHalfEdge, PartialSurfaceVertex,
PartialVertex,
},
storage::Handle,
validate::ValidationError,
@ -135,8 +136,8 @@ impl HalfEdgeBuilder for PartialHalfEdge {
let surface = self
.curve()
.surface()
.or_else(|| from_surface.surface())
.or_else(|| to_surface.surface())
.merge_with(from_surface.surface())
.merge_with(to_surface.surface())
.expect("Can't infer line segment without a surface");
let points = [&from_surface, &to_surface].map(|vertex| {
vertex