diff --git a/src/model_physics.rs b/src/model_physics.rs index 42bba83..c02e56c 100644 --- a/src/model_physics.rs +++ b/src/model_physics.rs @@ -578,19 +578,18 @@ impl MeshQuery for MinkowskiM //faces are listed backwards from the minkowski mesh let v0e=self.mesh0.vert_edges(v0); let &[e1f0,e1f1]=self.mesh1.edge_faces(e1).borrow(); - let e1f0_n=self.mesh0.face_nd(e1f0).0; - let e1f1_n=self.mesh0.face_nd(e1f1).0; - Cow::Owned([(e1f1,e1f1_n,true),(e1f0,e1f0_n,false)].map(|(edge_face_id1,edge_face_n,face_parity)|{ + Cow::Owned([(e1f1,true),(e1f0,false)].map(|(edge_face_id1,face_parity)|{ let mut best_edge=None; let mut best_d=Planar64::ZERO; - let edge_face_nn=edge_face_n.dot(edge_face_n); + let edge_face1_n=self.mesh1.face_nd(edge_face_id1).0; + let edge_face1_nn=edge_face1_n.dot(edge_face1_n); for &directed_edge_id0 in v0e.iter(){ let edge0_n=self.mesh0.directed_edge_n(directed_edge_id0); //must be behind other face. - let d=edge_face_n.dot(edge0_n); + let d=edge_face1_n.dot(edge0_n); if d for MinkowskiM //tracking index with an external variable because .enumerate() is not available let v1e=self.mesh1.vert_edges(v1); let &[e0f0,e0f1]=self.mesh0.edge_faces(e0).borrow(); - let e0f0_n=self.mesh0.face_nd(e0f0).0; - let e0f1_n=self.mesh0.face_nd(e0f1).0; - Cow::Owned([(e0f0,e0f0_n,true),(e0f1,e0f1_n,false)].map(|(edge_face_id0,edge_face_n,face_parity)|{ + Cow::Owned([(e0f0,true),(e0f1,false)].map(|(edge_face_id0,face_parity)|{ let mut best_edge=None; let mut best_d=Planar64::ZERO; - let edge_face_nn=edge_face_n.dot(edge_face_n); + let edge_face0_n=self.mesh0.face_nd(edge_face_id0).0; + let edge_face0_nn=edge_face0_n.dot(edge_face0_n); for &directed_edge_id1 in v1e.iter(){ let edge1_n=self.mesh1.directed_edge_n(directed_edge_id1); - let d=edge_face_n.dot(edge1_n); + let d=edge_face0_n.dot(edge1_n); if d