diff --git a/crates/fj-core/src/operations/build/cycle.rs b/crates/fj-core/src/operations/build/cycle.rs index 942f0364c..42476470d 100644 --- a/crates/fj-core/src/operations/build/cycle.rs +++ b/crates/fj-core/src/operations/build/cycle.rs @@ -59,7 +59,7 @@ pub trait BuildCycle { /// ## Implementation Note /// /// The cycle can't be built out of a single half-edge. That would be - /// invalid although there's not validation check to document and enforce + /// invalid although there's no validation check to document and enforce /// that yet. Please refer to the following issue for more information: /// /// diff --git a/crates/fj-core/src/validation/checks/coincident_half_edges_are_not_siblings.rs b/crates/fj-core/src/validation/checks/coincident_half_edges_are_not_siblings.rs index 56f28fe16..4c3b60505 100644 --- a/crates/fj-core/src/validation/checks/coincident_half_edges_are_not_siblings.rs +++ b/crates/fj-core/src/validation/checks/coincident_half_edges_are_not_siblings.rs @@ -32,6 +32,9 @@ pub struct CoincidentHalfEdgesAreNotSiblings { /// The second half-edge pub half_edge_b: Handle, + /// The points on the half-edges that were checked + pub points: Vec<[Point<3>; 2]>, + /// The distances between the points on the half-edges that were checked pub distances: Vec, } @@ -76,8 +79,9 @@ impl fmt::Display for CoincidentHalfEdgesAreNotSiblings { f, "Half-edge 1: {:#?}\n\ Half-edge 2: {:#?}\n\ + Points: {:#?}\n\ Distances: {:#?}", - self.half_edge_a, self.half_edge_b, self.distances + self.half_edge_a, self.half_edge_b, self.points, self.distances )?; Ok(()) @@ -112,7 +116,7 @@ impl ValidationCheck for CoincidentHalfEdgesAreNotSiblings { continue; } - let Some(distances) = distances( + let Some(points_and_distances) = distances( half_edge_a.clone(), object .find_cycle_of_half_edge(half_edge_a) @@ -137,7 +141,9 @@ impl ValidationCheck for CoincidentHalfEdgesAreNotSiblings { // hence these half-edges can't be coincident. continue; }; - let distances = distances.collect::>(); + + let (points, distances): (Vec<_>, Vec<_>) = + points_and_distances.into_iter().unzip(); // If all points on distinct curves are within // `distinct_min_distance`, that's a problem. @@ -158,6 +164,7 @@ impl ValidationCheck for CoincidentHalfEdgesAreNotSiblings { vertices, half_edge_a: half_edge_a.clone(), half_edge_b: half_edge_b.clone(), + points, distances, }) } @@ -179,7 +186,7 @@ fn distances( end_vertex_b: &Handle, surface_b: &Handle, geometry: &Geometry, -) -> Option> { +) -> Option; 2], Scalar)>> { fn sample( percent: f64, half_edge: &Handle, @@ -232,9 +239,9 @@ fn distances( surface_b, geometry, )?; - distances.push(sample1.distance_to(&sample2)) + distances.push(([sample1, sample2], sample1.distance_to(&sample2))) } - Some(distances.into_iter()) + Some(distances) } #[cfg(test)]