Skip to content

Commit

Permalink
Merge pull request #1139 from hannobraun/ready/error
Browse files Browse the repository at this point in the history
Improve edge validation panic messages
  • Loading branch information
hannobraun authored Sep 26, 2022
2 parents e978f23 + e010a57 commit caeeb67
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions crates/fj-kernel/src/objects/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,17 @@ impl HalfEdge {
}

// Make sure `curve` and `vertices` match `global_form`.
assert_eq!(curve.global_form(), global_form.curve());
assert_eq!(
curve.global_form(),
global_form.curve(),
"The global form of a half-edge's curve must match the curve of \
the half-edge's global form"
);
assert_eq!(
&vertices.clone().map(|vertex| *vertex.global_form()),
global_form.vertices()
global_form.vertices(),
"The global forms of a half-edge's vertices must match the \
vertices of the half-edge's global form"
);

// Make sure that the edge vertices are not coincident on the curve.
Expand Down

0 comments on commit caeeb67

Please sign in to comment.