mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-03 17:38:27 +00:00
Add more information to validation error
This commit is contained in:
parent
5f7b70705b
commit
e369e3c9ff
@ -31,6 +31,9 @@ pub struct CoincidentHalfEdgesAreNotSiblings {
|
||||
|
||||
/// The second half-edge
|
||||
pub half_edge_b: Handle<HalfEdge>,
|
||||
|
||||
/// The distances between the points on the half-edges that were checked
|
||||
pub distances: Vec<Scalar>,
|
||||
}
|
||||
|
||||
impl fmt::Display for CoincidentHalfEdgesAreNotSiblings {
|
||||
@ -108,7 +111,7 @@ impl ValidationCheck<Shell> for CoincidentHalfEdgesAreNotSiblings {
|
||||
continue;
|
||||
}
|
||||
|
||||
let Some(mut distances) = distances(
|
||||
let Some(distances) = distances(
|
||||
half_edge_a.clone(),
|
||||
object
|
||||
.find_cycle_of_half_edge(half_edge_a)
|
||||
@ -133,10 +136,11 @@ impl ValidationCheck<Shell> for CoincidentHalfEdgesAreNotSiblings {
|
||||
// hence these half-edges can't be coincident.
|
||||
continue;
|
||||
};
|
||||
let distances = distances.collect::<Vec<_>>();
|
||||
|
||||
// If all points on distinct curves are within
|
||||
// `distinct_min_distance`, that's a problem.
|
||||
if distances.all(|d| d < config.distinct_min_distance) {
|
||||
if distances.iter().all(|d| *d < config.distinct_min_distance) {
|
||||
let curves = [half_edge_a, half_edge_b]
|
||||
.map(|half_edge| half_edge.curve().clone());
|
||||
let vertices =
|
||||
@ -153,6 +157,7 @@ impl ValidationCheck<Shell> for CoincidentHalfEdgesAreNotSiblings {
|
||||
vertices,
|
||||
half_edge_a: half_edge_a.clone(),
|
||||
half_edge_b: half_edge_b.clone(),
|
||||
distances,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user