Ads tests for do_intersect(tet/tet)

This commit is contained in:
Maxime Gimeno 2020-08-21 12:17:50 +02:00
parent 3e50ea6081
commit a85e908e88
1 changed files with 21 additions and 1 deletions

View File

@ -22,7 +22,16 @@ int main()
{
Point p(0,0,0), q(10,0,0), r(10,10,0), s(0, 10,10);
Point p2(1,1,1), q2(20,20,20), r2(0,0,20);
Tetrahedron tet(p,q,r,s);
Tetrahedron tet(p,q,r,s),
tet2(p, Point(9,0,0), Point(15, 15, 0), Point(0, 15, 10)),
v_v(p,Point(-10,0,0),Point(-10,-10,0), Point(0,-10,-10)),
v_e(Point(-10,0,0), Point(0,0,10), Point(0,0,-10), Point(-10,10,0)),
v_f(Point(-10,0,0), Point(0,-10,-10), Point(0,-10,10), Point(0,10,0)),
e_e(Point(-10,0,0), Point(-15,0,0), Point(0,5,10), Point(0,10,5)),
e_f(Point(0,15,15), Point(-15,0,0), Point(0,-11,10), Point(0,10,-11)),
f_f(Point(10,10,10), q, r, s),
tet3(Point(-1,0,0), Point(-10,0,0), Point(-10,-10,0), Point(0,-10,-10));
Sphere sp(p2,1.0);
CGAL::do_intersect(tet,Triangle(p2,q2,r2));
@ -52,5 +61,16 @@ int main()
CGAL::do_intersect(Ray(p2,q2), sp);
CGAL::do_intersect(Segment(p2,q2), sp);
CGAL_assertion(CGAL::do_intersect(tet, v_e));
CGAL_assertion(CGAL::do_intersect(tet, v_f));
CGAL_assertion(CGAL::do_intersect(tet, v_v));
CGAL_assertion(CGAL::do_intersect(tet, tet2));
CGAL_assertion(CGAL::do_intersect(tet, e_e));
CGAL_assertion(CGAL::do_intersect(tet, e_f));
CGAL_assertion(CGAL::do_intersect(tet, f_f));
CGAL_assertion(!CGAL::do_intersect(tet, tet3));
return 0;
}