9 #include <boost/test/data/test_case.hpp>
10 #include <boost/test/tools/output_test_stream.hpp>
11 #include <boost/test/unit_test.hpp>
29 using namespace UnitLiterals;
33 BOOST_AUTO_TEST_SUITE(Geometry)
37 std::vector<Vector3> tvertices = {
Vector3(-1, -1, 0.),
Vector3(1., -1, 0.),
39 std::vector<std::vector<size_t>> tfaces = {{0, 1, 2}};
41 Polyhedron triangle(tvertices, tfaces, tfaces);
42 BOOST_CHECK(tvertices == triangle.
vertices);
43 BOOST_CHECK(tfaces == triangle.
faces);
48 objVis.
write(
"Polyhedron_Triangle");
51 std::vector<Vector3> rvertices = {
Vector3(-1, -2, 0.),
Vector3(1., -2, 0.),
54 std::vector<std::vector<size_t>> rfaces = {{0, 1, 2, 3}};
55 std::vector<std::vector<size_t>> rmesh = {{0, 1, 2}, {2, 3, 0}};
57 BOOST_CHECK(rvertices == rectangle.
vertices);
58 BOOST_CHECK(rfaces == rectangle.
faces);
62 objVis.
write(
"Polyhedron_Rectangle");
74 objVis.
write(
"Polyhedron_TriangleRectangle");
81 std::vector<Vector3> rvertices = {
Vector3(-1, -2, 0.),
Vector3(1., -2, 0.),
85 std::vector<std::vector<size_t>> rfaces = {{0, 1, 2, 3}};
86 std::vector<std::vector<size_t>> rmesh = {{0, 1, 2}, {2, 3, 0}};
89 auto rExtent = rectangle.
extent();
103 Transform3 shiftedTransform = Transform3::Identity();
104 shiftedTransform.pretranslate(shift);
105 rExtent = rectangle.
extent(shiftedTransform);
114 rvertices = {
Vector3(3_mm, -5_mm, -10_mm),
Vector3(3_mm, 5_mm, -10_mm),
117 rectangle =
Polyhedron(rvertices, rfaces, rmesh);
118 rExtent = rectangle.
extent();
129 BOOST_AUTO_TEST_SUITE_END()