|
FEDEM Solver
R8.0
Source code of the dynamics solver
|
Class representing the surface geometry a volumetric object. More...
#include <FFaBody.H>

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... | |
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.
|
inline |
Default constructor.
| size_t FFaBody::addFace | ( | int | v1, |
| int | v2, | ||
| int | v3, | ||
| int | v4 = -1 |
||
| ) |
Adds a face to the body definition.
| size_t FFaBody::addVertex | ( | const FaVec3 & | pos, |
| double | tol = -1.0 |
||
| ) |
Adds a vertex to the body definition.
Computes the bounding box of the body.
| 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.
| 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.
| 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.
|
inline |
Returns the global index of a face vertex.
|
inline |
Returns the total number of faces in the body.
|
inline |
Returns the total number of vertices in the body.
|
inline |
Returns the coordinates of a specified vertex.
|
staticprotected |
Creates a new body by parsing CAD content from an input stream.
|
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.
|
staticprotected |
Creates a new body by parsing STL content from an input stream.
|
staticprotected |
Creates a new body by parsing VRML content from an input stream.
| 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.
| 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.
|
mutableprivate |
If true, myBBox is defined.
|
mutableprivate |
If true, myVolume is computed.
|
mutableprivate |
Bounding box of the body.
|
mutableprivate |
The volume centroid of this body.
|
private |
Face container of the body.
|
mutableprivate |
The volume intertia of this body.
|
private |
Edges of the intersection surface.
|
private |
Vertices defining the intersection.
|
private |
Vertex container of the body.
|
mutableprivate |
The volume of this body.
|
private |
Centroid of the plane intersection.
|
static |
File prefix to use for included files.
|
private |
Number of vertices before intersected.