Inline redundant method

This commit is contained in:
Hanno Braun 2024-10-11 18:42:14 +02:00
parent be9634bb67
commit 57060be1ed
3 changed files with 21 additions and 19 deletions

View File

@ -4,7 +4,6 @@ use fj_math::{Aabb, Point, Scalar, Transform, Triangle, Vector};
use super::{
traits::{GenPolyline, GenTriMesh},
util::tri_mesh::convert_vector_surface_to_global,
Path, Tolerance,
};
@ -19,15 +18,6 @@ pub struct SweptCurve {
}
impl SweptCurve {
/// Convert a vector in surface coordinates to model coordinates
pub fn vector_from_surface_coords(
&self,
vector: impl Into<Vector<2>>,
tolerance: impl Into<Tolerance>,
) -> Vector<3> {
convert_vector_surface_to_global(self, vector, tolerance)
}
/// Transform the surface geometry
#[must_use]
pub fn transform(self, transform: &Transform) -> Self {

View File

@ -36,8 +36,10 @@ mod tests {
use pretty_assertions::assert_eq;
use crate::geometry::{
util::tri_mesh::convert_point_surface_to_global, Path, SweptCurve,
Tolerance,
util::tri_mesh::{
convert_point_surface_to_global, convert_vector_surface_to_global,
},
Path, SweptCurve, Tolerance,
};
#[test]
@ -73,7 +75,7 @@ mod tests {
let tolerance = Tolerance::from_scalar(1.).unwrap();
assert_eq!(
surface.vector_from_surface_coords([2., 4.], tolerance),
convert_vector_surface_to_global(&surface, [2., 4.], tolerance),
Vector::from([0., 4., 8.]),
);
}

View File

@ -2,7 +2,10 @@ use fj_math::{Circle, Line, Vector};
use crate::{
geometry::{
util::tri_mesh::convert_point_surface_to_global, Path, SweptCurve,
util::tri_mesh::{
convert_point_surface_to_global, convert_vector_surface_to_global,
},
Path, SweptCurve,
},
operations::build::BuildSurface,
storage::Handle,
@ -73,10 +76,16 @@ impl SweepSurfacePath for Path<2> {
circle.center(),
core.tolerance(),
);
let a = surface
.vector_from_surface_coords(circle.a(), core.tolerance());
let b = surface
.vector_from_surface_coords(circle.b(), core.tolerance());
let a = convert_vector_surface_to_global(
surface,
circle.a(),
core.tolerance(),
);
let b = convert_vector_surface_to_global(
surface,
circle.b(),
core.tolerance(),
);
let circle = Circle::new(center, a, b);
@ -88,7 +97,8 @@ impl SweepSurfacePath for Path<2> {
line.origin(),
core.tolerance(),
);
let direction = surface.vector_from_surface_coords(
let direction = convert_vector_surface_to_global(
surface,
line.direction(),
core.tolerance(),
);