From 3d426c0859ad77ccca65d61a2fff8206d131341e Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 23 Nov 2023 17:12:49 -0800 Subject: [PATCH] TEMP: fail after 10 iterations --- src/face_crawler.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/face_crawler.rs b/src/face_crawler.rs index 0a50370..e454629 100644 --- a/src/face_crawler.rs +++ b/src/face_crawler.rs @@ -107,11 +107,12 @@ pub enum CrawlResult{ } pub fn crawl_fev(mut fev:FEV,mesh:&impl MeshQuery,relative_body:&Body,start_time:Time,time_limit:Time)->CrawlResult{ let mut time=start_time; - loop{ + for _ in 0..10{ match next_transition(&fev,time,mesh,relative_body,time_limit){ Transition::Miss=>return CrawlResult::Miss(fev), Transition::Next(next_fev,next_time)=>(fev,time)=(next_fev,next_time), Transition::Hit(face,time)=>return CrawlResult::Hit(face,time), } } + panic!("Too many iterations!"); }