more degenerate cube tests
This commit is contained in:
parent
3f994ee2bb
commit
5b41aa94a7
@ -300,4 +300,34 @@ mod test{
|
|||||||
assert_eq!(faces.faces.len(),6);
|
assert_eq!(faces.faces.len(),6);
|
||||||
dbg!(faces);
|
dbg!(faces);
|
||||||
}
|
}
|
||||||
|
#[test]
|
||||||
|
fn test_cube_with_degernate_face2(){
|
||||||
|
let face_list=[
|
||||||
|
Face{normal:integer::vec3::X,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::Y,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::Z,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::NEG_X,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::NEG_Y,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::NEG_Z,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::NEG_X+integer::vec3::NEG_Z,dot:-Planar64::EPSILON},
|
||||||
|
].into_iter().collect();
|
||||||
|
let faces=planes_to_faces(face_list).unwrap();
|
||||||
|
assert_eq!(faces.faces.len(),5);
|
||||||
|
dbg!(faces);
|
||||||
|
}
|
||||||
|
#[test]
|
||||||
|
fn test_cube_with_degernate_face3(){
|
||||||
|
let face_list=[
|
||||||
|
Face{normal:integer::vec3::X,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::Y,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::Z,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::NEG_X,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::NEG_Y,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::NEG_Z,dot:Planar64::ONE},
|
||||||
|
Face{normal:integer::vec3::NEG_X+integer::vec3::NEG_Z,dot:Planar64::EPSILON},
|
||||||
|
].into_iter().collect();
|
||||||
|
let faces=planes_to_faces(face_list).unwrap();
|
||||||
|
assert_eq!(faces.faces.len(),7);
|
||||||
|
dbg!(faces);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user