This commit is contained in:
Quaternions 2023-11-17 15:00:25 -08:00
parent 4be218defb
commit 1a250fe8d6

View File

@ -518,17 +518,15 @@ impl MeshQuery<MinkowskiFace,MinkowskiDirectedEdge,MinkowskiVert> for MinkowskiM
match vert_id{ match vert_id{
MinkowskiVert::VertVert(v0,v1)=>{ MinkowskiVert::VertVert(v0,v1)=>{
let mut edges=Vec::new(); let mut edges=Vec::new();
let v0e=self.mesh0.vert_edges(v0);
let v1f=self.mesh1.vert_faces(v1); let v1f=self.mesh1.vert_faces(v1);
for &directed_edge_id in v0e.iter(){ for &directed_edge_id in self.mesh0.vert_edges(v0).iter(){
let n=self.mesh0.directed_edge_n(directed_edge_id); let n=self.mesh0.directed_edge_n(directed_edge_id);
if v1f.iter().any(|&face_id|n.dot(self.mesh1.face_nd(face_id).0)<Planar64::ZERO){ if v1f.iter().any(|&face_id|n.dot(self.mesh1.face_nd(face_id).0)<Planar64::ZERO){
edges.push(MinkowskiDirectedEdge::EdgeVert(directed_edge_id,v1)); edges.push(MinkowskiDirectedEdge::EdgeVert(directed_edge_id,v1));
} }
} }
let v1e=self.mesh1.vert_edges(v1);
let v0f=self.mesh0.vert_faces(v0); let v0f=self.mesh0.vert_faces(v0);
for &directed_edge_id in v1e.iter(){ for &directed_edge_id in self.mesh1.vert_edges(v1).iter(){
let n=self.mesh1.directed_edge_n(directed_edge_id); let n=self.mesh1.directed_edge_n(directed_edge_id);
if v0f.iter().any(|&face_id|n.dot(self.mesh0.face_nd(face_id).0)<Planar64::ZERO){ if v0f.iter().any(|&face_id|n.dot(self.mesh0.face_nd(face_id).0)<Planar64::ZERO){
edges.push(MinkowskiDirectedEdge::VertEdge(v0,directed_edge_id)); edges.push(MinkowskiDirectedEdge::VertEdge(v0,directed_edge_id));