40 #include <boost/filesystem.hpp>
41 #include <gtest/gtest.h>
42 #include "resources/config.h"
63 "file://" + (boost::filesystem::path(TEST_RESOURCES_DIR) /
"/cube.stl").
string()));
98 for (
size_t i = 0; i < shape_meshes.size(); ++i)
105 for (
int i = 0; i < 100; ++i)
113 EXPECT_TRUE(found) <<
"No point inside the meshes was found (very unlikely)";
120 for (
size_t i = 0; i < shape_meshes.size(); ++i)
125 bool intersects =
false;
126 for (
int i = 0; i < 100; ++i)
128 Eigen::Vector3d ray_o(rng.uniformReal(-1.0, +1.0), rng.uniformReal(-1.0, +1.0), rng.uniformReal(-1.0, +1.0));
129 Eigen::Vector3d ray_d(rng.uniformReal(-1.0, +1.0), rng.uniformReal(-1.0, +1.0), rng.uniformReal(-1.0, +1.0));
143 if (!vi1.empty() && !vi2.empty())
153 EXPECT_TRUE(intersects) <<
"No ray intersects the meshes (very unlikely)";
160 for (
size_t i = 0; i < shape_meshes.size(); ++i)
166 Eigen::Vector3d center1, center2;
167 double radius1, radius2;
184 EXPECT_EQ(shape_meshes.back()->vertex_count, loaded_meshes.back()->vertex_count);
189 EXPECT_EQ(shape_meshes.back()->triangle_count, loaded_meshes.back()->triangle_count);
192 int main(
int argc,
char** argv)
194 testing::InitGoogleTest(&argc, argv);
195 return RUN_ALL_TESTS();