From 04575bb94183e391fd826553ba93d25ee11df40e Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 21 Jun 2024 20:51:23 +0200 Subject: [PATCH 1/3] Move method to restore alphabetical order --- .../fj-core/src/operations/build/surface.rs | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/crates/fj-core/src/operations/build/surface.rs b/crates/fj-core/src/operations/build/surface.rs index aa2ba429d..1a8cf5bbb 100644 --- a/crates/fj-core/src/operations/build/surface.rs +++ b/crates/fj-core/src/operations/build/surface.rs @@ -14,6 +14,25 @@ use crate::{ /// /// [module-level documentation]: super pub trait BuildSurface { + /// Build a plane from the provided `u` and `v` + fn from_uv( + u: impl Into, + v: impl Into>, + core: &mut Core, + ) -> Handle { + let surface = Surface::new().insert(core); + + core.layers.geometry.define_surface( + surface.clone(), + SurfaceGeom { + u: u.into(), + v: v.into(), + }, + ); + + surface + } + /// Build a plane from the provided points fn plane_from_points( points: [impl Into>; 3], @@ -36,25 +55,6 @@ pub trait BuildSurface { (surface, points_surface) } - - /// Build a plane from the provided `u` and `v` - fn from_uv( - u: impl Into, - v: impl Into>, - core: &mut Core, - ) -> Handle { - let surface = Surface::new().insert(core); - - core.layers.geometry.define_surface( - surface.clone(), - SurfaceGeom { - u: u.into(), - v: v.into(), - }, - ); - - surface - } } impl BuildSurface for Surface {} From ef441195c809581af95227a5c399b13e9fe28b51 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 21 Jun 2024 20:51:47 +0200 Subject: [PATCH 2/3] Fix documentation of `BuildSurface::from_uv` --- crates/fj-core/src/operations/build/surface.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/fj-core/src/operations/build/surface.rs b/crates/fj-core/src/operations/build/surface.rs index 1a8cf5bbb..699f4c69a 100644 --- a/crates/fj-core/src/operations/build/surface.rs +++ b/crates/fj-core/src/operations/build/surface.rs @@ -14,7 +14,7 @@ use crate::{ /// /// [module-level documentation]: super pub trait BuildSurface { - /// Build a plane from the provided `u` and `v` + /// Build a surface from the provided `u` and `v` fn from_uv( u: impl Into, v: impl Into>, From b66c81429e82f39ea04c5479a6d771b4062b86c0 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 21 Jun 2024 20:53:18 +0200 Subject: [PATCH 3/3] Add `BuildSurface::from_geometry` --- .../fj-core/src/operations/build/surface.rs | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/crates/fj-core/src/operations/build/surface.rs b/crates/fj-core/src/operations/build/surface.rs index 699f4c69a..76e90495c 100644 --- a/crates/fj-core/src/operations/build/surface.rs +++ b/crates/fj-core/src/operations/build/surface.rs @@ -14,23 +14,33 @@ use crate::{ /// /// [module-level documentation]: super pub trait BuildSurface { + /// Build a surface from the provided geometry + fn from_geometry( + surface_geom: SurfaceGeom, + core: &mut Core, + ) -> Handle { + let surface = Surface::new().insert(core); + + core.layers + .geometry + .define_surface(surface.clone(), surface_geom); + + surface + } + /// Build a surface from the provided `u` and `v` fn from_uv( u: impl Into, v: impl Into>, core: &mut Core, ) -> Handle { - let surface = Surface::new().insert(core); - - core.layers.geometry.define_surface( - surface.clone(), + Self::from_geometry( SurfaceGeom { u: u.into(), v: v.into(), }, - ); - - surface + core, + ) } /// Build a plane from the provided points