From be4f9b87d358a0f0c47d3a1fb75462a5151cad3b Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 23 Mar 2023 12:16:24 +0100 Subject: [PATCH 1/7] Replace `SurfaceBuilder` with `BuildSurface` trait --- crates/fj-kernel/src/builder/face.rs | 7 +++---- crates/fj-kernel/src/builder/mod.rs | 3 +-- crates/fj-kernel/src/operations/build/mod.rs | 3 +++ .../src/{builder => operations/build}/surface.rs | 12 ++++++------ crates/fj-kernel/src/operations/mod.rs | 3 ++- 5 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 crates/fj-kernel/src/operations/build/mod.rs rename crates/fj-kernel/src/{builder => operations/build}/surface.rs (62%) diff --git a/crates/fj-kernel/src/builder/face.rs b/crates/fj-kernel/src/builder/face.rs index 37125b254..fea7ca389 100644 --- a/crates/fj-kernel/src/builder/face.rs +++ b/crates/fj-kernel/src/builder/face.rs @@ -3,12 +3,12 @@ use fj_math::Point; use crate::{ objects::{Cycle, Face, GlobalEdge, Objects, Surface}, - operations::Insert, + operations::{BuildSurface, Insert}, services::Service, storage::Handle, }; -use super::{CycleBuilder, HalfEdgeBuilder, SurfaceBuilder}; +use super::{CycleBuilder, HalfEdgeBuilder}; /// Builder API for [`Face`] pub struct FaceBuilder { @@ -36,8 +36,7 @@ impl FaceBuilder { ) -> (Handle, [Handle; 3]) { let [a, b, c] = points.map(Into::into); - let surface = - SurfaceBuilder::plane_from_points([a, b, c]).insert(objects); + let surface = Surface::plane_from_points([a, b, c]).insert(objects); let (exterior, global_edges) = { let half_edges = [[a, b], [b, c], [c, a]].zip_ext(edges).map( |(points, global_form)| { diff --git a/crates/fj-kernel/src/builder/mod.rs b/crates/fj-kernel/src/builder/mod.rs index 1cbad97ac..012187bb7 100644 --- a/crates/fj-kernel/src/builder/mod.rs +++ b/crates/fj-kernel/src/builder/mod.rs @@ -5,9 +5,8 @@ mod cycle; mod edge; mod face; mod shell; -mod surface; pub use self::{ cycle::CycleBuilder, edge::HalfEdgeBuilder, face::FaceBuilder, - shell::ShellBuilder, surface::SurfaceBuilder, + shell::ShellBuilder, }; diff --git a/crates/fj-kernel/src/operations/build/mod.rs b/crates/fj-kernel/src/operations/build/mod.rs new file mode 100644 index 000000000..7f2bcfbcb --- /dev/null +++ b/crates/fj-kernel/src/operations/build/mod.rs @@ -0,0 +1,3 @@ +mod surface; + +pub use self::surface::BuildSurface; diff --git a/crates/fj-kernel/src/builder/surface.rs b/crates/fj-kernel/src/operations/build/surface.rs similarity index 62% rename from crates/fj-kernel/src/builder/surface.rs rename to crates/fj-kernel/src/operations/build/surface.rs index 1b595f4aa..bd7bab739 100644 --- a/crates/fj-kernel/src/builder/surface.rs +++ b/crates/fj-kernel/src/operations/build/surface.rs @@ -5,12 +5,10 @@ use crate::{ objects::Surface, }; -/// Builder API for [`Surface`] -pub struct SurfaceBuilder {} - -impl SurfaceBuilder { - /// Create a plane from the provided points - pub fn plane_from_points(points: [impl Into>; 3]) -> Surface { +/// Build a [`Surface`] +pub trait BuildSurface { + /// Build a plane from the provided points + fn plane_from_points(points: [impl Into>; 3]) -> Surface { let [a, b, c] = points.map(Into::into); let geometry = SurfaceGeometry { @@ -21,3 +19,5 @@ impl SurfaceBuilder { Surface::new(geometry) } } + +impl BuildSurface for Surface {} diff --git a/crates/fj-kernel/src/operations/mod.rs b/crates/fj-kernel/src/operations/mod.rs index 052dc3eef..874896226 100644 --- a/crates/fj-kernel/src/operations/mod.rs +++ b/crates/fj-kernel/src/operations/mod.rs @@ -1,5 +1,6 @@ //! Operations to update shapes +mod build; mod insert; -pub use self::insert::Insert; +pub use self::{build::BuildSurface, insert::Insert}; From 4ba81fcf430a2b4fa08a4f8d0b81a0330f08badf Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 23 Mar 2023 12:30:04 +0100 Subject: [PATCH 2/7] Move `FaceBuilder::triangle` to `BuildFace` trait --- crates/fj-kernel/src/builder/face.rs | 47 ++-------------- crates/fj-kernel/src/builder/shell.rs | 23 +++----- crates/fj-kernel/src/operations/build/face.rs | 55 +++++++++++++++++++ crates/fj-kernel/src/operations/build/mod.rs | 3 +- crates/fj-kernel/src/operations/mod.rs | 5 +- 5 files changed, 73 insertions(+), 60 deletions(-) create mode 100644 crates/fj-kernel/src/operations/build/face.rs diff --git a/crates/fj-kernel/src/builder/face.rs b/crates/fj-kernel/src/builder/face.rs index fea7ca389..3dc980233 100644 --- a/crates/fj-kernel/src/builder/face.rs +++ b/crates/fj-kernel/src/builder/face.rs @@ -1,14 +1,13 @@ -use fj_interop::{ext::ArrayExt, mesh::Color}; -use fj_math::Point; +use fj_interop::mesh::Color; use crate::{ - objects::{Cycle, Face, GlobalEdge, Objects, Surface}, - operations::{BuildSurface, Insert}, + objects::{Face, Objects, Surface}, + operations::Insert, services::Service, storage::Handle, }; -use super::{CycleBuilder, HalfEdgeBuilder}; +use super::CycleBuilder; /// Builder API for [`Face`] pub struct FaceBuilder { @@ -28,44 +27,6 @@ impl FaceBuilder { } } - /// Create a triangle - pub fn triangle( - points: [impl Into>; 3], - edges: [Option>; 3], - objects: &mut Service, - ) -> (Handle, [Handle; 3]) { - let [a, b, c] = points.map(Into::into); - - let surface = Surface::plane_from_points([a, b, c]).insert(objects); - let (exterior, global_edges) = { - let half_edges = [[a, b], [b, c], [c, a]].zip_ext(edges).map( - |(points, global_form)| { - let mut builder = - HalfEdgeBuilder::line_segment_from_global_points( - points, &surface, None, - ); - - if let Some(global_form) = global_form { - builder = builder.with_global_form(global_form); - } - - builder.build(objects).insert(objects) - }, - ); - - let cycle = Cycle::new(half_edges.clone()).insert(objects); - - let global_edges = - half_edges.map(|half_edge| half_edge.global_form().clone()); - - (cycle, global_edges) - }; - - let face = Face::new(surface, exterior, [], None).insert(objects); - - (face, global_edges) - } - /// Replace the face's exterior cycle pub fn with_exterior(mut self, exterior: CycleBuilder) -> Self { self.exterior = exterior; diff --git a/crates/fj-kernel/src/builder/shell.rs b/crates/fj-kernel/src/builder/shell.rs index 81f14bf95..1e5176a60 100644 --- a/crates/fj-kernel/src/builder/shell.rs +++ b/crates/fj-kernel/src/builder/shell.rs @@ -1,12 +1,11 @@ use fj_math::Point; use crate::{ - objects::{Objects, Shell}, + objects::{Face, Objects, Shell}, + operations::BuildFace, services::Service, }; -use super::FaceBuilder; - /// Builder API for [`Shell`] pub struct ShellBuilder {} @@ -19,19 +18,13 @@ impl ShellBuilder { let [a, b, c, d] = points.map(Into::into); let (base, [ab, bc, ca]) = - FaceBuilder::triangle([a, b, c], [None, None, None], objects); + Face::triangle([a, b, c], [None, None, None], objects); let (side_a, [_, bd, da]) = - FaceBuilder::triangle([a, b, d], [Some(ab), None, None], objects); - let (side_b, [_, _, dc]) = FaceBuilder::triangle( - [c, a, d], - [Some(ca), Some(da), None], - objects, - ); - let (side_c, _) = FaceBuilder::triangle( - [b, c, d], - [Some(bc), Some(dc), Some(bd)], - objects, - ); + Face::triangle([a, b, d], [Some(ab), None, None], objects); + let (side_b, [_, _, dc]) = + Face::triangle([c, a, d], [Some(ca), Some(da), None], objects); + let (side_c, _) = + Face::triangle([b, c, d], [Some(bc), Some(dc), Some(bd)], objects); Shell::new([base, side_a, side_b, side_c]) } diff --git a/crates/fj-kernel/src/operations/build/face.rs b/crates/fj-kernel/src/operations/build/face.rs new file mode 100644 index 000000000..4e2a6e0f2 --- /dev/null +++ b/crates/fj-kernel/src/operations/build/face.rs @@ -0,0 +1,55 @@ +use fj_interop::ext::ArrayExt; +use fj_math::Point; + +use crate::{ + builder::HalfEdgeBuilder, + objects::{Cycle, Face, GlobalEdge, Objects, Surface}, + operations::Insert, + services::Service, + storage::Handle, +}; + +use super::BuildSurface; + +/// Build a [`Face`] +pub trait BuildFace { + /// Build a triangle + fn triangle( + points: [impl Into>; 3], + edges: [Option>; 3], + objects: &mut Service, + ) -> (Handle, [Handle; 3]) { + let [a, b, c] = points.map(Into::into); + + let surface = Surface::plane_from_points([a, b, c]).insert(objects); + let (exterior, global_edges) = { + let half_edges = [[a, b], [b, c], [c, a]].zip_ext(edges).map( + |(points, global_form)| { + let mut builder = + HalfEdgeBuilder::line_segment_from_global_points( + points, &surface, None, + ); + + if let Some(global_form) = global_form { + builder = builder.with_global_form(global_form); + } + + builder.build(objects).insert(objects) + }, + ); + + let cycle = Cycle::new(half_edges.clone()).insert(objects); + + let global_edges = + half_edges.map(|half_edge| half_edge.global_form().clone()); + + (cycle, global_edges) + }; + + let face = Face::new(surface, exterior, [], None).insert(objects); + + (face, global_edges) + } +} + +impl BuildFace for Face {} diff --git a/crates/fj-kernel/src/operations/build/mod.rs b/crates/fj-kernel/src/operations/build/mod.rs index 7f2bcfbcb..d87763664 100644 --- a/crates/fj-kernel/src/operations/build/mod.rs +++ b/crates/fj-kernel/src/operations/build/mod.rs @@ -1,3 +1,4 @@ +mod face; mod surface; -pub use self::surface::BuildSurface; +pub use self::{face::BuildFace, surface::BuildSurface}; diff --git a/crates/fj-kernel/src/operations/mod.rs b/crates/fj-kernel/src/operations/mod.rs index 874896226..e4b33ea2b 100644 --- a/crates/fj-kernel/src/operations/mod.rs +++ b/crates/fj-kernel/src/operations/mod.rs @@ -3,4 +3,7 @@ mod build; mod insert; -pub use self::{build::BuildSurface, insert::Insert}; +pub use self::{ + build::{BuildFace, BuildSurface}, + insert::Insert, +}; From 0cf7bed71768a6705fa8c36e0a3a25d8844aa65f Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 23 Mar 2023 12:40:05 +0100 Subject: [PATCH 3/7] Replace `ShellBuilder` with new `BuildShell` trait --- crates/fj-kernel/src/builder/mod.rs | 6 +----- crates/fj-kernel/src/operations/build/mod.rs | 3 ++- .../src/{builder => operations/build}/shell.rs | 13 +++++++------ crates/fj-kernel/src/operations/mod.rs | 2 +- crates/fj-kernel/src/validate/shell.rs | 8 ++++---- 5 files changed, 15 insertions(+), 17 deletions(-) rename crates/fj-kernel/src/{builder => operations/build}/shell.rs (80%) diff --git a/crates/fj-kernel/src/builder/mod.rs b/crates/fj-kernel/src/builder/mod.rs index 012187bb7..5349098a1 100644 --- a/crates/fj-kernel/src/builder/mod.rs +++ b/crates/fj-kernel/src/builder/mod.rs @@ -4,9 +4,5 @@ mod cycle; mod edge; mod face; -mod shell; -pub use self::{ - cycle::CycleBuilder, edge::HalfEdgeBuilder, face::FaceBuilder, - shell::ShellBuilder, -}; +pub use self::{cycle::CycleBuilder, edge::HalfEdgeBuilder, face::FaceBuilder}; diff --git a/crates/fj-kernel/src/operations/build/mod.rs b/crates/fj-kernel/src/operations/build/mod.rs index d87763664..762c76fef 100644 --- a/crates/fj-kernel/src/operations/build/mod.rs +++ b/crates/fj-kernel/src/operations/build/mod.rs @@ -1,4 +1,5 @@ mod face; +mod shell; mod surface; -pub use self::{face::BuildFace, surface::BuildSurface}; +pub use self::{face::BuildFace, shell::BuildShell, surface::BuildSurface}; diff --git a/crates/fj-kernel/src/builder/shell.rs b/crates/fj-kernel/src/operations/build/shell.rs similarity index 80% rename from crates/fj-kernel/src/builder/shell.rs rename to crates/fj-kernel/src/operations/build/shell.rs index 1e5176a60..dfa8a61cd 100644 --- a/crates/fj-kernel/src/builder/shell.rs +++ b/crates/fj-kernel/src/operations/build/shell.rs @@ -2,16 +2,15 @@ use fj_math::Point; use crate::{ objects::{Face, Objects, Shell}, - operations::BuildFace, services::Service, }; -/// Builder API for [`Shell`] -pub struct ShellBuilder {} +use super::BuildFace; -impl ShellBuilder { - /// Create a tetrahedron from the provided points - pub fn tetrahedron( +/// Build a [`Shell`] +pub trait BuildShell { + /// Build a tetrahedron from the provided points + fn tetrahedron( points: [impl Into>; 4], objects: &mut Service, ) -> Shell { @@ -29,3 +28,5 @@ impl ShellBuilder { Shell::new([base, side_a, side_b, side_c]) } } + +impl BuildShell for Shell {} diff --git a/crates/fj-kernel/src/operations/mod.rs b/crates/fj-kernel/src/operations/mod.rs index e4b33ea2b..7ed85caf8 100644 --- a/crates/fj-kernel/src/operations/mod.rs +++ b/crates/fj-kernel/src/operations/mod.rs @@ -4,6 +4,6 @@ mod build; mod insert; pub use self::{ - build::{BuildFace, BuildSurface}, + build::{BuildFace, BuildShell, BuildSurface}, insert::Insert, }; diff --git a/crates/fj-kernel/src/validate/shell.rs b/crates/fj-kernel/src/validate/shell.rs index caa9818dd..1e4abccaa 100644 --- a/crates/fj-kernel/src/validate/shell.rs +++ b/crates/fj-kernel/src/validate/shell.rs @@ -193,9 +193,9 @@ impl ShellValidationError { mod tests { use crate::{ assert_contains_err, - builder::{CycleBuilder, FaceBuilder, ShellBuilder}, + builder::{CycleBuilder, FaceBuilder}, objects::Shell, - operations::Insert, + operations::{BuildShell, Insert}, services::Services, validate::{shell::ShellValidationError, Validate, ValidationError}, }; @@ -204,7 +204,7 @@ mod tests { fn coincident_not_identical() -> anyhow::Result<()> { let mut services = Services::new(); - let valid = ShellBuilder::tetrahedron( + let valid = Shell::tetrahedron( [[0., 0., 0.], [1., 0., 0.], [0., 1., 0.], [0., 0., 1.]], &mut services.objects, ); @@ -246,7 +246,7 @@ mod tests { fn shell_not_watertight() -> anyhow::Result<()> { let mut services = Services::new(); - let valid = ShellBuilder::tetrahedron( + let valid = Shell::tetrahedron( [[0., 0., 0.], [1., 0., 0.], [0., 1., 0.], [0., 0., 1.]], &mut services.objects, ); From 98160a27aa88d4b5e3dbdb28026641d7089105a7 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 23 Mar 2023 12:42:37 +0100 Subject: [PATCH 4/7] Refactor code to prepare for follow-on change --- crates/fj-kernel/src/operations/build/shell.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/fj-kernel/src/operations/build/shell.rs b/crates/fj-kernel/src/operations/build/shell.rs index dfa8a61cd..020c145de 100644 --- a/crates/fj-kernel/src/operations/build/shell.rs +++ b/crates/fj-kernel/src/operations/build/shell.rs @@ -25,7 +25,8 @@ pub trait BuildShell { let (side_c, _) = Face::triangle([b, c, d], [Some(bc), Some(dc), Some(bd)], objects); - Shell::new([base, side_a, side_b, side_c]) + let faces = [base, side_a, side_b, side_c]; + Shell::new(faces) } } From 259c6a7bca2005fbdc7882a8b3582af4a2d4b07c Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 23 Mar 2023 12:43:39 +0100 Subject: [PATCH 5/7] Return bare face from `BuildFace::triangle` This gives the caller more flexibility on what to do with it. --- crates/fj-kernel/src/operations/build/face.rs | 4 ++-- crates/fj-kernel/src/operations/build/shell.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/fj-kernel/src/operations/build/face.rs b/crates/fj-kernel/src/operations/build/face.rs index 4e2a6e0f2..045efbe5d 100644 --- a/crates/fj-kernel/src/operations/build/face.rs +++ b/crates/fj-kernel/src/operations/build/face.rs @@ -18,7 +18,7 @@ pub trait BuildFace { points: [impl Into>; 3], edges: [Option>; 3], objects: &mut Service, - ) -> (Handle, [Handle; 3]) { + ) -> (Face, [Handle; 3]) { let [a, b, c] = points.map(Into::into); let surface = Surface::plane_from_points([a, b, c]).insert(objects); @@ -46,7 +46,7 @@ pub trait BuildFace { (cycle, global_edges) }; - let face = Face::new(surface, exterior, [], None).insert(objects); + let face = Face::new(surface, exterior, [], None); (face, global_edges) } diff --git a/crates/fj-kernel/src/operations/build/shell.rs b/crates/fj-kernel/src/operations/build/shell.rs index 020c145de..968ba1678 100644 --- a/crates/fj-kernel/src/operations/build/shell.rs +++ b/crates/fj-kernel/src/operations/build/shell.rs @@ -2,6 +2,7 @@ use fj_math::Point; use crate::{ objects::{Face, Objects, Shell}, + operations::Insert, services::Service, }; @@ -25,7 +26,8 @@ pub trait BuildShell { let (side_c, _) = Face::triangle([b, c, d], [Some(bc), Some(dc), Some(bd)], objects); - let faces = [base, side_a, side_b, side_c]; + let faces = + [base, side_a, side_b, side_c].map(|face| face.insert(objects)); Shell::new(faces) } } From 6ced3335b5adb923f502064b0f66bdc36ff2d207 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 23 Mar 2023 12:56:57 +0100 Subject: [PATCH 6/7] Make return value more explicit --- crates/fj-kernel/src/operations/build/face.rs | 18 +++++++++++++-- crates/fj-kernel/src/operations/build/mod.rs | 6 ++++- .../fj-kernel/src/operations/build/shell.rs | 22 ++++++++++++------- crates/fj-kernel/src/operations/mod.rs | 2 +- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/crates/fj-kernel/src/operations/build/face.rs b/crates/fj-kernel/src/operations/build/face.rs index 045efbe5d..7fab183d7 100644 --- a/crates/fj-kernel/src/operations/build/face.rs +++ b/crates/fj-kernel/src/operations/build/face.rs @@ -18,7 +18,7 @@ pub trait BuildFace { points: [impl Into>; 3], edges: [Option>; 3], objects: &mut Service, - ) -> (Face, [Handle; 3]) { + ) -> Triangle { let [a, b, c] = points.map(Into::into); let surface = Surface::plane_from_points([a, b, c]).insert(objects); @@ -48,8 +48,22 @@ pub trait BuildFace { let face = Face::new(surface, exterior, [], None); - (face, global_edges) + Triangle { + face, + edges: global_edges, + } } } impl BuildFace for Face {} + +/// A triangle +/// +/// Returned by [`BuildFace::triangle`]. +pub struct Triangle { + /// The face that forms the triangle + pub face: Face, + + /// The edges of the triangle + pub edges: [Handle; 3], +} diff --git a/crates/fj-kernel/src/operations/build/mod.rs b/crates/fj-kernel/src/operations/build/mod.rs index 762c76fef..be6dfed0e 100644 --- a/crates/fj-kernel/src/operations/build/mod.rs +++ b/crates/fj-kernel/src/operations/build/mod.rs @@ -2,4 +2,8 @@ mod face; mod shell; mod surface; -pub use self::{face::BuildFace, shell::BuildShell, surface::BuildSurface}; +pub use self::{ + face::{BuildFace, Triangle}, + shell::BuildShell, + surface::BuildSurface, +}; diff --git a/crates/fj-kernel/src/operations/build/shell.rs b/crates/fj-kernel/src/operations/build/shell.rs index 968ba1678..6d4a917f1 100644 --- a/crates/fj-kernel/src/operations/build/shell.rs +++ b/crates/fj-kernel/src/operations/build/shell.rs @@ -6,7 +6,7 @@ use crate::{ services::Service, }; -use super::BuildFace; +use super::{BuildFace, Triangle}; /// Build a [`Shell`] pub trait BuildShell { @@ -17,13 +17,19 @@ pub trait BuildShell { ) -> Shell { let [a, b, c, d] = points.map(Into::into); - let (base, [ab, bc, ca]) = - Face::triangle([a, b, c], [None, None, None], objects); - let (side_a, [_, bd, da]) = - Face::triangle([a, b, d], [Some(ab), None, None], objects); - let (side_b, [_, _, dc]) = - Face::triangle([c, a, d], [Some(ca), Some(da), None], objects); - let (side_c, _) = + let Triangle { + face: base, + edges: [ab, bc, ca], + } = Face::triangle([a, b, c], [None, None, None], objects); + let Triangle { + face: side_a, + edges: [_, bd, da], + } = Face::triangle([a, b, d], [Some(ab), None, None], objects); + let Triangle { + face: side_b, + edges: [_, _, dc], + } = Face::triangle([c, a, d], [Some(ca), Some(da), None], objects); + let Triangle { face: side_c, .. } = Face::triangle([b, c, d], [Some(bc), Some(dc), Some(bd)], objects); let faces = diff --git a/crates/fj-kernel/src/operations/mod.rs b/crates/fj-kernel/src/operations/mod.rs index 7ed85caf8..0cfabab4c 100644 --- a/crates/fj-kernel/src/operations/mod.rs +++ b/crates/fj-kernel/src/operations/mod.rs @@ -4,6 +4,6 @@ mod build; mod insert; pub use self::{ - build::{BuildFace, BuildShell, BuildSurface}, + build::{BuildFace, BuildShell, BuildSurface, Triangle}, insert::Insert, }; From 29c0203b183c4c4c48a07361fdca24d7e7f898e1 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 23 Mar 2023 12:58:24 +0100 Subject: [PATCH 7/7] Simplify variable name --- crates/fj-kernel/src/operations/build/face.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/fj-kernel/src/operations/build/face.rs b/crates/fj-kernel/src/operations/build/face.rs index 7fab183d7..e4c5af4c3 100644 --- a/crates/fj-kernel/src/operations/build/face.rs +++ b/crates/fj-kernel/src/operations/build/face.rs @@ -22,7 +22,7 @@ pub trait BuildFace { let [a, b, c] = points.map(Into::into); let surface = Surface::plane_from_points([a, b, c]).insert(objects); - let (exterior, global_edges) = { + let (exterior, edges) = { let half_edges = [[a, b], [b, c], [c, a]].zip_ext(edges).map( |(points, global_form)| { let mut builder = @@ -48,10 +48,7 @@ pub trait BuildFace { let face = Face::new(surface, exterior, [], None); - Triangle { - face, - edges: global_edges, - } + Triangle { face, edges } } }