Project Chrono: chrono::ChTriangle Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
chrono::ChTriangle Class Reference
Chrono::Engine » Geometric objects

## Description

A triangle geometric shape for collisions and visualization.

`#include <ChTriangle.h>`

Inheritance diagram for chrono::ChTriangle:
[legend]
Collaboration diagram for chrono::ChTriangle:
[legend]

## Public Member Functions
| ChTriangle (const ChVector3d &P1, const ChVector3d &P2, const ChVector3d &P3)
| ChTriangle (const ChTriangle &source)
virtual ChTriangle * | Clone () const override
| "Virtual" copy constructor (covariant return type).
ChTriangle & | operator= (const ChTriangle &source)
| Assignment operator: copy from another triangle.
virtual Type | GetType () const override
| Get the class type as an enum.
virtual ChAABB | GetBoundingBox () const override
| Compute bounding box of this triangle.
virtual ChVector3d | Baricenter () const override
| Compute center of mass.
virtual int | GetManifoldDimension () const override
| This is a surface.
bool | IsDegenerated () const
bool | Normal (ChVector3d &N) const
ChVector3d | GetNormal () const
double | PointTriangleDistance (ChVector3d B, double &mu, double &mv, bool &is_into, ChVector3d &Bprojected)
| Given point B, computes the distance from this triangle plane, returning also the projection of point on the plane.
void | SetPoints (const ChVector3d &P1, const ChVector3d &P2, const ChVector3d &P3)
| Set the triangle vertices.
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::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.
virtual void | Update ()
| Generic update of internal data.

## Static Public Member Functions
static ChAABB | GetBoundingBox (const ChVector3d &P1, const ChVector3d &P2, const ChVector3d &P3)
| Return the bounding box of a triangle with given vertices.

## Public Attributes
ChVector3d | p1
| first triangle vertex
ChVector3d | p2
| second triangle vertex
ChVector3d | p3
| third triangle vertex

## Additional Inherited Members
Public Types inherited from chrono::ChGeometry
enum class | 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

## ◆ ArchiveIn()

void chrono::ChTriangle::ArchiveIn | ( | ChArchiveIn & | archive_in | ) |
| overridevirtual

Method to allow de-serialization of transient data from archives.

Reimplemented from chrono::ChGeometry.

## ◆ ArchiveOut()

void chrono::ChTriangle::ArchiveOut | ( | ChArchiveOut & | archive_out | ) |
| overridevirtual

Method to allow serialization of transient data to archives.

Reimplemented from chrono::ChGeometry.

## ◆ Baricenter()

ChVector3d chrono::ChTriangle::Baricenter | ( |  | ) | const
| overridevirtual

Compute center of mass.

Reimplemented from chrono::ChGeometry.

## ◆ Clone()

virtual ChTriangle * chrono::ChTriangle::Clone | ( |  | ) | const
| inlineoverridevirtual

"Virtual" copy constructor (covariant return type).

Implements chrono::ChGeometry.

## ◆ GetBoundingBox()

ChAABB chrono::ChTriangle::GetBoundingBox | ( |  | ) | const
| overridevirtual

Compute bounding box of this triangle.

Reimplemented from chrono::ChGeometry.

## ◆ GetManifoldDimension()

virtual int chrono::ChTriangle::GetManifoldDimension | ( |  | ) | const
| inlineoverridevirtual

This is a surface.

Reimplemented from chrono::ChGeometry.

## ◆ GetType()

virtual Type chrono::ChTriangle::GetType | ( |  | ) | const
| inlineoverridevirtual

Get the class type as an enum.

Reimplemented from chrono::ChGeometry.

## ◆ PointTriangleDistance()

double chrono::ChTriangle::PointTriangleDistance | ( | ChVector3d | B,
|  | double & | mu,
|  | double & | mv,
|  | bool & | is_into,
|  | ChVector3d & | Bprojected )

Given point B, computes the distance from this triangle plane, returning also the projection of point on the plane.

Parameters

  B | point to be measured
  mu | returns U parametric coord of projection
  mv | returns V parametric coord of projection
  is_into | returns true if projection falls on the triangle
  Bprojected | returns the position of the projected point

The documentation for this class was generated from the following files:

- D:/W/B/src/chrono-9.0.1/src/chrono/geometry/ChTriangle.h
- D:/W/B/src/chrono-9.0.1/src/chrono/geometry/ChTriangle.cpp