Skip to content

Commit

Permalink
stop condition support layers
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Jul 20, 2024
1 parent ddeff94 commit 3a6c21b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl Mesh {
);

// Limit search to avoid an infinite loop.
for _ in 0..self.layers[0].polygons.len() * 1000 {
for _ in 0..self.layers.iter().map(|l| l.polygons.len()).sum::<usize>() * 100 {
match search_instance.next() {
InstanceStep::Found(path) => return Some(path),
InstanceStep::NotFound => return None,
Expand Down

0 comments on commit 3a6c21b

Please sign in to comment.