9 #include <boost/test/unit_test.hpp>
25 namespace tt = boost::test_tools;
30 BOOST_AUTO_TEST_SUITE(Volumes)
35 TrapezoidVolumeBounds tvb(5, 10, 8, 4);
37 auto bb = tvb.boundingBox();
45 bb = tvb.boundingBox(&trf);
51 bb = tvb.boundingBox(&trf);
60 BOOST_CHECK_EQUAL(tvbOrientedSurfaces.size(), 6);
64 for (
auto&
os : tvbOrientedSurfaces) {
65 auto osCenter =
os.first->center(geoCtx);
66 auto osNormal =
os.first->normal(geoCtx, osCenter);
68 Vector3 insideTvb = osCenter +
os.second * osNormal;
69 Vector3 outsideTvb = osCenter -
os.second * osNormal;
70 BOOST_CHECK(tvb.
inside(insideTvb));
71 BOOST_CHECK(!tvb.
inside(outsideTvb));
80 tvbOrientedSurfaces[
negativeFaceXY].first->transform(geoCtx).rotation();
81 BOOST_CHECK(nFaceXY.col(0).isApprox(xaxis));
82 BOOST_CHECK(nFaceXY.col(1).isApprox(yaxis));
83 BOOST_CHECK(nFaceXY.col(2).isApprox(zaxis));
86 tvbOrientedSurfaces[
positiveFaceXY].first->transform(geoCtx).rotation();
87 BOOST_CHECK(pFaceXY.col(0).isApprox(xaxis));
88 BOOST_CHECK(pFaceXY.col(1).isApprox(yaxis));
89 BOOST_CHECK(pFaceXY.col(2).isApprox(zaxis));
92 tvbOrientedSurfaces[
negativeFaceZX].first->transform(geoCtx).rotation();
93 BOOST_CHECK(nFaceZX.col(0).isApprox(zaxis));
94 BOOST_CHECK(nFaceZX.col(1).isApprox(xaxis));
95 BOOST_CHECK(nFaceZX.col(2).isApprox(yaxis));
98 tvbOrientedSurfaces[
positiveFaceZX].first->transform(geoCtx).rotation();
99 BOOST_CHECK(pFaceZX.col(0).isApprox(zaxis));
100 BOOST_CHECK(pFaceZX.col(1).isApprox(xaxis));
101 BOOST_CHECK(pFaceZX.col(2).isApprox(yaxis));
104 BOOST_AUTO_TEST_SUITE_END()