Prepare for follow-on change

This commit is contained in:
Hanno Braun 2024-06-17 22:21:03 +02:00
parent c9bfce1ca9
commit 2043b40c9e

View File

@ -8,7 +8,7 @@ use crate::{
AllHalfEdgesWithSurface, BoundingVerticesOfHalfEdge, SiblingOfHalfEdge,
},
storage::Handle,
topology::{Curve, HalfEdge, Shell, Vertex},
topology::{Curve, HalfEdge, Shell, Surface, Vertex},
validation::ValidationCheck,
};
@ -128,7 +128,7 @@ impl ValidationCheck<Shell> for CoincidentHalfEdgesAreNotSiblings {
// `distinct_min_distance`, that's a problem.
if distances(
half_edge_a.clone(),
geometry.of_surface(surface_a),
surface_a,
half_edge_b.clone(),
geometry.of_surface(surface_b),
geometry,
@ -170,7 +170,7 @@ impl ValidationCheck<Shell> for CoincidentHalfEdgesAreNotSiblings {
/// Returns an [`Iterator`] of the distance at each sample.
fn distances(
half_edge_a: Handle<HalfEdge>,
surface_a: &SurfaceGeom,
surface_a: &Handle<Surface>,
half_edge_b: Handle<HalfEdge>,
surface_b: &SurfaceGeom,
geometry: &Geometry,
@ -198,7 +198,11 @@ fn distances(
let mut distances = Vec::new();
for i in 0..sample_count {
let percent = i as f64 * step;
let sample1 = sample(percent, (&half_edge_a, surface_a), geometry);
let sample1 = sample(
percent,
(&half_edge_a, geometry.of_surface(surface_a)),
geometry,
);
let sample2 =
sample(1.0 - percent, (&half_edge_b, surface_b), geometry);
distances.push(sample1.distance_to(&sample2))