Additional Utilities for Elementary Computational Geometry handling in mimmo. More...
Functions | |
double | distancePointPolygon (const darray3E &p, const dvecarr3E &vertCoords) |
bool | isPointInsidePolygon (const darray3E &p, const dvecarr3E &vertCoords, double tol) |
bool | isPointInsideSegment (const darray3E &p, const darray3E &V0, const darray3E &V1, double tol) |
bool | isPointInsideTriangle (const darray3E &p, const darray3E &V0, const darray3E &V1, const darray3E &V2, double tol) |
Detailed Description
Additional Utilities for Elementary Computational Geometry handling in mimmo.
Function Documentation
◆ distancePointPolygon()
double mimmo::mimmoCGUtils::distancePointPolygon | ( | const darray3E & | p, |
const dvecarr3E & | vertCoords | ||
) |
Custom method to compute distance from a given polygon of vertices V > 3. The polygon is subdivided in triangles using the polygon barycenter, then distances from each sub-triangle are computed. Return the minimun distance between those calculated.
- Parameters
-
[in] p target point coordinates [in] vertCoords vertices of the polygon
- Returns
- distance from the polygon
Definition at line 41 of file MimmoCGUtils.cpp.
◆ isPointInsidePolygon()
bool mimmo::mimmoCGUtils::isPointInsidePolygon | ( | const darray3E & | p, |
const dvecarr3E & | vertCoords, | ||
double | tol | ||
) |
- Returns
- true if the target point is inside a given polygon of vertices V > 3. The polygon is subdivided in triangles using the polygon barycenter, then check if inside in each sub-triangle is computed.
- Parameters
-
[in] p target point coordinates [in] vertCoords vertices of the polygon [in] tol geometric tolerance
Definition at line 109 of file MimmoCGUtils.cpp.
◆ isPointInsideSegment()
bool mimmo::mimmoCGUtils::isPointInsideSegment | ( | const darray3E & | p, |
const darray3E & | V0, | ||
const darray3E & | V1, | ||
double | tol | ||
) |
- Returns
- true if the target point is inside the segment V0-V1
- Parameters
-
[in] p target point coordinates [in] V0 segment first vertex [in] V1 segment second vertex [in] tol geometric tolerance
Definition at line 67 of file MimmoCGUtils.cpp.
◆ isPointInsideTriangle()
bool mimmo::mimmoCGUtils::isPointInsideTriangle | ( | const darray3E & | p, |
const darray3E & | V0, | ||
const darray3E & | V1, | ||
const darray3E & | V2, | ||
double | tol | ||
) |
- Returns
- true if the target point is inside the triangle V0-V1-V2
- Parameters
-
[in] p target point coordinates [in] V0 triangle first vertex [in] V1 triangle second vertex [in] V2 triangle third vertex [in] tol geometric tolerance
Definition at line 85 of file MimmoCGUtils.cpp.