Skip to content
Snippets Groups Projects
Commit abba6aab authored by Aaron Grabowy's avatar Aaron Grabowy
Browse files

Added tests for inf_cone and inf_cylinder

parent 2b6a6a24
No related branches found
No related tags found
1 merge request!40Tests for ray/line - object intersections
Pipeline #15908 failed
typed-geometry @ 05a25760
Subproject commit b2642eb7a1630106a71bf50e46ba6599830e226b Subproject commit 05a25760acd58e2a87d3627a2f6d3d9f40ecc95e
...@@ -100,6 +100,7 @@ TG_FUZZ_TEST(TypedGeometry, Intersections) ...@@ -100,6 +100,7 @@ TG_FUZZ_TEST(TypedGeometry, Intersections)
const auto r = uniform(rng, 0.0f, 10.0f); const auto r = uniform(rng, 0.0f, 10.0f);
const auto h = uniform(rng, 0.0f, 10.0f); const auto h = uniform(rng, 0.0f, 10.0f);
const auto a = uniform(rng, 5_deg, 180_deg); // sensible range for a convex inf_cone
const auto n1 = tg::uniform<tg::dir1>(rng); const auto n1 = tg::uniform<tg::dir1>(rng);
const auto n2 = tg::uniform<tg::dir2>(rng); const auto n2 = tg::uniform<tg::dir2>(rng);
const auto n3 = tg::uniform<tg::dir3>(rng); const auto n3 = tg::uniform<tg::dir3>(rng);
...@@ -168,6 +169,8 @@ TG_FUZZ_TEST(TypedGeometry, Intersections) ...@@ -168,6 +169,8 @@ TG_FUZZ_TEST(TypedGeometry, Intersections)
test_obj_and_boundary(ray3, tg::capsule3(axis0, r)); test_obj_and_boundary(ray3, tg::capsule3(axis0, r));
// cylinder // cylinder
test_obj_and_boundary_no_caps(ray3, tg::cylinder<3, float>(axis0, r)); test_obj_and_boundary_no_caps(ray3, tg::cylinder<3, float>(axis0, r));
// ellipse
test_obj(ray3, tg::ellipse2in3(pos30, m23));
// halfspace // halfspace
test_solid_obj(ray1, tg::halfspace1(n1, h)); test_solid_obj(ray1, tg::halfspace1(n1, h));
test_solid_obj(ray2, tg::halfspace2(n2, h)); test_solid_obj(ray2, tg::halfspace2(n2, h));
...@@ -178,8 +181,12 @@ TG_FUZZ_TEST(TypedGeometry, Intersections) ...@@ -178,8 +181,12 @@ TG_FUZZ_TEST(TypedGeometry, Intersections)
test_obj_and_boundary_no_caps(ray2, tg::hemisphere2(pos20, r, n2)); test_obj_and_boundary_no_caps(ray2, tg::hemisphere2(pos20, r, n2));
test_obj_and_boundary_no_caps(ray3, tg::hemisphere3(pos30, r, n3)); test_obj_and_boundary_no_caps(ray3, tg::hemisphere3(pos30, r, n3));
// test_obj_and_boundary_no_caps(ray4, tg::hemisphere4(pos40, r, n4)); // test_obj_and_boundary_no_caps(ray4, tg::hemisphere4(pos40, r, n4));
// inf_cone
test_obj_and_boundary(ray2, tg::inf_cone2(pos20, n2, a));
test_obj_and_boundary(ray3, tg::inf_cone3(pos30, n3, a));
// inf_cylinder // inf_cylinder
test_obj_and_boundary(ray2, tg::inf_cylinder<2, float>(tg::line2(pos20, n2), r)); test_obj_and_boundary(ray2, tg::inf_cylinder2(tg::line2(pos20, n2), r));
test_obj_and_boundary(ray3, tg::inf_cylinder3(tg::line3(pos30, n3), r));
// line // line
test_obj(ray2, tg::line2(pos20, n2)); test_obj(ray2, tg::line2(pos20, n2));
// plane // plane
......
...@@ -103,8 +103,10 @@ TG_FUZZ_TEST(TypedGeometry, AnyPoint) ...@@ -103,8 +103,10 @@ TG_FUZZ_TEST(TypedGeometry, AnyPoint)
test_obj_and_boundary_no_caps(tg::hemisphere3(pos30, r, n3)); test_obj_and_boundary_no_caps(tg::hemisphere3(pos30, r, n3));
// test_obj_and_boundary_no_caps(tg::hemisphere4(pos40, r, n4)); // test_obj_and_boundary_no_caps(tg::hemisphere4(pos40, r, n4));
// inf_cone // inf_cone
test_obj_and_boundary(tg::inf_cone2(pos20, n2, a));
test_obj_and_boundary(tg::inf_cone3(pos30, n3, a)); test_obj_and_boundary(tg::inf_cone3(pos30, n3, a));
// inf_cylinder // inf_cylinder
test_obj_and_boundary(tg::inf_cylinder2(tg::line2(pos20, n2), r));
test_obj_and_boundary(tg::inf_cylinder3(tg::line3(pos30, n3), r)); test_obj_and_boundary(tg::inf_cylinder3(tg::line3(pos30, n3), r));
// line // line
test_obj(tg::line1(pos10, n1)); test_obj(tg::line1(pos10, n1));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment