16 #ifndef SURGSIM_MATH_SURFACEMESHSHAPE_H
17 #define SURGSIM_MATH_SURFACEMESHSHAPE_H
63 template <
class VertexData,
class EdgeData,
class TriangleData>
66 double thickness = 1e-2);
75 std::shared_ptr<SurgSim::DataStructures::TriangleMesh>
getMesh();
79 virtual double getVolume()
const override;
105 virtual bool isValid()
const override;
123 std::shared_ptr<SurgSim::DataStructures::TriangleMesh>
m_mesh;
137 #endif // SURGSIM_MATH_SURFACEMESHSHAPE_H
Definition: DriveElementFromInputBehavior.cpp:27
std::shared_ptr< SurgSim::DataStructures::TriangleMesh > getMesh()
Get mesh.
Definition: SurfaceMeshShape.cpp:55
virtual Vector3d getCenter() const override
Get the volumetric center of the shape.
Definition: SurfaceMeshShape.cpp:70
std::string m_fileName
File name of the external file which contains the triangle mesh.
Definition: SurfaceMeshShape.h:129
SURGSIM_STATIC_REGISTRATION(BoxShape)
::SurgSim::Math::Vector3d Vector3d
Definition: Shape.h:62
virtual int getType() override
Definition: SurfaceMeshShape.cpp:37
SurfaceMeshShape()
Constructor.
Definition: SurfaceMeshShape.cpp:32
SurgSim::Math::Matrix33d m_secondMomentOfVolume
Second moment of volume.
Definition: SurfaceMeshShape.h:120
std::string getFileName() const
Get the file name of the external file which contains the triangle mesh.
Definition: SurfaceMeshShape.cpp:50
void computeVolumeIntegrals()
Compute useful volume integrals based on the triangle mesh, which are used to get the volume ...
Definition: SurfaceMeshShape.cpp:90
virtual double getVolume() const override
Get the volume of the shape.
Definition: SurfaceMeshShape.cpp:60
double m_volume
Volume (in m-3)
Definition: SurfaceMeshShape.h:117
double m_thickness
Surface mesh thickness.
Definition: SurfaceMeshShape.h:126
SURGSIM_CLASSNAME(SurgSim::Math::SurfaceMeshShape)
SurgSim::Math::Vector3d m_center
Center (considering a uniform distribution in the mesh volume)
Definition: SurfaceMeshShape.h:114
SurfaceMeshShape defines a shape based on a mesh, like MeshShape.
Definition: SurfaceMeshShape.h:53
Basic class for storing Triangle Meshes, handling basic vertex, edge, and triangle functionality...
Definition: TriangleMeshBase.h:58
void setFileName(const std::string &fileName)
Set loading filename.
Definition: SurfaceMeshShape.cpp:43
virtual Matrix33d getSecondMomentOfVolume() const override
Get the second central moment of the volume, commonly used to calculate the moment of inertia matrix...
Definition: SurfaceMeshShape.cpp:80
::SurgSim::Math::Matrix33d Matrix33d
Definition: Shape.h:63
Eigen::Matrix< double, 3, 3, Eigen::RowMajor > Matrix33d
A 3x3 matrix of doubles.
Definition: Matrix.h:51
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:56
std::shared_ptr< SurgSim::DataStructures::TriangleMesh > m_mesh
Collision mesh associated to this MeshShape.
Definition: SurfaceMeshShape.h:123
virtual bool isValid() const override
Check if this shape contains a valid mesh and the thickness is at least 1e-5 (in meter, to avoid formal and numerical issues).
Definition: SurfaceMeshShape.cpp:191
Generic rigid shape class defining a shape.
Definition: Shape.h:59