Code_TYMPAN  4.4.0
Industrial site acoustic simulation
Static Public Member Functions | List of all members
OGeometrie Class Reference

Class Geometry utilities. More...

#include <3d.h>

Static Public Member Functions

static bool intersDemiSegmentAvecSegment (const OPoint3D &ptS, const OPoint3D &ptA, const OPoint3D &ptB)
 Return true if the horizontal from the ptS point intersects the segment defined by ptA and ptB. More...
 
static int intersDroitesPoints (const OPoint3D &ptA, const OPoint3D &ptB, const OPoint3D &ptC, const OPoint3D &ptD, OPoint3D &ptI)
 Calculate the intersection between two lines each defined by two points. More...
 
static int intersDroitesPointVecteur (const OPoint3D &ptA, const OVector3D &vecA, const OPoint3D &ptB, const OVector3D &vecB, OPoint3D &ptI)
 Calculate the intersection between two lines each defined by a point and a vector. More...
 
static double symPointDroite (const OPoint3D &ptA, const OPoint3D &ptB, const OPoint3D &ptP, OPoint3D &ptI)
 Calculate the symmetrical of a point with respect to a line (defined by two points). More...
 
static bool pointInPolygonAngleSum (const OPoint3D &ptP, const OPoint3D *pts, int nbPts)
 Tests if a point is inside a polygon using angle sum algorithm. More...
 
static bool pointInPolygonRayCasting (const OPoint3D &ptP, const OPoint3D *pts, int nbPts)
 Tests if a point is inside a polygon using ray casting algorithm. More...
 
static bool shortestSegBetween2Lines (const OPoint3D &pt1, const OPoint3D &pt2, const OPoint3D &pt3, const OPoint3D &pt4, OPoint3D &ptA, OPoint3D &ptB, double *mua, double *mub)
 Calculates the line segment PaPb that is the shortest route between two lines P1P2 and P3P4. More...
 
static void boundingBox (OPoint3D *pts, int nbPts, OPoint3D &ptMin, OPoint3D &ptMax)
 Computes the simple bounding box for a volume using min-max method. More...
 
static void computeNormal (OPoint3D *pts, int nbPts, OVector3D &normal)
 Computes the normal of the list of points. More...
 

Detailed Description

Class Geometry utilities.

Definition at line 932 of file 3d.h.

Member Function Documentation

◆ boundingBox()

static void OGeometrie::boundingBox ( OPoint3D pts,
int  nbPts,
OPoint3D ptMin,
OPoint3D ptMax 
)
static

Computes the simple bounding box for a volume using min-max method.

Parameters
ptsAn array of points defining the volume.
nbPtsThe size of the previous array.
ptMinThe point with minimal values in X, Y and Z.
ptMaxThe point with maximal values in X, Y and Z.

Definition at line 1109 of file 3d.cpp.

Here is the caller graph for this function:

◆ computeNormal()

static void OGeometrie::computeNormal ( OPoint3D pts,
int  nbPts,
OVector3D normal 
)
static

Computes the normal of the list of points.

Parameters
ptsAn array of the points defining the volume.
nbPtsThe size of the previous array.
normalThe resulting normal.

Definition at line 1147 of file 3d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersDemiSegmentAvecSegment()

static bool OGeometrie::intersDemiSegmentAvecSegment ( const OPoint3D ptS,
const OPoint3D ptA,
const OPoint3D ptB 
)
static

Return true if the horizontal from the ptS point intersects the segment defined by ptA and ptB.

Parameters
ptSThe point of the half segment.
ptAThe first point of the segment.
ptBThe second point of the segment.
Returns
true if intersection exists, false if not.

Definition at line 915 of file 3d.cpp.

Here is the caller graph for this function:

◆ intersDroitesPoints()

static int OGeometrie::intersDroitesPoints ( const OPoint3D ptA,
const OPoint3D ptB,
const OPoint3D ptC,
const OPoint3D ptD,
OPoint3D ptI 
)
static

Calculate the intersection between two lines each defined by two points.

Parameters
ptAA point of the first line.
ptBA second point of the first line.
ptCA point of the second line.
ptDA second point of the second line.
ptIThe intersection point.
Returns
INTERS_OUI (1) if intersection exists, INTERS_NULLE (0) if not.

Definition at line 938 of file 3d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersDroitesPointVecteur()

static int OGeometrie::intersDroitesPointVecteur ( const OPoint3D ptA,
const OVector3D vecA,
const OPoint3D ptB,
const OVector3D vecB,
OPoint3D ptI 
)
static

Calculate the intersection between two lines each defined by a point and a vector.

Parameters
ptAPoint of the first line.
vecAVector for the first line.
ptBPoint of the second line.
vecBVector for the second line.
ptIThe intersection point.
Returns
INTERS_OUI (1) if intersection exists, INTERS_NULLE (0) if not.

Definition at line 977 of file 3d.cpp.

Here is the call graph for this function:

◆ pointInPolygonAngleSum()

static bool OGeometrie::pointInPolygonAngleSum ( const OPoint3D ptP,
const OPoint3D pts,
int  nbPts 
)
static

Tests if a point is inside a polygon using angle sum algorithm.

This solution was motivated by solution which consists to compute the sum of the angles made between the test point and each pair of points making up the polygon and correspondence with Reinier van Vliet and Remco Lam. If this sum is 2pi then the point is an interior point, if 0 then the point is an exterior point. To determine whether a point is on the interior of a convex polygon in 3D one might be tempted to first determine whether the point is on the plane, then determine it's interior status. Both of these can be accomplished at once by computing the sum of the angles between the test point (ptP) and every pair of edge points pts[i]->pts[i+1]. This sum will only be 2pi if both the point is on the plane of the polygon AND on the interior. The angle sum will tend to 0 the further away from the polygon point ptP becomes.

Parameters
ptPThe point.
ptsAn array containing the polygon points.
nbPtsThe size of the previous array (size should be >= 3).
Returns
true if the point is inside the polygon, false otherwise.

Definition at line 1016 of file 3d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pointInPolygonRayCasting()

static bool OGeometrie::pointInPolygonRayCasting ( const OPoint3D ptP,
const OPoint3D pts,
int  nbPts 
)
static

Tests if a point is inside a polygon using ray casting algorithm.

Parameters
ptPThe point.
ptsAn array containing the polygon points.
nbPtsThe size of the previous array (size should be >= 3).
Returns
true if the point is inside the polygon, false otherwise.

Definition at line 1046 of file 3d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shortestSegBetween2Lines()

static bool OGeometrie::shortestSegBetween2Lines ( const OPoint3D pt1,
const OPoint3D pt2,
const OPoint3D pt3,
const OPoint3D pt4,
OPoint3D ptA,
OPoint3D ptB,
double *  mua,
double *  mub 
)
static

Calculates the line segment PaPb that is the shortest route between two lines P1P2 and P3P4.

Calculates also the values of mua and mub where: Pa = P1 + mua (P2 - P1) Pb = P3 + mub (P4 - P3)

Remark: The values of mua and mub range from negative to positive infinity. The line segments between P1 P2 and P3 P4 have their corresponding mu between 0 and 1.

Parameters
pt1A 1st point on the 1st line.
pt2A 2nd point on the 1st line.
pt3A 1st point on the 2nd line.
pt4A 2nd point on the 2nd line.
ptAThe 1st point of the resulting segment.
ptBThe 2nd point of the resulting segment.
muaThe mua value result.
mubThe mub value result.
Returns
false if no solution exists, true otherwise.

Definition at line 1063 of file 3d.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ symPointDroite()

static double OGeometrie::symPointDroite ( const OPoint3D ptA,
const OPoint3D ptB,
const OPoint3D ptP,
OPoint3D ptI 
)
static

Calculate the symmetrical of a point with respect to a line (defined by two points).

Parameters
ptAA point of the first line.
ptBA second point of the first line.
ptPThe point we want the symmetrical
ptIThe symmetrical point.
Returns
The k coefficient (between 0 and 1 if the segment [ptP ptI] intersects the segment [ptA ptB]).

Definition at line 987 of file 3d.cpp.

Here is the caller graph for this function:

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