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

Class representing the surface geometry a volumetric object. More...

#include <FFaBody.H>

Collaboration diagram for FFaBody:
Collaboration graph
[legend]

Public Member Functions

 FFaBody ()
 Default constructor. More...
 
size_t getNoVertices () const
 Returns the total number of vertices in the body. More...
 
size_t getNoFaces () const
 Returns the total number of faces in the body. More...
 
bool computeBoundingBox (FaVec3 &minX, FaVec3 &maxX) const
 Computes the bounding box of the body. More...
 
bool computeTotalVolume (double &Vb, FaVec3 &C0b, FFaTensor3 *Ib=NULL) const
 Computes the total volume and volume centroid of the body. More...
 
bool computeVolumeBelow (double &Vb, double &As, FaVec3 &C0b, FaVec3 &C0s, const FaVec3 &normal, double z0, double zeroTol=1.0e-16)
 Computes the volume of a body portion below of given plane. More...
 
bool saveIntersection (const FaMat34 &cs)
 Saves current plane intersection. More...
 
bool computeIncArea (double &dAs, FaVec3 &C0s, const FaVec3 &normal, const FaMat34 &cs)
 Computes the intersection area increment. More...
 
size_t addFace (int v1, int v2, int v3, int v4=-1)
 Adds a face to the body definition. More...
 
size_t addVertex (const FaVec3 &pos, double tol=-1.0)
 Adds a vertex to the body definition. More...
 
const FaVec3 & getVertex (size_t idx) const
 Returns the coordinates of a specified vertex. More...
 
int getFaceVtx (size_t idx, int i) const
 Returns the global index of a face vertex. More...
 
bool writeCAD (const std::string &fileName, const FaMat34 &partCS) const
 Exports the body to specified CAD file. More...
 

Static Public Member Functions

static FFaBody * readFromCAD (std::istream &in, double duplTol=-1.0)
 Creates a new body by parsing the given input stream. More...
 

Static Public Attributes

static std::string prefix
 File prefix to use for included files. More...
 

Static Protected Member Functions

static FFaBody * readSTL (std::istream &in, double duplTol)
 Creates a new body by parsing STL content from an input stream. More...
 
static FFaBody * readCAD (std::istream &in)
 Creates a new body by parsing CAD content from an input stream. More...
 
static FFaBody * readWRL (std::istream &in, int version)
 Creates a new body by parsing VRML content from an input stream. More...
 

Private Attributes

bool isBBoxComputed
 If true, myBBox is defined. More...
 
FaVec3 myBBox [2]
 Bounding box of the body. More...
 
std::vector< FaVec3 > myVertices
 Vertex container of the body. More...
 
std::vector< FaFace > myFaces
 Face container of the body. More...
 
FaVec3 myX0s
 Centroid of the plane intersection. More...
 
std::vector< FaVec3 > myLoopVer
 Vertices defining the intersection. More...
 
std::vector< FaEdge > myIntLoop
 Edges of the intersection surface. More...
 
char isVolumeComputed
 If true, myVolume is computed. More...
 
double myVolume
 The volume of this body. More...
 
FFaTensor3 myInertia
 The volume intertia of this body. More...
 
FaVec3 myCentroid
 The volume centroid of this body. More...
 
size_t startVx
 Number of vertices before intersected. More...
 

Detailed Description

Class representing the surface geometry a volumetric object.

This class is used to represent the geometry of Generic Parts in Fedem, and is equipped with methods for calculating the intersection between the geometry and a plane. This can be used for buoyancy calculation of partly submerged rigid objects.

Constructor & Destructor Documentation

◆ FFaBody()

FFaBody::FFaBody ( )
inline

Default constructor.

Member Function Documentation

◆ addFace()

size_t FFaBody::addFace ( int  v1,
int  v2,
int  v3,
int  v4 = -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 intersection area increment.

This method computes the increment in the intersection area and the associated centroid, assuming that computeVolumeBelow() already has been invoked such that the current face intersections are available.

◆ computeTotalVolume()

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

Computes the total volume and volume centroid of the body.

Optionally the volume inertia is also computed.

◆ 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 of a body portion below of given plane.

This method 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 by the plane.

◆ getFaceVtx()

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

Returns the global index of a face vertex.

◆ getNoFaces()

size_t FFaBody::getNoFaces ( ) const
inline

Returns the total number of faces in the body.

◆ getNoVertices()

size_t FFaBody::getNoVertices ( ) const
inline

Returns the total number of vertices in the body.

◆ getVertex()

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

Returns the coordinates of a specified vertex.

◆ readCAD()

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

Creates a new body by parsing CAD content from an input stream.

◆ readFromCAD()

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

Creates a new body by parsing the given input stream.

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

◆ readSTL()

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

Creates a new body by parsing STL content from an input stream.

◆ readWRL()

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

Creates a new body by parsing VRML content from an input stream.

◆ saveIntersection()

bool FFaBody::saveIntersection ( const FaMat34 &  cs)

Saves current plane intersection.

This method saves the loop of vertices defining the current intersection. 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

Exports the body to specified CAD file.

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

Member Data Documentation

◆ isBBoxComputed

bool FFaBody::isBBoxComputed
mutableprivate

If true, myBBox is defined.

◆ isVolumeComputed

char FFaBody::isVolumeComputed
mutableprivate

If true, myVolume is computed.

◆ myBBox

FaVec3 FFaBody::myBBox[2]
mutableprivate

Bounding box of the body.

◆ myCentroid

FaVec3 FFaBody::myCentroid
mutableprivate

The volume centroid of this body.

◆ myFaces

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

Face container of the body.

◆ myInertia

FFaTensor3 FFaBody::myInertia
mutableprivate

The volume intertia of this body.

◆ myIntLoop

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

Edges of the intersection surface.

◆ myLoopVer

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

Vertices defining the intersection.

◆ myVertices

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

Vertex container of the body.

◆ myVolume

double FFaBody::myVolume
mutableprivate

The volume of this body.

◆ myX0s

FaVec3 FFaBody::myX0s
private

Centroid of the plane intersection.

◆ prefix

std::string FFaBody::prefix
static

File prefix to use for included files.

◆ startVx

size_t FFaBody::startVx
private

Number of vertices before intersected.


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