From 3a6c21b419864c0a65e48385c75b447743a2dd0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 20 Jul 2024 02:53:04 +0200 Subject: [PATCH] stop condition support layers --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 0e62fe7..50331a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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::() * 100 { match search_instance.next() { InstanceStep::Found(path) => return Some(path), InstanceStep::NotFound => return None,