mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-05 02:18:28 +00:00
Inline redundant method
This commit is contained in:
parent
be9634bb67
commit
57060be1ed
@ -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 {
|
||||
|
@ -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.]),
|
||||
);
|
||||
}
|
||||
|
@ -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(),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user