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).
 
bool LoadWavefrontMesh (std::string filename)
 Load from the given Wavefront .obj file.
 
virtual void AddTriangle (const ChVector3d &vertex0, const ChVector3d &vertex1, const ChVector3d &vertex2) override
 Access the n-th triangle in mesh /virtual ChTriangle& Triangle(int index) { return m_triangles[index]; }. More...
 
virtual void AddTriangle (const ChTriangle &atriangle) override
 Add a triangle to this triangle mesh, by specifying a ChTriangle.
 
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 ()
 Get the list of triangles.
 
virtual void Clear () override
 Clear all data.
 
virtual void Transform (const ChVector3d displ, const ChMatrix33<> rotscale) override
 Transform all vertexes, by displacing and rotating (rotation via matrix, so also scaling if needed)
 
virtual Type GetType () const override
 Get the class type as an enum.
 
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 ChQuaternion<> mquat=ChQuaternion<>(1, 0, 0, 0))
 Transform all vertexes, 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
 This is a surface.
 
- 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 Baricenter () 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)
 Create and return a ChTriangleMeshConnected from a Wavefront OBJ 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

◆ AddTriangle()

void chrono::ChTriangleMeshSoup::AddTriangle ( const ChVector3d vertex0,
const ChVector3d vertex1,
const ChVector3d vertex2 
)
overridevirtual

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

Add a triangle to this triangle mesh, by specifying the three coordinates

Implements chrono::ChTriangleMesh.

◆ CreateFromWavefrontFile()

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

Create and return a ChTriangleMeshConnected from a Wavefront OBJ file.

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


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