17 using FaEdge = std::pair<size_t,size_t>;
33 const FaVec3& normal,
double z0,
40 size_t addFace(
int v1,
int v2,
int v3,
int v4 = -1);
46 bool writeCAD(
const std::string& fileName,
const FaMat34& partCS)
const;
65 void readFaces(std::istream& in,
char endChar =
'}');
127 return i >= 0 && (size_t)i <
myFaces[idx].size() ?
myFaces[idx][i] : -1;
std::pair< size_t, size_t > FaEdge
Vertex indices of an edge.
Definition: FFaBody.H:17
const double zeroTol
Definition: FFaMathOps.C:13
Point vectors in 3D space.
void readBody(std::istream &in, const FaMat34 &partCS)
Definition: FFaBodyParser.C:515
FaVec3 myCentroid
Definition: FFaBody.H:82
FFaTensor3 myInertia
Definition: FFaBody.H:81
static void readTransform(FFaBody *&body, const FaMat34 &bodyCS, std::istream &in)
Definition: FFaBodyParser.C:393
void readCoords(std::istream &in, const FaMat34 &partCS, char endChar='}')
Definition: FFaBodyParser.C:534
std::vector< FaFace > myFaces
Definition: FFaBody.H:75
bool writeCAD(const std::string &fileName, const FaMat34 &partCS) const
Definition: FFaBodyParser.C:606
std::vector< FaEdge > myIntLoop
Definition: FFaBody.H:78
bool computeBoundingBox(FaVec3 &minX, FaVec3 &maxX) const
Definition: FFaBody.C:464
int getFaceVtx(size_t idx, int i) const
Definition: FFaBody.H:125
static void readShape(FFaBody *&body, const FaMat34 &bodyCS, std::istream &in)
Definition: FFaBodyParser.C:440
static FFaBody * readWRL(std::istream &in, int version)
Definition: FFaBodyParser.C:266
static void readChildren(FFaBody *&body, const FaMat34 &bodyCS, std::istream &in)
Definition: FFaBodyParser.C:377
static FFaBody * readSTL(std::istream &in, double duplTol)
Definition: FFaBodyParser.C:158
static void readWRL1(FFaBody *&body, std::istream &in)
Definition: FFaBodyParser.C:279
static FFaBody * readFromCAD(std::istream &in, double duplTol=-1.0)
Definition: FFaBodyParser.C:138
bool computeVolumeBelow(double &Vb, double &As, FaVec3 &C0b, FaVec3 &C0s, const FaVec3 &normal, double z0, double zeroTol=1.0e-16)
Definition: FFaBody.C:537
std::vector< FaVec3 > myVertices
Definition: FFaBody.H:74
const FaVec3 & getVertex(size_t idx) const
Definition: FFaBody.H:42
std::vector< FaVec3 > myLoopVer
Definition: FFaBody.H:77
bool computeTotalVolume(double &Vb, FaVec3 &C0b, FFaTensor3 *Ib=NULL) const
Definition: FFaBody.C:484
size_t getNoVertices() const
Definition: FFaBody.H:27
void readFaces(std::istream &in, char endChar='}')
Definition: FFaBodyParser.C:571
bool computeIncArea(double &dAs, FaVec3 &C0s, const FaVec3 &normal, const FaMat34 &cs)
Definition: FFaBody.C:659
static void readWRL2(FFaBody *&body, std::istream &in)
Definition: FFaBodyParser.C:358
size_t addFace(int v1, int v2, int v3, int v4=-1)
Definition: FFaBody.C:420
FFaBody()
Definition: FFaBody.H:25
bool isBBoxComputed
Definition: FFaBody.H:72
double myVolume
Definition: FFaBody.H:80
char isVolumeComputed
Definition: FFaBody.H:79
void readFace(std::istream &in)
Definition: FFaBodyParser.C:554
size_t getNoFaces() const
Definition: FFaBody.H:28
size_t addVertex(const FaVec3 &pos, double tol=-1.0)
Definition: FFaBody.C:434
FaVec3 myBBox[2]
Definition: FFaBody.H:73
static std::string prefix
Definition: FFaBody.H:69
void readIndexedFaceSet(std::istream &in, const FaMat34 &partCS)
Definition: FFaBodyParser.C:469
size_t startVx
Definition: FFaBody.H:83
static FFaBody * readCAD(std::istream &in)
Definition: FFaBodyParser.C:234
FaVec3 myX0s
Definition: FFaBody.H:76
bool saveIntersection(const FaMat34 &cs)
Definition: FFaBody.C:610
Definition: FFaTensor3.H:27
std::vector< FaFace > mySubFaces
2 or 3 sub-triangles of intersected face
Definition: FFaBody.H:118
bool isIntersected() const
Definition: FFaBody.H:94
FFaBody * owner
Pointer to the body object containing this face.
Definition: FFaBody.H:121
const std::vector< FaFace > & getSubFaces() const
Definition: FFaBody.H:104
int intersect(const FaVec3 &normal, double z0, double zeroTol=1.0e-16)
Definition: FFaBody.C:90
const FaVec3 & vertex(int i) const
Definition: FFaBody.H:99
size_t operator[](int i) const
Definition: FFaBody.H:98
FFaBody * getBody() const
Definition: FFaBody.H:107
size_t size() const
Definition: FFaBody.H:97
friend std::ostream & operator<<(std::ostream &s, const FaFace &f)
Definition: FFaBody.C:69
FaFace()
Definition: FFaBody.C:37
bool isBelow() const
Definition: FFaBody.H:95
int quad2Quads(const char *status, const double *dist)
Definition: FFaBody.C:250
FaVec3 getIntEdgeCoord() const
Definition: FFaBody.C:362
FaEdge iEdge
Vertices of the intersection edge, if any.
Definition: FFaBody.H:117
double accumulateArea(const FaVec3 &vn, const FaVec3 &v0, FaVec3 &X) const
Definition: FFaBody.C:351
double accumulateVolume(const FaVec3 &v0, FaVec3 &X, FFaTensor3 *I) const
Definition: FFaBody.C:401
std::vector< size_t > myVertices
Indices to the vertices defining the face.
Definition: FFaBody.H:116
FaEdge getIntEdge() const
Definition: FFaBody.H:105
int quad2QuadTria(const char *status, const double *dist, bool oneAbove)
Definition: FFaBody.C:307
bool IAmBelow
Is face below current intersection plane?
Definition: FFaBody.H:119
Definition: FFaMat34.H:16
Class for point vectors in 3D space.
Definition: FFaVec3.H:40
real(sp) version
Model file version.
Definition: headingNamelistModule.f90:22
real(dp), dimension(:), allocatable v0
Definition: inverseModule.f90:26
real(dp), dimension(:), allocatable v1
Definition: inverseModule.f90:27
real(dp), dimension(:), allocatable v2
Definition: inverseModule.f90:28
integer, parameter i4
4-byte integer
Definition: kindModule.f90:18
real(dp) function dist(a, b, g)
Calculates the distance between the angles a,b,g and euler.
Definition: rotationModule.f90:274