Skip to content

Commit

Permalink
Merge pull request #1981 from hannobraun/join
Browse files Browse the repository at this point in the history
Improve panic messages in join operation
  • Loading branch information
hannobraun authored Aug 2, 2023
2 parents d36cfff + 4298e1f commit 1c05a08
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/fj-core/src/operations/join/cycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ impl JoinCycle for Cycle {
) -> Self {
assert_eq!(
range.end() - range.start(),
range_other.end() - range_other.start()
range_other.end() - range_other.start(),
"Ranges have different lengths",
);

let mut cycle = self.clone();
Expand All @@ -107,14 +108,14 @@ impl JoinCycle for Cycle {

let vertex_a = other
.half_edge_after(half_edge_other)
.expect("Expected other cycle to contain edge")
.expect("Cycle must contain edge; just obtained edge from it")
.start_vertex()
.clone();
let vertex_b = half_edge_other.start_vertex().clone();

let next_edge = cycle
.half_edge_after(half_edge)
.expect("Expected this cycle to contain edge");
.expect("Cycle must contain edge; just obtained edge from it");

let this_joined = half_edge
.replace_curve(half_edge_other.curve().clone())
Expand Down

0 comments on commit 1c05a08

Please sign in to comment.