mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 02:48:27 +00:00
Don't implicitly copy SurfaceGeometry
This commit is contained in:
parent
0fde6449da
commit
54b7332eba
@ -32,7 +32,7 @@ impl Approx for (&Handle<Curve>, &HalfEdgeGeometry, &Handle<Surface>) {
|
||||
None => {
|
||||
let approx = approx_curve(
|
||||
&half_edge.path,
|
||||
&geometry.of_surface(surface),
|
||||
geometry.of_surface(surface),
|
||||
half_edge.boundary,
|
||||
tolerance,
|
||||
geometry,
|
||||
|
@ -91,25 +91,24 @@ impl Geometry {
|
||||
/// ## Panics
|
||||
///
|
||||
/// Panics, if the geometry of the surface is not defined.
|
||||
pub fn of_surface(&self, surface: &Handle<Surface>) -> SurfaceGeometry {
|
||||
pub fn of_surface(&self, surface: &Handle<Surface>) -> &SurfaceGeometry {
|
||||
self.surface
|
||||
.get(surface)
|
||||
.copied()
|
||||
.expect("Expected geometry of surface to be defined")
|
||||
}
|
||||
|
||||
/// Access the geometry of the xy-plane
|
||||
pub fn xy_plane(&self) -> SurfaceGeometry {
|
||||
pub fn xy_plane(&self) -> &SurfaceGeometry {
|
||||
self.of_surface(&self.xy_plane)
|
||||
}
|
||||
|
||||
/// Access the geometry of the xz-plane
|
||||
pub fn xz_plane(&self) -> SurfaceGeometry {
|
||||
pub fn xz_plane(&self) -> &SurfaceGeometry {
|
||||
self.of_surface(&self.xz_plane)
|
||||
}
|
||||
|
||||
/// Access the geometry of the yz-plane
|
||||
pub fn yz_plane(&self) -> SurfaceGeometry {
|
||||
pub fn yz_plane(&self) -> &SurfaceGeometry {
|
||||
self.of_surface(&self.yz_plane)
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ impl SweepHalfEdge for Handle<HalfEdge> {
|
||||
let path = path.into();
|
||||
|
||||
let half_edge_geom = *core.layers.geometry.of_half_edge(self);
|
||||
let surface_geom = core.layers.geometry.of_surface(&surface);
|
||||
let surface_geom = *core.layers.geometry.of_surface(&surface);
|
||||
let surface =
|
||||
half_edge_geom
|
||||
.path
|
||||
|
@ -150,18 +150,18 @@ impl ShellValidationError {
|
||||
|
||||
compare_curve_coords(
|
||||
edge_a,
|
||||
&geometry.of_surface(surface_a),
|
||||
geometry.of_surface(surface_a),
|
||||
edge_b,
|
||||
&geometry.of_surface(surface_b),
|
||||
geometry.of_surface(surface_b),
|
||||
geometry,
|
||||
config,
|
||||
&mut mismatches,
|
||||
);
|
||||
compare_curve_coords(
|
||||
edge_b,
|
||||
&geometry.of_surface(surface_b),
|
||||
geometry.of_surface(surface_b),
|
||||
edge_a,
|
||||
&geometry.of_surface(surface_a),
|
||||
geometry.of_surface(surface_a),
|
||||
geometry,
|
||||
config,
|
||||
&mut mismatches,
|
||||
@ -254,9 +254,9 @@ impl ShellValidationError {
|
||||
// `distinct_min_distance`, that's a problem.
|
||||
if distances(
|
||||
half_edge_a.clone(),
|
||||
&geometry.of_surface(surface_a),
|
||||
geometry.of_surface(surface_a),
|
||||
half_edge_b.clone(),
|
||||
&geometry.of_surface(surface_b),
|
||||
geometry.of_surface(surface_b),
|
||||
geometry,
|
||||
)
|
||||
.all(|d| d < config.distinct_min_distance)
|
||||
|
Loading…
Reference in New Issue
Block a user