101 void SaveAsVTK(std::string
const &file)
const;
111 void SaveAsSTL(std::string
const &file)
const;
184 void Refine(
int num_refines = 1);
393 int VertexIndexInFacet(
const Vec3d &facet,
int vertex_id);
Class for working with STL models.
Definition stl_model.hpp:17
void SmoothMesh(int num_trials=1)
Smooth the vertices of the model.
Definition stl_model.cpp:373
bool CheckConvexity()
Check if the model is convex.
Definition stl_model.cpp:425
void MakeConvex()
Make the model convex.
Definition stl_model.cpp:341
void SaveAsVTK(std::string const &file) const
Save the model as a VTK file.
Definition stl_model.cpp:170
std::tuple< Vec3d, Vec3d > GetBoundAABB() const
Get the axis-aligned bounding box of the model.
Definition stl_model.cpp:453
void Print()
Print information about the model to stdout.
Definition stl_model.cpp:447
VecXT< int > GetTriangleStrips() const
Get the triangle strip for VTK visualization.
Definition stl_model.cpp:391
STLModel()
Definition stl_model.cpp:20
void InitFromOFF(std::string const &file)
Initialize the model from an OFF file.
Definition stl_model.cpp:35
Mat3d GetInertia() const
Get the inertia tensor of the model.
Definition stl_model.cpp:478
double GetVolume() const
Get the volume of the model.
Definition stl_model.cpp:476
void CopyPoseDev(STLModel const &stl_model, STLModel const &stl_model_reset)
A workaround that uses stl_model_reset to reset the pose.
Definition stl_model.cpp:127
void Translate(Vec3d const &disp)
Translate the model by a given displacement.
Definition stl_model.cpp:71
Vec3d GetCenter() const
Get the center of mass of the model.
Definition stl_model.cpp:470
void RemoveDuplicateVertices()
Remove any duplicate vertices from the model.
Definition stl_model.cpp:251
VecXT< Vec3i > facets
A M by 3 matrix. Each row defines a facet, with the row elements being the indices of the vertices.
Definition stl_model.hpp:28
void RemoveUnreferencedVertices()
Remove any unreferenced vertices from the model.
Definition stl_model.cpp:241
VecXT< Vec3d > vertices
A N by 3 matrix that defines the points on the 3D model surface.
Definition stl_model.hpp:22
void Decimate(int num_nodes)
Decimate the model by a given number of nodes.
Definition stl_model.cpp:280
double GetSurfaceArea() const
Get the surface area of the model.
Definition stl_model.cpp:472
double GetSize() const
Get the size of the model.
Definition stl_model.cpp:387
bool IsFaceOutside(bool flip_outside=true)
Check if a face is outside the model.
Definition stl_model.cpp:404
void Standardize()
Standardize the model.
Definition stl_model.cpp:290
void InitFromSTL(std::string const &file)
Initialize the model from an STL file.
Definition stl_model.cpp:25
void ReorientFacets()
Reorient the facets of the model.
Definition stl_model.cpp:260
void SaveAsSTL(std::string const &file) const
Save the model as an STL file.
Definition stl_model.cpp:205
void Refine(int num_refines=1)
Refine the mesh of the model.
Definition stl_model.cpp:361
void Rotate(Vec4d const &quat)
Rotate the model by a given quaternion.
Definition stl_model.cpp:79
void CopyPose(STLModel const &stl_model)
Set the center and rotation to those of another STL model.
Definition stl_model.cpp:85
bool CheckEnclose(Vec3d const &pos) const
Check if a point is enclosed by the model.
Definition stl_model.cpp:437
void MergeSTLModel(STLModel const &stl_model)
Merge another STL model into this one.
Definition stl_model.cpp:351
void SetSize(double size)
Set the size of the model.
Definition stl_model.cpp:321
Definition bond_entry.hpp:7
std::array< std::array< double, 3 >, 3 > Mat3d
Definition utils_macros.hpp:22
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
std::array< double, 4 > Vec4d
Definition utils_macros.hpp:19