diff --git a/crates/fj-core/src/operations/build/face.rs b/crates/fj-core/src/operations/build/face.rs index 233867c9b..d67bb53d8 100644 --- a/crates/fj-core/src/operations/build/face.rs +++ b/crates/fj-core/src/operations/build/face.rs @@ -27,8 +27,7 @@ pub trait BuildFace { let (surface, points_surface) = Surface::plane_from_points(points); let surface = surface.insert(services); - let region = Region::polygon(points_surface, services).insert(services); - let face = Face::new(surface, region); + let face = Face::polygon(surface, points_surface, services); let edges = { let mut half_edges = face.region().exterior().half_edges().cloned(); @@ -51,6 +50,21 @@ pub trait BuildFace { vertices, } } + + /// Build a polygon + fn polygon( + surface: Handle, + points: Ps, + services: &mut Services, + ) -> Face + where + P: Into>, + Ps: IntoIterator, + Ps::IntoIter: Clone + ExactSizeIterator, + { + let region = Region::polygon(points, services).insert(services); + Face::new(surface, region) + } } impl BuildFace for Face {}