Skip to content

Commit

Permalink
Merge pull request #2416 from hannobraun/validate
Browse files Browse the repository at this point in the history
 Remove superfluous info from validation check
  • Loading branch information
hannobraun authored Jul 9, 2024
2 parents 3ba6cd8 + 9b90543 commit e020413
Showing 1 changed file with 3 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@ use crate::{

/// A [`Shell`] contains two [`HalfEdge`]s that are coincident but not siblings
///
/// Coincident half-edges must reference the same curve, and have the same
/// boundaries on that curve. This provides clear, topological information,
/// which is important to handle the shell geometry in a robust way.
/// Coincident half-edges must reference the same curve, and must have opposite
/// start and end vertices (i.e. the start vertex of one must be the end vertex
/// of the other, respectively).
#[derive(Clone, Debug, thiserror::Error)]
pub struct CoincidentHalfEdgesAreNotSiblings {
/// The boundaries of the half-edges
pub boundaries: [CurveBoundary<Point<1>>; 2],

/// The curves of the half-edges
pub curves: [Handle<Curve>; 2],

Expand All @@ -43,20 +40,6 @@ impl fmt::Display for CoincidentHalfEdgesAreNotSiblings {
siblings",
)?;

{
let [a, b] = &self.boundaries;

if a != &b.reverse() {
writeln!(
f,
"Boundaries don't match.\n\
\tHalf-edge 1 has boundary `{a:?}`\n\
\tHalf-edge 2 has boundary `{b:?}`\n\
\t(expecting same boundary, but reversed)"
)?;
}
}

{
let [a, b] = &self.curves;

Expand Down Expand Up @@ -139,10 +122,6 @@ impl ValidationCheck<Shell> for CoincidentHalfEdgesAreNotSiblings {
// If all points on distinct curves are within
// `distinct_min_distance`, that's a problem.
if distances.all(|d| d < config.distinct_min_distance) {
let boundaries =
[half_edge_a, half_edge_b].map(|half_edge| {
geometry.of_half_edge(half_edge).boundary
});
let curves = [half_edge_a, half_edge_b]
.map(|half_edge| half_edge.curve().clone());
let vertices =
Expand All @@ -155,7 +134,6 @@ impl ValidationCheck<Shell> for CoincidentHalfEdgesAreNotSiblings {
});

errors.push(CoincidentHalfEdgesAreNotSiblings {
boundaries,
curves,
vertices,
half_edge_a: half_edge_a.clone(),
Expand Down

0 comments on commit e020413

Please sign in to comment.