chrono::ChConvexDecomposition Class Referenceabstract

Description

Base interface class for convex decomposition.

#include <ChConvexDecomposition.h>

Inheritance diagram for chrono::ChConvexDecomposition:

Public Member Functions

 ChConvexDecomposition ()
 Basic constructor.
 
virtual ~ChConvexDecomposition ()
 Destructor.
 
virtual void Reset (void)=0
 Reset the input mesh data.
 
virtual bool AddTriangle (const ChVector3d &v1, const ChVector3d &v2, const ChVector3d &v3)=0
 Add a triangle, by passing three points for vertexes.
 
virtual bool AddTriangle (const ChTriangle &t1)
 Add a triangle, by passing a ChTriangle object (that will be copied, not referenced).
 
virtual bool AddTriangleMesh (const ChTriangleMesh &tm)
 Add a triangle mesh, by passing an entire ChTriangleMesh object.
 
virtual int ComputeConvexDecomposition ()=0
 Perform the convex decomposition.
 
virtual unsigned int GetHullCount ()=0
 Get the number of computed hulls after the convex decomposition.
 
virtual bool GetConvexHullResult (unsigned int hullIndex, ChTriangleMesh &convextrimesh)=0
 Get the n-th computed convex hull, by filling a ChTriangleMesh object that is passed as a parameter.
 
virtual bool GetConvexHullResult (unsigned int hullIndex, std::vector< ChVector3d > &convexhull)=0
 Get the n-th computed convex hull, by filling a vector of points of the vertexes of the n-th hull that is passed as a parameter.
 
virtual bool WriteConvexHullsAsChullsFile (std::ostream &mstream)
 Write the convex decomposition to a ".chulls" file, where each hull is a sequence of x y z coords.
 
virtual void WriteConvexHullsAsWavefrontObj (std::ostream &mstream)=0
 Save the computed convex hulls as a Wavefront file using the '.obj' fileformat, with each hull as a separate group.
 

Member Function Documentation

◆ AddTriangle() [1/2]

bool chrono::ChConvexDecomposition::AddTriangle ( const ChTriangle & t1)
virtual

Add a triangle, by passing a ChTriangle object (that will be copied, not referenced).

Note: the vertexes must be properly ordered (oriented triangle, normal pointing outside)

◆ AddTriangle() [2/2]

virtual bool chrono::ChConvexDecomposition::AddTriangle ( const ChVector3d & v1,
const ChVector3d & v2,
const ChVector3d & v3 )
pure virtual

Add a triangle, by passing three points for vertexes.

Note: the vertexes must be properly ordered (oriented triangle, normal pointing outside)

Implemented in chrono::ChConvexDecompositionHACD, and chrono::ChConvexDecompositionHACDv2.

◆ AddTriangleMesh()

bool chrono::ChConvexDecomposition::AddTriangleMesh ( const ChTriangleMesh & tm)
virtual

Add a triangle mesh, by passing an entire ChTriangleMesh object.

Note: the triangles must define closed volumes (holes, gaps in edges, etc. may trouble the decomposition)

Reimplemented in chrono::ChConvexDecompositionHACD, and chrono::ChConvexDecompositionHACDv2.

◆ ComputeConvexDecomposition()

virtual int chrono::ChConvexDecomposition::ComputeConvexDecomposition ( )
pure virtual

Perform the convex decomposition.

Implemented in chrono::ChConvexDecompositionHACD, and chrono::ChConvexDecompositionHACDv2.

◆ GetConvexHullResult() [1/2]

virtual bool chrono::ChConvexDecomposition::GetConvexHullResult ( unsigned int hullIndex,
ChTriangleMesh & convextrimesh )
pure virtual

Get the n-th computed convex hull, by filling a ChTriangleMesh object that is passed as a parameter.

Implemented in chrono::ChConvexDecompositionHACD, and chrono::ChConvexDecompositionHACDv2.

◆ GetConvexHullResult() [2/2]

virtual bool chrono::ChConvexDecomposition::GetConvexHullResult ( unsigned int hullIndex,
std::vector< ChVector3d > & convexhull )
pure virtual

Get the n-th computed convex hull, by filling a vector of points of the vertexes of the n-th hull that is passed as a parameter.

Implemented in chrono::ChConvexDecompositionHACD, and chrono::ChConvexDecompositionHACDv2.

◆ GetHullCount()

virtual unsigned int chrono::ChConvexDecomposition::GetHullCount ( )
pure virtual

Get the number of computed hulls after the convex decomposition.

Implemented in chrono::ChConvexDecompositionHACD, and chrono::ChConvexDecompositionHACDv2.

◆ Reset()

virtual void chrono::ChConvexDecomposition::Reset ( void )
pure virtual

Reset the input mesh data.

Implemented in chrono::ChConvexDecompositionHACD, and chrono::ChConvexDecompositionHACDv2.

◆ WriteConvexHullsAsChullsFile()

bool chrono::ChConvexDecomposition::WriteConvexHullsAsChullsFile ( std::ostream & mstream)
virtual

Write the convex decomposition to a ".chulls" file, where each hull is a sequence of x y z coords.

Can throw exceptions.

◆ WriteConvexHullsAsWavefrontObj()

virtual void chrono::ChConvexDecomposition::WriteConvexHullsAsWavefrontObj ( std::ostream & mstream)
pure virtual

Save the computed convex hulls as a Wavefront file using the '.obj' fileformat, with each hull as a separate group.

May throw exceptions if file locked etc.

Implemented in chrono::ChConvexDecompositionHACD, and chrono::ChConvexDecompositionHACDv2.


The documentation for this class was generated from the following files:
  • C:/M/B/src/chrono-9.0.1/src/chrono/collision/ChConvexDecomposition.h
  • C:/M/B/src/chrono-9.0.1/src/chrono/collision/ChConvexDecomposition.cpp