mimmo::mimmoCGUtils Namespace Reference

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]ptarget point coordinates
[in]vertCoordsvertices 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]ptarget point coordinates
[in]vertCoordsvertices of the polygon
[in]tolgeometric 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]ptarget point coordinates
[in]V0segment first vertex
[in]V1segment second vertex
[in]tolgeometric 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]ptarget point coordinates
[in]V0triangle first vertex
[in]V1triangle second vertex
[in]V2triangle third vertex
[in]tolgeometric tolerance

Definition at line 85 of file MimmoCGUtils.cpp.