add new tests

This commit is contained in:
Maxime Gimeno 2021-03-23 12:04:25 +01:00
parent 277117613b
commit f4da3182d7
3 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,37 @@
OFF
16 17 0
0 0 0
0.333333 0 0
0.666667 0 0
1 0 0
0 0.333333 0.333333
0.333333 0.333333 0.333333
0.666667 0.333333 0.333333
1 0.333333 0.333333
0 0.666667 0.666667
0.333333 0.666667 0.666667
0.666667 0.666667 0.666667
1 0.666667 0.666667
0 1 1
0.333333 1 1
0.666667 1 1
1 1 1
3 0 1 4
3 1 5 4
3 4 5 8
3 5 9 8
3 8 9 12
3 9 13 12
3 2 6 5
3 5 6 9
3 6 10 9
3 9 10 13
3 10 14 13
3 2 3 6
3 3 7 6
3 6 7 10
3 7 11 10
3 10 11 14
3 11 15 14

View File

@ -0,0 +1,38 @@
OFF
16 18 0
0 0 0
0.33333299999999999 0 0
0.66666700000000001 0 0
1 0 0
0 0.33333299999999999 0.33333299999999999
0.33333299999999999 0.33333299999999999 0.33333299999999999
0.67039400000000005 0.27928500000000001 0.33333299999999999
1 0.33333299999999999 0.33333299999999999
0 0.66666700000000001 0.66666700000000001
0.33333299999999999 0.66666700000000001 0.66666700000000001
0.66666700000000001 0.66666700000000001 0.66666700000000001
1 0.66666700000000001 0.66666700000000001
0 1 1
0.37796099999999999 1.08385 1
0.73563699999999999 1.01488 0.94896599999999998
0.96348599999999995 1.0906100000000001 1
3 4 1 0
3 4 5 1
3 8 5 4
3 8 9 5
3 12 9 8
3 12 13 9
3 5 2 1
3 5 6 2
3 9 6 5
3 9 10 6
3 13 10 9
3 13 14 10
3 6 3 2
3 6 7 3
3 10 7 6
3 10 11 7
3 14 11 10
3 14 15 11

View File

@ -284,6 +284,63 @@ void test_compare()
assert(fim2[m2_only[0]] == 0); assert(fim2[m2_only[0]] == 0);
assert(fim2[m2_only[1]] == 3); assert(fim2[m2_only[1]] == 3);
assert(fim2[m2_only[2]] == 4); assert(fim2[m2_only[2]] == 4);
/*************************
**** tri and hole****
* **********************/
CGAL::clear(mesh1);
CGAL::clear(mesh2);
common.clear();
m1_only.clear();
m2_only.clear();
input.open("data/tri1.off");
if(! (input >> mesh1))
{
std::cerr << "Invalid input." << std::endl;
assert (false);
return;
}
input.close();
input.open("data/tri1-hole.off");
if(! (input >> mesh2))
{
std::cerr << "Invalid input." << std::endl;
assert (false);
return;
}
input.close();
PMP::compare_meshes(mesh1, mesh2, std::back_inserter(common), std::back_inserter(m1_only), std::back_inserter(m2_only), CGAL::parameters::all_default(), CGAL::parameters::all_default());
assert(common.size() == 17);
assert(m1_only.size() == 1);
assert(m2_only.size() == 0);
/*************************
**** tri and orient****
* **********************/
CGAL::clear(mesh1);
CGAL::clear(mesh2);
common.clear();
m1_only.clear();
m2_only.clear();
input.open("data/tri2.off");
if(! (input >> mesh1))
{
std::cerr << "Invalid input." << std::endl;
assert (false);
return;
}
input.close();
input.open("data/tri2-out.off");
if(! (input >> mesh2))
{
std::cerr << "Invalid input." << std::endl;
assert (false);
return;
}
input.close();
PMP::compare_meshes(mesh1, mesh2, std::back_inserter(common), std::back_inserter(m1_only), std::back_inserter(m2_only), CGAL::parameters::require_same_orientation(true), CGAL::parameters::all_default());
assert(common.size() == 0);
assert(m1_only.size() == 18);
assert(m2_only.size() == 18);
} }