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);