178 void SetSize(
double d)
override;
366 void Print()
override;
396 void UpdateVerticesNeighs();
405 void UpdateLinkedVertices();
417 void UpdateLinkedVerticesSub(
int vid);
439 void SortNormalPatchVertices(
VecXT<Vec3d> *
const normals);
487 bool Find(
const VecXT<int> &vert_id_list,
int id);
Class for computing signed distance fields from triangle meshes.
Definition sdf_calculator.hpp:20
Class for working with STL models.
Definition stl_model.hpp:17
This class represents different types of shapes and performs various calculations on them.
Definition shape.hpp:15
A class representing a triangular mesh in 3D space.
Definition shape_trimesh.hpp:23
void MakeConvex()
Make the TriMesh object convex.
Definition shape_trimesh.cpp:128
void InitFromSTL(std::string const &file)
Initialize the TriMesh object from an STL file.
void UpdateShapeProperties() override
Update the shape properties of the TriMesh object.
Definition shape_trimesh.cpp:158
double SignedDistance(Vec3d const &pos) const override
Calculate the signed distance from a point to the TriMesh object.
Definition shape_trimesh.cpp:513
VecXT< VecXT< int > > vertices_neighs
The neighboring vertices of each vertex for hill climbing support point calculation.
Definition shape_trimesh.hpp:39
void SaveNormalPatchesCubic(std::string const &file)
Save cubic normal patches for the TriMesh object to a file.
Definition shape_trimesh.cpp:588
VecXT< Vec3d > SupportPoints_Sweep(Vec3d const &dir)
Calculate the support points of the TriMesh object using the sweeping algorithm in the specified dire...
Definition shape_trimesh.cpp:358
bool use_linked_patches
Flag indicating whether to use the linked-patches algorithm for support point calculation.
Definition shape_trimesh.hpp:45
void InitFromJson(nlohmann::json const &js) override
Initialize the TriMesh object from a JSON structure.
Definition shape_trimesh.cpp:27
void Init()
Initialize the TriMesh object.
Definition shape_trimesh.cpp:65
Vec3d SupportPoint_LinkedVertices(Vec3d const &dir)
Calculate the support point of the TriMesh object using the linked-patches algorithm in the specified...
Definition shape_trimesh.cpp:390
SDFCalculator sdf_calculator
The signed distance function calculator for the TriMesh object.
Definition shape_trimesh.hpp:61
void Decimate(int num_nodes)
Decimate the TriMesh object.
Definition shape_trimesh.cpp:121
bool enable_debugging
Flag indicating whether to output debugging data.
Definition shape_trimesh.hpp:66
nlohmann::json PackJson() override
Pack the TriMesh object into a JSON structure.
Definition shape_trimesh.cpp:15
Vec3d SupportPoint_Sweep(Vec3d const &dir)
Calculate the support point of the TriMesh object using the sweeping algorithm in the specified direc...
Definition shape_trimesh.cpp:343
void UpdateSurfaceNodes() override
Update the surface nodes of the TriMesh object.
Definition shape_trimesh.cpp:135
Vec3d SurfacePoint(Vec3d const &pos) override
Calculate the surface point on the TriMesh object nearest to a given position.
Definition shape_trimesh.cpp:517
TriMesh()
Default constructor.
Definition shape_trimesh.cpp:10
VecXT< Vec3d > SupportPoints_HillClimb(Vec3d const &dir)
Calculate the support points of the TriMesh object using the hill climbing algorithm in the specified...
Definition shape_trimesh.cpp:292
int num_cells
The number of cells for the linked-patches algorithm (should be even).
Definition shape_trimesh.hpp:51
void SaveNormalPatchesSpherical(std::string const &file)
Save spherical normal patches for the TriMesh object to a file.
Definition shape_trimesh.cpp:556
void AlignAxes()
Align the axes of the TriMesh object.
Definition shape_trimesh.cpp:107
void SetSize(double d) override
Set the size of the TriMesh object.
Definition shape_trimesh.cpp:207
VecXT< Vec3i > facets
The faces (triangles) of the triangular mesh.
Definition shape_trimesh.hpp:33
void InitFromOFF(std::string const &file)
Initialize the TriMesh object from an OFF file.
Definition shape_trimesh.cpp:51
int ClosestFacet(Vec3d const &pos)
Find the closest facet on the TriMesh object to a given position.
Definition shape_trimesh.cpp:521
void Print() override
Print information about the TriMesh object.
Definition shape_trimesh.cpp:525
VecXT< Vec3d > vertices
The vertices of the triangular mesh.
Definition shape_trimesh.hpp:28
STLModel GetSTLModel(int num_nodes=200) override
Generate an STL model from the TriMesh object.
Definition shape_trimesh.cpp:222
VecXT< Vec3d > SupportPoints_LinkedVertices(Vec3d const &dir)
Calculate the support points of the TriMesh object using the linked-patches algorithm in the specifie...
Definition shape_trimesh.cpp:452
Vec3d SupportPoint_HillClimb(Vec3d const &dir)
Calculate the support point of the TriMesh object using the hill climbing algorithm in the specified ...
Definition shape_trimesh.cpp:246
void SupportPoints_HillClimbCheckCoplane(int vert_id, Vec3d const &max_pos, VecXT< int > *const vert_id_list, Vec3d const &dir)
Check whether a vertex is coplanar with the specified surface normal and direction.
Definition shape_trimesh.cpp:327
VecXT< VecXT< int > > linked_vertices
The vertices in each cell for the linked-patches algorithm.
Definition shape_trimesh.hpp:56
VecXT< Vec3d > SupportPoints(Vec3d const &dir) override
Calculate the support points of the TriMesh object in the specified direction.
Definition shape_trimesh.cpp:238
Shape * Clone() const override
Clone the TriMesh object.
Definition shape_trimesh.cpp:220
Vec3d SupportPoint(Vec3d const &dir) override
Calculate the support point of the TriMesh object in the specified direction.
Definition shape_trimesh.cpp:230
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
pos
Definition json_serilization.hpp:19
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18