diff --git a/src/model_physics.rs b/src/model_physics.rs index 6c1cbbb..25ed516 100644 --- a/src/model_physics.rs +++ b/src/model_physics.rs @@ -964,12 +964,13 @@ fn is_empty_volume(normals:Vec>>)->bool{ for i in 0..len-1{ for j in i+1..len{ let n=normals[i].cross(normals[j]); - let mut d_comp:Option>=None; + let mut d_comp=None; for k in 0..len{ if k!=i&&k!=j{ - let d=n.dot(normals[k]); + let d=n.dot(normals[k]).is_negative(); if let Some(comp)=&d_comp{ - if comp.is_negative()^d.is_negative(){ + // This is testing if d_comp*d < 0 + if comp^d{ return true; } }else{