Class Geometry utilities.
More...
#include <3d.h>
|
| 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...
|
| |
Class Geometry utilities.
Definition at line 932 of file 3d.h.
◆ boundingBox()
Computes the simple bounding box for a volume using min-max method.
- Parameters
-
| pts | An array of points defining the volume. |
| nbPts | The size of the previous array. |
| ptMin | The point with minimal values in X, Y and Z. |
| ptMax | The point with maximal values in X, Y and Z. |
Definition at line 1109 of file 3d.cpp.
◆ computeNormal()
| static void OGeometrie::computeNormal |
( |
OPoint3D * |
pts, |
|
|
int |
nbPts, |
|
|
OVector3D & |
normal |
|
) |
| |
|
static |
Computes the normal of the list of points.
- Parameters
-
| pts | An array of the points defining the volume. |
| nbPts | The size of the previous array. |
| normal | The resulting normal. |
Definition at line 1147 of file 3d.cpp.
◆ 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
-
| ptS | The point of the half segment. |
| ptA | The first point of the segment. |
| ptB | The second point of the segment. |
- Returns
- true if intersection exists, false if not.
Definition at line 915 of file 3d.cpp.
◆ intersDroitesPoints()
Calculate the intersection between two lines each defined by two points.
- Parameters
-
| ptA | A point of the first line. |
| ptB | A second point of the first line. |
| ptC | A point of the second line. |
| ptD | A second point of the second line. |
| ptI | The intersection point. |
- Returns
- INTERS_OUI (1) if intersection exists, INTERS_NULLE (0) if not.
Definition at line 938 of file 3d.cpp.
◆ intersDroitesPointVecteur()
Calculate the intersection between two lines each defined by a point and a vector.
- Parameters
-
| ptA | Point of the first line. |
| vecA | Vector for the first line. |
| ptB | Point of the second line. |
| vecB | Vector for the second line. |
| ptI | The intersection point. |
- Returns
- INTERS_OUI (1) if intersection exists, INTERS_NULLE (0) if not.
Definition at line 977 of file 3d.cpp.
◆ 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
-
| ptP | The point. |
| pts | An array containing the polygon points. |
| nbPts | The 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.
◆ 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
-
| ptP | The point. |
| pts | An array containing the polygon points. |
| nbPts | The 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.
◆ shortestSegBetween2Lines()
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
-
| pt1 | A 1st point on the 1st line. |
| pt2 | A 2nd point on the 1st line. |
| pt3 | A 1st point on the 2nd line. |
| pt4 | A 2nd point on the 2nd line. |
| ptA | The 1st point of the resulting segment. |
| ptB | The 2nd point of the resulting segment. |
| mua | The mua value result. |
| mub | The mub value result. |
- Returns
false if no solution exists, true otherwise.
Definition at line 1063 of file 3d.cpp.
◆ symPointDroite()
Calculate the symmetrical of a point with respect to a line (defined by two points).
- Parameters
-
| ptA | A point of the first line. |
| ptB | A second point of the first line. |
| ptP | The point we want the symmetrical |
| ptI | The 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.
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/code-tympan-fbessou/checkouts/latest/Tympan/models/common/3d.h
- /home/docs/checkouts/readthedocs.org/user_builds/code-tympan-fbessou/checkouts/latest/Tympan/models/common/3d.cpp