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