Skip to content
Snippets Groups Projects
Commit edeec221 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[test][common] test point-triangle intersection for small eps

parent 3ac68c4e
1 merge request!2429Feature/extend instersectpointsimplex test
......@@ -62,6 +62,8 @@ void testIntersections(std::vector<bool>& returns)
returns.push_back(testIntersection(a, b, p4));
returns.push_back(testIntersection(a, b, p5));
returns.push_back(testIntersection(a, b, p6));
// test cases where the point is just on or just outside the segment
returns.push_back(testIntersection(a, b, p7));
returns.push_back(testIntersection(a, b, p8));
returns.push_back(testIntersection(a, b, p9, true));
......
......@@ -45,6 +45,10 @@ void runIntersectionTest(std::vector<bool>& returns, const Transformation& trans
returns.push_back(testIntersection(triangle, transform({0.5, 0.51}), false, verbose));
returns.push_back(testIntersection(triangle, transform({0.0, -0.01}), false, verbose));
// test cases where the point is just inside or just outside the triangle
returns.push_back(testIntersection(triangle, transform({0.0, -1.5e-7}), false, verbose));
returns.push_back(testIntersection(triangle, transform({1.0+1.5e-7, 1.5e-7}), false, verbose));
// test quadrilateral-point intersections
if (verbose) std::cout << "\n -- Test quadrilateral-point intersections" << std::endl;
......@@ -64,6 +68,9 @@ void runIntersectionTest(std::vector<bool>& returns, const Transformation& trans
returns.push_back(testIntersection(quadrilateral, transform({0.5, 1.01}), false, verbose));
returns.push_back(testIntersection(quadrilateral, transform({0.0, -0.01}), false, verbose));
// test cases where the point is just inside or just outside the triangle
returns.push_back(testIntersection(quadrilateral, transform({0.0, -1.5e-7}), false, verbose));
returns.push_back(testIntersection(quadrilateral, transform({1.0+1.5e-7, 1.5e-7}), false, verbose));
}
template<class Transformation>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment