26#ifndef TESSERACT_GEOMETRY_SDF_MESH_H
27#define TESSERACT_GEOMETRY_SDF_MESH_H
31#include <boost/serialization/access.hpp>
32#include <boost/serialization/export.hpp>
33#include <Eigen/Geometry>
47 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
50 using Ptr = std::shared_ptr<SDFMesh>;
51 using ConstPtr = std::shared_ptr<const SDFMesh>;
67 SDFMesh(std::shared_ptr<const tesseract_common::VectorVector3d> vertices,
68 std::shared_ptr<const Eigen::VectorXi> triangles,
70 const Eigen::Vector3d&
scale = Eigen::Vector3d(1, 1, 1),
71 std::shared_ptr<const tesseract_common::VectorVector3d> normals =
nullptr,
72 std::shared_ptr<const tesseract_common::VectorVector4d> vertex_colors =
nullptr,
74 std::shared_ptr<
const std::vector<MeshTexture::Ptr>> mesh_textures =
nullptr)
80 std::move(vertex_colors),
81 std::move(mesh_material),
82 std::move(mesh_textures),
86 std::throw_with_nested(std::runtime_error(
"Mesh is not triangular"));
104 SDFMesh(std::shared_ptr<const tesseract_common::VectorVector3d> vertices,
105 std::shared_ptr<const Eigen::VectorXi> triangles,
108 const Eigen::Vector3d&
scale = Eigen::Vector3d(1, 1, 1),
109 std::shared_ptr<const tesseract_common::VectorVector3d> normals =
nullptr,
110 std::shared_ptr<const tesseract_common::VectorVector4d> vertex_colors =
nullptr,
112 std::shared_ptr<
const std::vector<MeshTexture::Ptr>> mesh_textures =
nullptr)
114 std::move(triangles),
119 std::move(vertex_colors),
120 std::move(mesh_material),
121 std::move(mesh_textures),
125 std::throw_with_nested(std::runtime_error(
"Mesh is not triangular"));
141 template <
class Archive>
142 void serialize(Archive& ar,
const unsigned int version);
std::shared_ptr< const Resource > ConstPtr
Definition: resource_locator.h:102
std::shared_ptr< Resource > Ptr
Definition: resource_locator.h:101
std::shared_ptr< Geometry > Ptr
Definition: geometry.h:62
std::shared_ptr< MeshMaterial > Ptr
Definition: mesh_material.h:63
Definition: polygon_mesh.h:46
const std::shared_ptr< const Eigen::VectorXi > & getFaces() const
Get Polygon mesh faces.
Definition: polygon_mesh.h:152
int getFaceCount() const
Get face count.
Definition: polygon_mesh.h:164
tesseract_common::Resource::ConstPtr getResource() const
Get the path to file used to generate the mesh.
Definition: polygon_mesh.h:173
const std::shared_ptr< const tesseract_common::VectorVector3d > & getVertices() const
Get Polygon mesh vertices.
Definition: polygon_mesh.h:146
const Eigen::Vector3d & getScale() const
Get the scale applied to file used to generate the mesh.
Definition: polygon_mesh.h:179
Definition: sdf_mesh.h:44
std::shared_ptr< SDFMesh > Ptr
Definition: sdf_mesh.h:50
bool operator==(const SDFMesh &rhs) const
Definition: sdf_mesh.cpp:38
bool operator!=(const SDFMesh &rhs) const
Definition: sdf_mesh.cpp:44
Geometry::Ptr clone() const override
Create a copy of this shape.
Definition: sdf_mesh.h:131
std::shared_ptr< const SDFMesh > ConstPtr
Definition: sdf_mesh.h:51
SDFMesh(std::shared_ptr< const tesseract_common::VectorVector3d > vertices, std::shared_ptr< const Eigen::VectorXi > triangles, tesseract_common::Resource::Ptr resource=nullptr, const Eigen::Vector3d &scale=Eigen::Vector3d(1, 1, 1), std::shared_ptr< const tesseract_common::VectorVector3d > normals=nullptr, std::shared_ptr< const tesseract_common::VectorVector4d > vertex_colors=nullptr, MeshMaterial::Ptr mesh_material=nullptr, std::shared_ptr< const std::vector< MeshTexture::Ptr > > mesh_textures=nullptr)
SDF Mesh geometry.
Definition: sdf_mesh.h:67
SDFMesh(std::shared_ptr< const tesseract_common::VectorVector3d > vertices, std::shared_ptr< const Eigen::VectorXi > triangles, int triangle_count, tesseract_common::Resource::ConstPtr resource=nullptr, const Eigen::Vector3d &scale=Eigen::Vector3d(1, 1, 1), std::shared_ptr< const tesseract_common::VectorVector3d > normals=nullptr, std::shared_ptr< const tesseract_common::VectorVector4d > vertex_colors=nullptr, MeshMaterial::Ptr mesh_material=nullptr, std::shared_ptr< const std::vector< MeshTexture::Ptr > > mesh_textures=nullptr)
SDF Mesh geometry.
Definition: sdf_mesh.h:104
friend class boost::serialization::access
Definition: sdf_mesh.h:140
~SDFMesh() override=default
void serialize(Archive &ar, const unsigned int version)
Definition: sdf_mesh.cpp:47
double scale
Definition: collision_margin_data_unit.cpp:133
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Tesseract Mesh Material read from a mesh file.
Definition: create_convex_hull.cpp:36
Definition: geometry.h:39
GeometryType
Definition: geometry.h:41
@ SDF_MESH
Definition: geometry.h:51
Tesseract Polygon Mesh Geometry.
Resource::Ptr resource
Definition: resource_locator_unit.cpp:59