Description

A basic triangle mesh: just a list of triangles (no edge connectivity info).

#include <ChTriangleMeshSoup.h>

Inheritance diagram for chrono::ChTriangleMeshSoup:
Collaboration diagram for chrono::ChTriangleMeshSoup:

Public Member Functions

 ChTriangleMeshSoup (const ChTriangleMeshSoup &source)
 
virtual ChTriangleMeshSoupClone () const override
 "Virtual" copy constructor (covariant return type).
 
virtual Type GetType () const override
 Get the class type as an enum.
 
virtual unsigned int GetNumTriangles () const override
 Get the number of triangles already added to this mesh.
 
virtual ChTriangle GetTriangle (unsigned int index) const override
 Access the n-th triangle in mesh.
 
std::vector< ChTriangle > & GetTriangles ()
 Access the list of mesh triangles.
 
virtual void AddTriangle (const ChVector3d &vertex0, const ChVector3d &vertex1, const ChVector3d &vertex2) override
 Add a triangle to this triangle mesh, by specifying the three coordinates.
 
virtual void AddTriangle (const ChTriangle &triangle) override
 Add a triangle to this triangle mesh, by specifying a ChTriangle.
 
bool LoadWavefrontMesh (const std::string &filename)
 Load from the given Wavefront .obj file. More...
 
bool LoadSTLMesh (const std::string &filename)
 Load an STL file into this triangle mesh. More...
 
virtual void Clear () override
 Clear all data.
 
virtual void Transform (const ChVector3d &displ, const ChMatrix33d &rotscale) override
 Transform all vertices, by displacing and rotating (rotation via matrix, so also scaling if needed).
 
virtual void ArchiveOut (ChArchiveOut &archive_out) override
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIn (ChArchiveIn &archive_in) override
 Method to allow de-serialization of transient data from archives.
 
- Public Member Functions inherited from chrono::ChTriangleMesh
virtual void Transform (const ChVector3d &displ, const ChQuaterniond &quat=ChQuaterniond(1, 0, 0, 0))
 Transform all vertices, by displacing and rotating (rotation via matrix, so also scaling if needed).
 
virtual ChAABB GetBoundingBox () const override
 Compute bounding box of this triangle mesh.
 
virtual int GetManifoldDimension () const override
 Return dimensionality of this object. More...
 
- Public Member Functions inherited from chrono::ChGeometry
 ChGeometry (const ChGeometry &other)
 
void InflateBoundingBox (ChAABB &bbox) const
 Enlarge the given existing bounding box with the bounding box of this object.
 
virtual double GetBoundingSphereRadius () const
 Returns the radius of a bounding sphere for this geometry. More...
 
virtual ChVector3d Barycenter () const
 Compute center of mass.
 
virtual void Update ()
 Generic update of internal data.
 

Static Public Member Functions

static std::shared_ptr< ChTriangleMeshSoupCreateFromWavefrontFile (const std::string &filename)
 Access the n-th triangle in mesh /virtual ChTriangle& Triangle(int index) { return m_triangles[index]; }. More...
 
static std::shared_ptr< ChTriangleMeshSoupCreateFromSTLFile (const std::string &filename)
 Create and return a ChTriangleMeshSoup from an STL file. More...
 

Additional Inherited Members

- Public Types inherited from chrono::ChGeometry
enum  Type {
  NONE, SPHERE, ELLIPSOID, BOX,
  CYLINDER, TRIANGLE, CAPSULE, CONE,
  LINE, LINE_ARC, LINE_BEZIER, LINE_CAM,
  LINE_PATH, LINE_POLY, LINE_SEGMENT, ROUNDED_BOX,
  ROUNDED_CYLINDER, TRIANGLEMESH, TRIANGLEMESH_CONNECTED, TRIANGLEMESH_SOUP
}
 Enumeration of geometric object types.
 

Member Function Documentation

◆ CreateFromSTLFile()

std::shared_ptr< ChTriangleMeshSoup > chrono::ChTriangleMeshSoup::CreateFromSTLFile ( const std::string &  filename)
static

Create and return a ChTriangleMeshSoup from an STL file.

If an error occurrs during loading, an empty shared pointer is returned.

◆ CreateFromWavefrontFile()

std::shared_ptr< ChTriangleMeshSoup > chrono::ChTriangleMeshSoup::CreateFromWavefrontFile ( const std::string &  filename)
static

Access the n-th triangle in mesh /virtual ChTriangle& Triangle(int index) { return m_triangles[index]; }.

Create and return a ChTriangleMeshSoup from a Wavefront OBJ file. If an error occurrs during loading, an empty shared pointer is returned.

◆ LoadSTLMesh()

bool chrono::ChTriangleMeshSoup::LoadSTLMesh ( const std::string &  filename)

Load an STL file into this triangle mesh.

NB: this mesh object must already be initialized.

◆ LoadWavefrontMesh()

bool chrono::ChTriangleMeshSoup::LoadWavefrontMesh ( const std::string &  filename)

Load from the given Wavefront .obj file.

NB: this mesh object must already be initialized.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/geometry/ChTriangleMeshSoup.h
  • /builds/uwsbel/chrono/src/chrono/geometry/ChTriangleMeshSoup.cpp