31 #ifndef TRIANGULAR_MESH_SHAPE_H 32 #define TRIANGULAR_MESH_SHAPE_H 34 #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING 45 #include <boost/filesystem.hpp> 46 namespace fs = boost::filesystem;
48 #include <experimental/filesystem> 49 namespace fs = std::experimental::filesystem;
60 explicit TriangleMeshShape(
const std::string &shape_name,
const SimTK::PolygonalMesh* mesh =
nullptr)
61 :
Shape(shape_name), triangle_mesh_(
nullptr){
63 triangle_mesh_ = generateTriangleMesh(*mesh);
67 virtual bool checkContain(
const Vec3d &pnt,
bool BOUNDARY_INCLUDED =
true)
override;
68 virtual Vec3d findClosestPoint(
const Vec3d &input_pnt)
override;
70 SimTK::ContactGeometry::TriangleMesh *getTriangleMesh() {
return triangle_mesh_; };
73 SimTK::ContactGeometry::TriangleMesh *triangle_mesh_;
76 SimTK::ContactGeometry::TriangleMesh *generateTriangleMesh(
const SimTK::PolygonalMesh &poly_mesh);
84 explicit TriangleMeshShapeSTL(
const std::string &file_path_name, Vec3d translation, Real scale_factor,
85 const std::string &shape_name =
"TriangleMeshShapeSTL");
87 explicit TriangleMeshShapeSTL(
const std::string &file_path_name, Mat3d rotation, Vec3d translation,
88 Real scale_factor,
const std::string &shape_name =
"TriangleMeshShapeSTL");
91 TriangleMeshShapeSTL(
const uint8_t* buffer, Vec3d translation, Real scale_factor,
const std::string &shape_name =
"TriangleMeshShapeSTL");
108 const std::string &shape_name =
"TriangleMeshShapeBrick");
110 const std::string &shape_name =
"TriangleMeshShapeBrick");
119 const std::string &shape_name =
"TriangleMeshShapeSphere");
127 explicit TriangleMeshShapeCylinder(SimTK::UnitVec3 axis, Real radius, Real halflength,
int resolution, Vec3d translation,
128 const std::string &shape_name =
"TriangleMeshShapeCylinder");
133 #endif //TRIANGULAR_MESH_SHAPE_H Definition: triangle_mesh_shape.h:96
Base class for all volumetric geometries Note that checkContain and findClosest point are basic funct...
Definition: base_geometry.h:64
Definition: triangle_mesh_shape.h:80
Definition: triangle_mesh_shape.h:123
Definition: triangle_mesh_shape.h:99
Definition: triangle_mesh_shape.h:54
virtual bool checkContain(const Vec3d &pnt, bool BOUNDARY_INCLUDED=true) override
Definition: triangle_mesh_shape.cpp:22
Shape is the base class for all geometries.
Definition: triangle_mesh_shape.h:114
Definition: solid_body_supplementary.cpp:9
file to include Simbody headers and suppress their warnings