From e47b1ff6f9558f432d06cecef8c4414987ae8538 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 22 Aug 2024 13:58:05 -0700 Subject: [PATCH] fix algorithm --- src/push_solve.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/push_solve.rs b/src/push_solve.rs index c0daa34..d7495f4 100644 --- a/src/push_solve.rs +++ b/src/push_solve.rs @@ -292,7 +292,10 @@ fn get_first_touch<'a>(contacts:&'a Vec,ray:&Ray,conts:&Conts)->Option< pub fn push_solve(contacts:&Vec,point:Planar64Vec3)->Option{ let (mut ray,mut conts)=get_best_push_ray_and_conts_0(point)?; loop{ - let (next_t,next_cont)=get_first_touch(contacts,&ray,&conts)?; + let (next_t,next_cont)=match get_first_touch(contacts,&ray,&conts){ + Some((t,conts))=>(t,conts), + None=>return Some(ray.origin), + }; if Planar64::ZERO<=next_t{ return Some(ray.origin);