optimize is_empty_volume
This commit is contained in:
parent
f280b65fc9
commit
0150bb977d
@ -964,12 +964,13 @@ fn is_empty_volume(normals:Vec<Vector3<Fixed<3,96>>>)->bool{
|
|||||||
for i in 0..len-1{
|
for i in 0..len-1{
|
||||||
for j in i+1..len{
|
for j in i+1..len{
|
||||||
let n=normals[i].cross(normals[j]);
|
let n=normals[i].cross(normals[j]);
|
||||||
let mut d_comp:Option<Fixed<9,{96*3}>>=None;
|
let mut d_comp=None;
|
||||||
for k in 0..len{
|
for k in 0..len{
|
||||||
if k!=i&&k!=j{
|
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 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;
|
return true;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
Loading…
Reference in New Issue
Block a user