FEDEM Solver  R8.0
Source code of the dynamics solver
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
FFaBody Class Reference

#include <FFaBody.H>

Collaboration diagram for FFaBody:
Collaboration graph
[legend]

Public Member Functions

 FFaBody ()
 
size_t getNoVertices () const
 
size_t getNoFaces () const
 
bool computeBoundingBox (FaVec3 &minX, FaVec3 &maxX) const
 
bool computeTotalVolume (double &Vb, FaVec3 &C0b, FFaTensor3 *Ib=NULL) const
 
bool computeVolumeBelow (double &Vb, double &As, FaVec3 &C0b, FaVec3 &C0s, const FaVec3 &normal, double z0, double zeroTol=1.0e-16)
 
bool saveIntersection (const FaMat34 &cs)
 
bool computeIncArea (double &dAs, FaVec3 &C0s, const FaVec3 &normal, const FaMat34 &cs)
 
size_t addFace (int v1, int v2, int v3, int v4=-1)
 
size_t addVertex (const FaVec3 &pos, double tol=-1.0)
 
const FaVec3getVertex (size_t idx) const
 
int getFaceVtx (size_t idx, int i) const
 
bool writeCAD (const std::string &fileName, const FaMat34 &partCS) const
 

Static Public Member Functions

static FFaBodyreadFromCAD (std::istream &in, double duplTol=-1.0)
 

Static Public Attributes

static std::string prefix
 

Protected Member Functions

void readIndexedFaceSet (std::istream &in, const FaMat34 &partCS)
 
void readBody (std::istream &in, const FaMat34 &partCS)
 
void readCoords (std::istream &in, const FaMat34 &partCS, char endChar='}')
 
void readFaces (std::istream &in, char endChar='}')
 
void readFace (std::istream &in)
 

Static Protected Member Functions

static FFaBodyreadSTL (std::istream &in, double duplTol)
 
static FFaBodyreadCAD (std::istream &in)
 
static FFaBodyreadWRL (std::istream &in, int version)
 
static void readWRL1 (FFaBody *&body, std::istream &in)
 
static void readWRL2 (FFaBody *&body, std::istream &in)
 
static void readChildren (FFaBody *&body, const FaMat34 &bodyCS, std::istream &in)
 
static void readTransform (FFaBody *&body, const FaMat34 &bodyCS, std::istream &in)
 
static void readShape (FFaBody *&body, const FaMat34 &bodyCS, std::istream &in)
 

Private Attributes

bool isBBoxComputed
 
FaVec3 myBBox [2]
 
std::vector< FaVec3myVertices
 
std::vector< FaFacemyFaces
 
FaVec3 myX0s
 
std::vector< FaVec3myLoopVer
 
std::vector< FaEdgemyIntLoop
 
char isVolumeComputed
 
double myVolume
 
FFaTensor3 myInertia
 
FaVec3 myCentroid
 
size_t startVx
 

Constructor & Destructor Documentation

◆ FFaBody()

FFaBody::FFaBody ( )
inline

Member Function Documentation

◆ addFace()

size_t FFaBody::addFace ( int  i1,
int  i2,
int  i3,
int  i4 = -1 
)

Adds a face to the body definition.

◆ addVertex()

size_t FFaBody::addVertex ( const FaVec3 pos,
double  tol = -1.0 
)

Adds a vertex to the body definition.

◆ computeBoundingBox()

bool FFaBody::computeBoundingBox ( FaVec3 minX,
FaVec3 maxX 
) const

Computes the bounding box of the body.

◆ computeIncArea()

bool FFaBody::computeIncArea ( double &  dAs,
FaVec3 C0s,
const FaVec3 normal,
const FaMat34 cs 
)

Computes the increment in the intersection area and the associated centroid. It is assumed that computeVolumeBelow already has been invoked before calling this method such that the current face intersections are available.

◆ computeTotalVolume()

bool FFaBody::computeTotalVolume ( double &  Vb,
FaVec3 C0b,
FFaTensor3 Ib = NULL 
) const

Computes the total volume, volume centroid, and optionally the volume inertia.

◆ computeVolumeBelow()

bool FFaBody::computeVolumeBelow ( double &  Vb,
double &  As,
FaVec3 C0b,
FaVec3 C0s,
const FaVec3 normal,
double  z0,
double  zeroTol = 1.0e-16 
)

Computes the volume and centroid of the portion of the body that is below the plane defined by normal and z0. The area of the intersection surface and the associated centroid is also computed, if the body is intersected.

◆ getFaceVtx()

int FFaBody::getFaceVtx ( size_t  idx,
int  i 
) const
inline

◆ getNoFaces()

size_t FFaBody::getNoFaces ( ) const
inline

◆ getNoVertices()

size_t FFaBody::getNoVertices ( ) const
inline

◆ getVertex()

const FaVec3& FFaBody::getVertex ( size_t  idx) const
inline

◆ readBody()

void FFaBody::readBody ( std::istream &  in,
const FaMat34 partCS 
)
protected

◆ readCAD()

FFaBody * FFaBody::readCAD ( std::istream &  in)
staticprotected

◆ readChildren()

void FFaBody::readChildren ( FFaBody *&  body,
const FaMat34 bodyCS,
std::istream &  in 
)
staticprotected

◆ readCoords()

void FFaBody::readCoords ( std::istream &  in,
const FaMat34 partCS,
char  endChar = '}' 
)
protected

◆ readFace()

void FFaBody::readFace ( std::istream &  in)
protected

◆ readFaces()

void FFaBody::readFaces ( std::istream &  in,
char  endChar = '}' 
)
protected

◆ readFromCAD()

FFaBody * FFaBody::readFromCAD ( std::istream &  in,
double  duplTol = -1.0 
)
static

This method administers the input of a body definition from a file. The body may either be defined on FT's internal CAD format, or on the external VRML or STL formats.

◆ readIndexedFaceSet()

void FFaBody::readIndexedFaceSet ( std::istream &  in,
const FaMat34 partCS 
)
protected

◆ readShape()

void FFaBody::readShape ( FFaBody *&  body,
const FaMat34 bodyCS,
std::istream &  in 
)
staticprotected

◆ readSTL()

FFaBody * FFaBody::readSTL ( std::istream &  in,
double  duplTol 
)
staticprotected

◆ readTransform()

void FFaBody::readTransform ( FFaBody *&  body,
const FaMat34 bodyCS,
std::istream &  in 
)
staticprotected

◆ readWRL()

FFaBody * FFaBody::readWRL ( std::istream &  in,
int  version 
)
staticprotected

◆ readWRL1()

void FFaBody::readWRL1 ( FFaBody *&  body,
std::istream &  in 
)
staticprotected

◆ readWRL2()

void FFaBody::readWRL2 ( FFaBody *&  body,
std::istream &  in 
)
staticprotected

◆ saveIntersection()

bool FFaBody::saveIntersection ( const FaMat34 cs)

Saves the loop of vertices defining the current intersection surface. The vertex coordinates of the loop are transformed to global coordinates using cs to facilitate comparison with a previous configuration.

◆ writeCAD()

bool FFaBody::writeCAD ( const std::string &  fileName,
const FaMat34 partCS 
) const

This method writes out the body definition on FT's internal CAD format.

Member Data Documentation

◆ isBBoxComputed

bool FFaBody::isBBoxComputed
mutableprivate

◆ isVolumeComputed

char FFaBody::isVolumeComputed
mutableprivate

◆ myBBox

FaVec3 FFaBody::myBBox[2]
mutableprivate

◆ myCentroid

FaVec3 FFaBody::myCentroid
mutableprivate

◆ myFaces

std::vector<FaFace> FFaBody::myFaces
private

◆ myInertia

FFaTensor3 FFaBody::myInertia
mutableprivate

◆ myIntLoop

std::vector<FaEdge> FFaBody::myIntLoop
private

◆ myLoopVer

std::vector<FaVec3> FFaBody::myLoopVer
private

◆ myVertices

std::vector<FaVec3> FFaBody::myVertices
private

◆ myVolume

double FFaBody::myVolume
mutableprivate

◆ myX0s

FaVec3 FFaBody::myX0s
private

◆ prefix

std::string FFaBody::prefix
static

◆ startVx

size_t FFaBody::startVx
private

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