Skip to content

Commit 01f6983

Browse files
authored
Merge pull request #161 from mockersf/panic-trimesh-intersection-plane
intersection_with_plane: insert adjacencies in the correct order
2 parents aefe2a6 + 01d43db commit 01f6983

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/query/split/split_trimesh.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,13 @@ impl TriMesh {
429429
}
430430
};
431431
let mut add_segment_adjacencies_symmetric = |idx_a: usize, idx_b| {
432-
add_segment_adjacencies(idx_a, idx_b);
433-
add_segment_adjacencies(idx_b, idx_a);
432+
if idx_a < idx_b {
433+
add_segment_adjacencies(idx_a, idx_b);
434+
add_segment_adjacencies(idx_b, idx_a);
435+
} else {
436+
add_segment_adjacencies(idx_b, idx_a);
437+
add_segment_adjacencies(idx_a, idx_b);
438+
}
434439
};
435440

436441
let mut intersections_found = HashMap::default();

0 commit comments

Comments
 (0)