40 #include <boost/filesystem.hpp> 41 #include <gtest/gtest.h> 43 TEST(SphereBoundingSphere, Sphere1)
46 Eigen::Vector3d center;
56 TEST(SphereBoundingSphere, Sphere2)
59 Eigen::Vector3d center;
70 TEST(BoxBoundingSphere, Box1)
73 Eigen::Vector3d center;
83 TEST(BoxBoundingSphere, Box2)
86 Eigen::Vector3d center;
96 TEST(CylBoundingSphere, Cyl1)
99 Eigen::Vector3d center;
112 Eigen::Vector3d center;
122 TEST(ConeBoundingSphere, Cone1)
125 Eigen::Vector3d center;
135 TEST(ConeBoundingSphere, Cone2)
138 Eigen::Vector3d center;
148 TEST(ConeBoundingSphere, Cone3)
150 double height = 1.0 + 1.0 / sqrt(2);
152 Eigen::Vector3d center;
162 TEST(ConeBoundingSphere, Cone4)
165 Eigen::Vector3d center;
175 TEST(MeshBoundingSphere, Mesh1)
263 Eigen::Vector3d center;
273 int main(
int argc,
char** argv)
275 testing::InitGoogleTest(&argc, argv);
276 return RUN_ALL_TESTS();
Definition of a cylinder Length is along z axis. Origin is at center of mass.
TEST(SphereBoundingSphere, Sphere1)
unsigned int * triangles
The vertex indices for each triangle triangle k has vertices at index (3k, 3k+1, 3k+2) = (v1...
Definition of a cone Tip is on positive z axis. Center of base is on negative z axis. Origin is halway between tip and center of base.
A basic definition of a shape. Shapes are considered centered at origin.
double * vertices
The position for each vertex vertex k has values at index (3k, 3k+1, 3k+2) = (x,y,z)
int main(int argc, char **argv)
void computeShapeBoundingSphere(const Shape *shape, Eigen::Vector3d ¢er, double &radius)
Compute a sphere bounding a shape.
Definition of a triangle mesh By convention the "center" of the shape is at the origin. For a mesh this implies that the AABB of the mesh is centered at the origin. Some methods may not work with arbitrary meshes whose AABB is not centered at the origin.
Definition of a box Aligned with the XYZ axes.
#define EXPECT_TRUE(args)