From 791745bfffbe1cd3a9b5d0873ee50ba3704cae96 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 11 May 2022 13:09:32 +0200 Subject: [PATCH] Simplify method names --- crates/fj-kernel/src/algorithms/triangulation/mod.rs | 10 +++------- .../fj-kernel/src/algorithms/triangulation/polygon.rs | 5 ++--- crates/fj-kernel/src/geometry/surfaces/mod.rs | 6 +++--- crates/fj-operations/src/sketch.rs | 2 +- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/triangulation/mod.rs b/crates/fj-kernel/src/algorithms/triangulation/mod.rs index 54b079612..600d41a64 100644 --- a/crates/fj-kernel/src/algorithms/triangulation/mod.rs +++ b/crates/fj-kernel/src/algorithms/triangulation/mod.rs @@ -32,7 +32,7 @@ pub fn triangulate( .map(|vertex| { // Can't panic, unless the approximation wrongfully // generates points that are not in the surface. - surface.convert_point_to_surface_coords(vertex) + surface.point_to_surface_coords(vertex) }) .collect(); let face_as_polygon = Polygon::new(surface) @@ -40,9 +40,7 @@ pub fn triangulate( |point| { // Can't panic, unless the approximation wrongfully // generates points that are not in the surface. - surface - .convert_point_to_surface_coords(point) - .native() + surface.point_to_surface_coords(point).native() }, )) .with_interiors(approx.interiors.into_iter().map( @@ -51,9 +49,7 @@ pub fn triangulate( // Can't panic, unless the approximation // wrongfully generates points that are not in // the surface. - surface - .convert_point_to_surface_coords(point) - .native() + surface.point_to_surface_coords(point).native() }) }, )); diff --git a/crates/fj-kernel/src/algorithms/triangulation/polygon.rs b/crates/fj-kernel/src/algorithms/triangulation/polygon.rs index 0da638aa3..5630b876f 100644 --- a/crates/fj-kernel/src/algorithms/triangulation/polygon.rs +++ b/crates/fj-kernel/src/algorithms/triangulation/polygon.rs @@ -140,7 +140,7 @@ impl Polygon { }; let mut check = TriangleEdgeCheck::new( - self.surface.convert_point_from_surface_coords(ray.origin), + self.surface.point_from_surface_coords(ray.origin), ); let mut num_hits = 0; @@ -201,8 +201,7 @@ impl Polygon { let edge = Segment::from_points(edge.points().map(|point| { - self.surface - .convert_point_from_surface_coords(point) + self.surface.point_from_surface_coords(point) })); check.hits.push(edge); } diff --git a/crates/fj-kernel/src/geometry/surfaces/mod.rs b/crates/fj-kernel/src/geometry/surfaces/mod.rs index bb3fb3f4d..c97a9c398 100644 --- a/crates/fj-kernel/src/geometry/surfaces/mod.rs +++ b/crates/fj-kernel/src/geometry/surfaces/mod.rs @@ -59,7 +59,7 @@ impl Surface { } /// Convert a point in model coordinates to surface coordinates - pub fn convert_point_to_surface_coords( + pub fn point_to_surface_coords( &self, point_3d: impl Into>, ) -> geometry::Point<2> { @@ -75,7 +75,7 @@ impl Surface { } /// Convert a point in surface coordinates to model coordinates - pub fn convert_point_from_surface_coords( + pub fn point_from_surface_coords( &self, point: impl Into>, ) -> Point<3> { @@ -87,7 +87,7 @@ impl Surface { } /// Convert a vector in surface coordinates to model coordinates - pub fn convert_vector_from_surface_coords( + pub fn vector_from_surface_coords( &self, vector: impl Into>, ) -> Vector<3> { diff --git a/crates/fj-operations/src/sketch.rs b/crates/fj-operations/src/sketch.rs index 38066e7e4..60e2ef595 100644 --- a/crates/fj-operations/src/sketch.rs +++ b/crates/fj-operations/src/sketch.rs @@ -15,7 +15,7 @@ impl ToShape for fj::Sketch { .to_points() .into_iter() .map(Point::from) - .map(|point| surface.convert_point_from_surface_coords(point)); + .map(|point| surface.point_from_surface_coords(point)); Face::builder(surface, &mut shape) .with_exterior_polygon(points)