Skip to content

Commit

Permalink
Use new-style surface geometry in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Oct 14, 2024
1 parent 1c0ad95 commit 29daf84
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 9 deletions.
14 changes: 12 additions & 2 deletions crates/fj-core/src/algorithms/approx/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ mod tests {
.map(|(point_local, _)| {
let point_surface = path.point_from_path_coords(point_local);
let point_global = convert_point_surface_to_global(
core.layers.geometry.of_surface(&surface),
&core
.layers
.geometry
.of_surface_2(&surface)
.unwrap()
.geometry,
point_surface,
tolerance,
);
Expand Down Expand Up @@ -295,7 +300,12 @@ mod tests {
.map(|(point_local, _)| {
let point_surface = path.point_from_path_coords(point_local);
let point_global = convert_point_surface_to_global(
core.layers.geometry.of_surface(&surface),
&core
.layers
.geometry
.of_surface_2(&surface)
.unwrap()
.geometry,
point_surface,
tolerance,
);
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-core/src/algorithms/approx/vertex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub fn approx_vertex(
Some(position) => position,
None => {
let position_global = convert_point_surface_to_global(
geometry.of_surface(surface),
&geometry.of_surface_2(surface).unwrap().geometry,
position_surface,
tolerance,
);
Expand Down
3 changes: 2 additions & 1 deletion crates/fj-core/src/algorithms/bounding_volume/face.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ impl super::BoundingVolume<3> for &Face {
(self.region().exterior().deref(), self.surface())
.aabb(geometry)
.map(|aabb2| {
let surface = geometry.of_surface(self.surface());
let surface =
&geometry.of_surface_2(self.surface()).unwrap().geometry;
let tri_mesh = surface.generate_tri_mesh(aabb2, tolerance);
let tri_mesh = tri_mesh.into_iter().map(|point| {
convert_point_surface_to_global(surface, point, tolerance)
Expand Down
14 changes: 12 additions & 2 deletions crates/fj-core/src/algorithms/triangulate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ mod tests {

let [a, b, e, f, g, h] = [a, b, e, f, g, h].map(|point| {
convert_point_surface_to_global(
core.layers.geometry.of_surface(&surface),
&core
.layers
.geometry
.of_surface_2(&surface)
.unwrap()
.geometry,
point,
core.tolerance(),
)
Expand Down Expand Up @@ -253,7 +258,12 @@ mod tests {

let [a, b, c, d, e] = [a, b, c, d, e].map(|point| {
convert_point_surface_to_global(
core.layers.geometry.of_surface(&surface),
&core
.layers
.geometry
.of_surface_2(&surface)
.unwrap()
.geometry,
point,
core.tolerance(),
)
Expand Down
7 changes: 6 additions & 1 deletion crates/fj-core/src/operations/holes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ impl AddHole for Shell {
let path = {
let point = |location: &HoleLocation| {
convert_point_surface_to_global(
core.layers.geometry.of_surface(location.face.surface()),
&core
.layers
.geometry
.of_surface_2(location.face.surface())
.unwrap()
.geometry,
location.position,
core.tolerance(),
)
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-core/src/validate/solid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl SolidValidationError {

Some((
convert_point_surface_to_global(
geometry.of_surface(s),
&geometry.of_surface_2(s).unwrap().geometry,
local_curve_geometry.path.point_from_path_coords(
geometry
.of_vertex(h.start_vertex())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ fn distances(
.path;
let surface_coords = path.point_from_path_coords(path_coords);
Some(convert_point_surface_to_global(
geometry.of_surface(surface),
&geometry.of_surface_2(surface).unwrap().geometry,
surface_coords,
tolerance,
))
Expand Down

0 comments on commit 29daf84

Please sign in to comment.