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);
44 objVis.
write(
"Polyhedron_Triangle");
47 std::vector<Vector3D> rvertices = {
Vector3D(-1, -2, 0.),
Vector3D(1., -2, 0.),
50 std::vector<std::vector<size_t>> rfaces = {{0, 1, 2, 3}};
51 std::vector<std::vector<size_t>> rmesh = {{0, 1, 2}, {2, 3, 0}};
53 BOOST_CHECK(rvertices == rectangle.
vertices);
54 BOOST_CHECK(rfaces == rectangle.
faces);
58 objVis.
write(
"Polyhedron_Rectangle");
70 objVis.
write(
"Polyhedron_TriangleRectangle");
77 std::vector<Vector3D> rvertices = {
Vector3D(-1, -2, 0.),
Vector3D(1., -2, 0.),
81 std::vector<std::vector<size_t>> rfaces = {{0, 1, 2, 3}};
82 std::vector<std::vector<size_t>> rmesh = {{0, 1, 2}, {2, 3, 0}};
85 auto rExtent = rectangle.
extent();
99 Transform3D shiftedTransform = Transform3D::Identity();
100 shiftedTransform.pretranslate(shift);
101 rExtent = rectangle.
extent(shiftedTransform);
113 rectangle =
Polyhedron(rvertices, rfaces, rmesh);
114 rExtent = rectangle.
extent();
125 BOOST_AUTO_TEST_SUITE_END()