24#ifndef _GEMA_GEOMETRY_UTILS_H_
25#define _GEMA_GEOMETRY_UTILS_H_
A class used to return static metadata information about a cell geometry, along with some methods for...
Definition gmCellGeometry.h:55
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of the GmMatrix class.
arma::mat GmMatrix
The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
Definition gmMatrix.h:38
Declaration of the GmVector class.
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34
Groups utilitary routines for working with geometry.
Definition gmGeometryUtils.cpp:33
static bool pointInTetrahedron(const GmMatrix &X, const GmVector &p, QVector< bool > &ss)
Helper function for pointInTetrahedron(X, p) also returning the "same side" vector.
Definition gmGeometryUtils.cpp:753
void triangleCentroid(const GmVector &p1, const GmVector &p2, const GmVector &p3, GmVector &coord)
Returns the cartesian coordinate of the triangle centroid.
Definition gmGeometryUtils.cpp:262
QVector< QVector< int > > edgeFaceList(const QVector< QVector< int > > &faceEdgeList, int edgeCount)
Returns a edgeFace Vector of faces indexed by edge Its input is the inverse map faceEdge Vector.
Definition gmGeometryUtils.cpp:1393
void quadCentroid(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4, GmVector &coord)
Returns the cartesian coordinate of the quad centroid.
Definition gmGeometryUtils.cpp:273
double pointToConvexPolygon(const GmMatrix &X, const GmVector &p, GmVector &proj)
Returns the dquared distance of point p to the polygon delimited by the cell vertices (convex hull) a...
Definition gmGeometryUtils.cpp:1131
void tetrahedronCentroid(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4, GmVector &coord)
Returns the cartesian coordinate of the tetrahedron centroid.
Definition gmGeometryUtils.cpp:342
bool polygon3DIsPlanar(const GmMatrix &X, double tol)
Returns true if the polygon delimited by the cell vertices is planar.
Definition gmGeometryUtils.cpp:556
bool pointInConvexPolygon(const GmMatrix &X, const GmVector &p)
Returns true if the point p is inside the polygon delimited by the cell vertices (convex hull),...
Definition gmGeometryUtils.cpp:614
double triangleArea(const GmVector &p1, const GmVector &p2, const GmVector &p3)
Calculates the area of the triangle determined by points p1, p2 and p3 (2D or 3D),...
Definition gmGeometryUtils.cpp:161
double tetrahedronVolume(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4)
Calculates the volume of the given tetrahedron. Points follow the standard Tet cell definition.
Definition gmGeometryUtils.cpp:216
bool pointInTesselatedPolygon_T6(const GmMatrix &X, const GmVector &p)
Returns true if the point p is inside the tesselated T6 polygon or false otherwise.
Definition gmGeometryUtils.cpp:635
double pyramidVolume(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4, const GmVector &p5)
Calculates the volume of the given pyramid. Points follow the standard pyramid cell definition.
Definition gmGeometryUtils.cpp:240
void hexahedronCentroid(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4, const GmVector &p5, const GmVector &p6, const GmVector &p7, const GmVector &p8, GmVector &coord)
Definition gmGeometryUtils.cpp:294
bool polygonIsConvex(const GmMatrix &X)
Returns true if the polygon delimited by the cell vertices is convex, or false otherwise.
Definition gmGeometryUtils.cpp:528
double wedgeVolume(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4, const GmVector &p5, const GmVector &p6)
Calculates the volume of the given wedge. Points follow the standard Wedge cell definition.
Definition gmGeometryUtils.cpp:228
double hexahedronVolume(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4, const GmVector &p5, const GmVector &p6, const GmVector &p7, const GmVector &p8)
Calculates the volume of the given hexahedron. Points follow the standard Hex cell definition.
Definition gmGeometryUtils.cpp:199
GmMatrix get2DProjectionMatRow(const GmMatrix &X)
Returns a 3x2 (transposed) rigid transform matrix taking v1-origin and v2-origin 3D vectors to the 2D...
Definition gmGeometryUtils.cpp:1369
void edgeCentroid(const GmVector &p1, const GmVector &p2, GmVector &coord)
Returns the cartesian coordinate of the edge centroid.
Definition gmGeometryUtils.cpp:252
double edgeLength(const GmVector &p1, const GmVector &p2)
Calculates the length of the edge determined by points p1 and p2.
Definition gmGeometryUtils.cpp:153
bool polygon2DIsSelfIntersecting(const GmMatrix &X)
Returns true if the polygon delimited by the cell vertices is self-intersecting, or false otherwise.
Definition gmGeometryUtils.cpp:467
void pyramidCentroid(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4, const GmVector &p5, GmVector &coord)
Returns the cartesian coordinate of the pyramid centroid.
Definition gmGeometryUtils.cpp:388
void wedgeCentroid(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4, const GmVector &p5, const GmVector &p6, GmVector &coord)
Returns the cartesian coordinate of the wedge centroid.
Definition gmGeometryUtils.cpp:352
bool polygon2DIsCCW(const GmMatrix &X)
Returns true if the polygon delimited by the cell vertices is oriented CCW.
Definition gmGeometryUtils.cpp:496
GmMatrix get2DProjectionMatCol(const GmMatrix &X)
Returns a 2x3 rigid transform matrix taking v1-origin and v2-origin 3D vectors to the 2D xy plane.
Definition gmGeometryUtils.cpp:1348
bool pointInPolygon(const GmMatrix &X, const GmCellGeometry &g, const GmVector &p)
Returns true if the point p is inside the polygon delimited by the cell vertices, or false otherwise.
Definition gmGeometryUtils.cpp:714
double pointToTetrahedron(const GmMatrix &X, const GmVector &p, GmVector &proj)
Returns the squared distance of point p to the tetrahedron delimited by its vertices and fills the co...
Definition gmGeometryUtils.cpp:1182
double quadArea(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4)
Calculates the area of a quad defined by points p1 to p4 (2D or 3D), defined in CCW order.
Definition gmGeometryUtils.cpp:192
bool hex27ValidFacesCenter(const GmMatrix &X, double tol)
Returns true if face center point is collinear with the face. Assumes that the quad faces are planar.
Definition gmGeometryUtils.cpp:1039
bool pointInTesselatedPolygon_Q8(const GmMatrix &X, const GmVector &p)
Returns true if the point p is inside the tesselated Q8 polygon or false otherwise.
Definition gmGeometryUtils.cpp:669
GmMatrix shuffle(const GmMatrix &X, const int order[], int size)
Returns quad8 vertices in circular order.
Definition gmGeometryUtils.cpp:581
bool hex20ValidEdges(const GmMatrix &X, double proportion_max)
Returns true if the points defined between the edges of hex20 follows: 1) Their projection to the 3d ...
Definition gmGeometryUtils.cpp:951