9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
25 using namespace UnitLiterals;
29 BOOST_AUTO_TEST_SUITE(Geometry)
33 std::vector<Vector3D> tvertices = {
Vector3D(-1, -1, 0.),
Vector3D(1., -1, 0.),
35 std::vector<std::vector<size_t>> tfaces = {{0, 1, 2}};
37 Polyhedron triangle(tvertices, tfaces, tfaces);
38 BOOST_CHECK(tvertices == triangle.
vertices);
39 BOOST_CHECK(tfaces == triangle.
faces);
42 std::ofstream tStream;
43 tStream.open(
"PolyhedronTriangle.obj");
49 std::vector<Vector3D> rvertices = {
Vector3D(-1, -2, 0.),
Vector3D(1., -2, 0.),
52 std::vector<std::vector<size_t>> rfaces = {{0, 1, 2, 3}};
53 std::vector<std::vector<size_t>> rmesh = {{0, 1, 2}, {2, 3, 0}};
55 BOOST_CHECK(rvertices == rectangle.
vertices);
56 BOOST_CHECK(rfaces == rectangle.
faces);
59 std::ofstream rStream;
60 rStream.open(
"PolyhedronRectangle.obj");
62 rectangle.
draw(objrH);
75 std::ofstream trStream;
76 trStream.open(
"PolyhedronTriangleRectangle.obj");
79 objtrH.
write(trStream);
85 std::vector<Vector3D> rvertices = {
Vector3D(-1, -2, 0.),
Vector3D(1., -2, 0.),
89 std::vector<std::vector<size_t>> rfaces = {{0, 1, 2, 3}};
90 std::vector<std::vector<size_t>> rmesh = {{0, 1, 2}, {2, 3, 0}};
93 auto rExtent = rectangle.
extent();
107 Transform3D shiftedTransform = Transform3D::Identity();
108 shiftedTransform.pretranslate(shift);
109 rExtent = rectangle.
extent(shiftedTransform);
118 BOOST_AUTO_TEST_SUITE_END()