Loading...
Searching...
No Matches
Elementary Computational Geometry (CGElem)
Collaboration diagram for Elementary Computational Geometry (CGElem):
const double bitpit::CGElem::DEFAULT_DISTANCE_TOLERANCE = 1.e-12
 
const double bitpit::CGElem::DEFAULT_COPLANARITY_TOLERANCE = 1.e-12
 
const std::array< std::array< int, 2 >, 12 > bitpit::CGElem::boxEdgeVertexConnectivity
 
const std::array< std::array< int, 4 >, 6 > bitpit::CGElem::boxFaceVertexConnectivity
 
bool bitpit::CGElem::validSegment (array3D const &, array3D const &)
 
bool bitpit::CGElem::validLine (array3D const &, array3D const &)
 
bool bitpit::CGElem::validPlane (array3D const &, array3D const &)
 
bool bitpit::CGElem::validTriangle (array3D const &, array3D const &, array3D const &)
 
bool bitpit::CGElem::validBarycentric (double const *, int)
 
int bitpit::CGElem::convertBarycentricToFlagSegment (std::array< double, 2 > const &, double tolerance=DEFAULT_DISTANCE_TOLERANCE)
 
int bitpit::CGElem::convertBarycentricToFlagSegment (const double *lambda, double tolerance=DEFAULT_DISTANCE_TOLERANCE)
 
int bitpit::CGElem::convertBarycentricToFlagTriangle (std::array< double, 3 > const &, double tolerance=DEFAULT_DISTANCE_TOLERANCE)
 
int bitpit::CGElem::convertBarycentricToFlagTriangle (const double *lambda, double tolerance=DEFAULT_DISTANCE_TOLERANCE)
 
int bitpit::CGElem::convertBarycentricToFlagPolygon (std::vector< double > const &, double tolerance=DEFAULT_DISTANCE_TOLERANCE)
 
int bitpit::CGElem::convertBarycentricToFlagPolygon (std::size_t, double const *, double tolerance=DEFAULT_DISTANCE_TOLERANCE)
 
void bitpit::CGElem::computeGeneralizedBarycentric (array3D const &, std::vector< array3D > const &, std::vector< double > &)
 
void bitpit::CGElem::computeGeneralizedBarycentric (array3D const &, std::size_t, array3D const *, std::vector< double > &)
 
void bitpit::CGElem::computeGeneralizedBarycentric (array3D const &, std::size_t, array3D const *, double *)
 
array3D bitpit::CGElem::reconstructPointFromBarycentricSegment (array3D const &, array3D const &, std::array< double, 2 > const &)
 
array3D bitpit::CGElem::reconstructPointFromBarycentricSegment (array3D const &, array3D const &, double const *)
 
array3D bitpit::CGElem::reconstructPointFromBarycentricTriangle (array3D const &, array3D const &, array3D const &, std::array< double, 3 > const &)
 
array3D bitpit::CGElem::reconstructPointFromBarycentricTriangle (array3D const &, array3D const &, array3D const &, double const *)
 
array3D bitpit::CGElem::rotatePoint (const array3D &P, const array3D &n0, const array3D &n1, double angle)
 
array3D bitpit::CGElem::reconstructPointFromBarycentricPolygon (std::vector< array3D > const &, std::vector< double > const &)
 
array3D bitpit::CGElem::reconstructPointFromBarycentricPolygon (std::size_t, array3D const *, std::vector< double > const &)
 
array3D bitpit::CGElem::reconstructPointFromBarycentricPolygon (std::size_t, array3D const *, double const *)
 
array3D bitpit::CGElem::projectPointLine (array3D const &, array3D const &, array3D const &)
 
array3D bitpit::CGElem::projectPointPlane (array3D const &, array3D const &, array3D const &)
 
array3D bitpit::CGElem::projectPointSegment (array3D const &, array3D const &, array3D const &)
 
array3D bitpit::CGElem::projectPointSegment (array3D const &, array3D const &, array3D const &, std::array< double, 2 > &)
 
array3D bitpit::CGElem::projectPointSegment (array3D const &, array3D const &, array3D const &, double *)
 
array3D bitpit::CGElem::projectPointTriangle (array3D const &, array3D const &, array3D const &, array3D const &)
 
array3D bitpit::CGElem::projectPointTriangle (array3D const &, array3D const &, array3D const &, array3D const &, array3D &)
 
array3D bitpit::CGElem::projectPointTriangle (array3D const &P, array3D const &Q0, array3D const &Q1, array3D const &Q2, double *lambda)
 
array3D bitpit::CGElem::restrictPointTriangle (array3D const &, array3D const &, array3D const &, array3D &)
 
array3D bitpit::CGElem::restrictPointTriangle (array3D const &, array3D const &, array3D const &, double *)
 
std::vector< array3D > bitpit::CGElem::projectCloudTriangle (std::vector< array3D > const &, array3D const &, array3D const &, array3D const &, std::vector< array3D > &)
 
array3D bitpit::CGElem::projectPointPolygon (array3D const &, std::vector< array3D > const &)
 
array3D bitpit::CGElem::projectPointPolygon (array3D const &, std::size_t, array3D const *)
 
array3D bitpit::CGElem::projectPointPolygon (array3D const &, std::vector< array3D > const &, std::vector< double > &)
 
array3D bitpit::CGElem::projectPointPolygon (array3D const &, std::size_t, array3D const *, std::vector< double > &)
 
array3D bitpit::CGElem::projectPointPolygon (array3D const &, std::size_t, array3D const *, double *)
 
array3D bitpit::CGElem::projectPointCone (array3D const &, array3D const &, array3D const &, double)
 
double bitpit::CGElem::distancePointLine (array3D const &, array3D const &, array3D const &, array3D &)
 
double bitpit::CGElem::distancePointPlane (array3D const &, array3D const &, array3D const &, array3D &)
 
double bitpit::CGElem::distancePointSegment (array3D const &, array3D const &, array3D const &)
 
double bitpit::CGElem::distancePointSegment (array3D const &, array3D const &, array3D const &, std::array< double, 2 > &)
 
double bitpit::CGElem::distancePointTriangle (array3D const &, array3D const &, array3D const &, array3D const &)
 
double bitpit::CGElem::distancePointTriangle (array3D const &, array3D const &, array3D const &, array3D const &, array3D &)
 
double bitpit::CGElem::distancePointCone (array3D const &, array3D const &, array3D const &, double)
 
std::vector< double > bitpit::CGElem::distanceCloudTriangle (std::vector< array3D > const &, array3D const &, array3D const &, array3D const &)
 
std::vector< double > bitpit::CGElem::distanceCloudTriangle (std::vector< array3D > const &, array3D const &, array3D const &, array3D const &, std::vector< array3D > &)
 
double bitpit::CGElem::distancePointPolygon (array3D const &, std::vector< array3D > const &, array3D &, int &)
 
double bitpit::CGElem::distancePointPolygon (array3D const &, std::size_t, array3D const *, array3D &, int &)
 
double bitpit::CGElem::distancePointPolygon (array3D const &, std::vector< array3D > const &)
 
double bitpit::CGElem::distancePointPolygon (array3D const &, std::size_t, array3D const *)
 
double bitpit::CGElem::distancePointPolygon (array3D const &, std::vector< array3D > const &, std::vector< double > &)
 
double bitpit::CGElem::distancePointPolygon (array3D const &, std::size_t, array3D const *, std::vector< double > &)
 
double bitpit::CGElem::distancePointPolygon (array3D const &, std::size_t, array3D const *, double *)
 
std::vector< double > bitpit::CGElem::distanceCloudPolygon (std::vector< array3D > const &, std::vector< array3D > const &, std::vector< array3D > &, std::vector< int > &)
 
std::vector< double > bitpit::CGElem::distanceCloudPolygon (std::vector< array3D > const &, std::size_t, array3D const *, std::vector< array3D > &, std::vector< int > &)
 
std::vector< double > bitpit::CGElem::distanceCloudPolygon (std::vector< array3D > const &, std::vector< array3D > const &)
 
std::vector< double > bitpit::CGElem::distanceCloudPolygon (std::vector< array3D > const &, std::size_t, array3D const *)
 
std::vector< double > bitpit::CGElem::distanceCloudPolygon (std::vector< array3D > const &, std::vector< array3D > const &, std::vector< std::vector< double > > &)
 
std::vector< double > bitpit::CGElem::distanceCloudPolygon (std::vector< array3D > const &, std::size_t, array3D const *, std::vector< std::vector< double > > &)
 
double bitpit::CGElem::distanceLineLine (array3D const &, array3D const &, array3D const &, array3D const &)
 
double bitpit::CGElem::distanceLineLine (array3D const &, array3D const &, array3D const &, array3D const &, array3D &, array3D &)
 
bool bitpit::CGElem::intersectLineLine (array3D const &, array3D const &, array3D const &, array3D const &, array3D &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectSegmentSegment (array3D const &, array3D const &, array3D const &, array3D const &, array3D &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectLinePlane (array3D const &, array3D const &, array3D const &, array3D const &, array3D &, const double coplanarityTolerance=DEFAULT_COPLANARITY_TOLERANCE)
 
bool bitpit::CGElem::intersectSegmentPlane (array3D const &, array3D const &, array3D const &, array3D const &, array3D &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectPlanePlane (array3D const &, array3D const &, array3D const &, array3D const &, array3D &, array3D &, const double coplanarityTolerance=DEFAULT_COPLANARITY_TOLERANCE)
 
bool bitpit::CGElem::intersectPlaneBox (array3D const &, array3D const &, array3D const &, array3D const &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectPlaneBox (array3D const &, array3D const &, array3D const &, array3D const &, std::vector< array3D > &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectLineTriangle (array3D const &, array3D const &, array3D const &, array3D const &, array3D const &, array3D &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectSegmentTriangle (array3D const &, array3D const &, array3D const &, array3D const &, array3D const &, array3D &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectLinePolygon (array3D const &, array3D const &, std::vector< array3D > const &, array3D &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectLinePolygon (array3D const &, array3D const &, std::size_t, array3D const *, array3D &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectSegmentPolygon (array3D const &, array3D const &, std::vector< array3D > const &, array3D &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectSegmentPolygon (array3D const &, array3D const &, std::size_t, array3D const *, array3D &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxBox (array3D const &, array3D const &, array3D const &, array3D const &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxBox (array3D const &, array3D const &, array3D const &, array3D const &, array3D &, array3D &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxTriangle (array3D const &, array3D const &, array3D const &, array3D const &, array3D const &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxTriangle (array3D const &, array3D const &, array3D const &, array3D const &, array3D const &, bool, bool, bool, std::vector< array3D > &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxTriangle (array3D const &, array3D const &, array3D const &, array3D const &, array3D const &, bool, bool, bool, std::vector< array3D > &, std::vector< int > &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectSegmentBox (array3D const &, array3D const &, array3D const &, array3D const &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectSegmentBox (array3D const &, array3D const &, array3D const &, array3D const &, bool, bool, std::vector< array3D > &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectSegmentBox (array3D const &, array3D const &, array3D const &, array3D const &, bool, bool, std::vector< array3D > &, std::vector< int > &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxPolygon (array3D const &, array3D const &, std::vector< array3D > const &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxPolygon (array3D const &, array3D const &, std::size_t, array3D const *, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxPolygon (array3D const &, array3D const &, std::vector< array3D > const &, bool, bool, bool, std::vector< array3D > &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxPolygon (array3D const &, array3D const &, std::size_t, array3D const *, bool, bool, bool, std::vector< array3D > &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxPolygon (array3D const &, array3D const &, std::vector< array3D > const &, bool, bool, bool, std::vector< array3D > &, std::vector< int > &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxPolygon (array3D const &, array3D const &, std::size_t, array3D const *, bool, bool, bool, std::vector< array3D > &, std::vector< int > &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxCircle (array3D const &A0, array3D const &A1, array3D const &centre, double radius, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectBoxSphere (array3D const &A0, array3D const &A1, array3D const &centre, double radius, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectPointLine (array3D const &, array3D const &, array3D const &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectPointSegment (array3D const &, array3D const &, array3D const &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectPointTriangle (array3D const &, array3D const &, array3D const &, array3D const &, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
bool bitpit::CGElem::intersectPointBox (array3D const &, array3D const &, array3D const &, int dim=3, const double distanceTolerance=DEFAULT_DISTANCE_TOLERANCE)
 
void bitpit::CGElem::computeAABBSegment (array3D const &, array3D const &, array3D &, array3D &)
 
void bitpit::CGElem::computeAABBTriangle (array3D const &, array3D const &, array3D const &, array3D &, array3D &)
 
void bitpit::CGElem::computeAABBPolygon (std::vector< array3D > const &, array3D &, array3D &)
 
void bitpit::CGElem::computeAABBPolygon (std::size_t, array3D const *, array3D &, array3D &)
 
void bitpit::CGElem::unionAABB (array3D const &, array3D const &, array3D const &, array3D const &, array3D &, array3D &)
 
void bitpit::CGElem::unionAABB (std::vector< array3D > const &, std::vector< array3D > const &, array3D &, array3D &)
 
void bitpit::CGElem::intersectionAABB (array3D const &, array3D const &, array3D const &, array3D const &, array3D &, array3D &)
 
void bitpit::CGElem::subtractionAABB (array3D const &, array3D const &, array3D const &, array3D const &, array3D &, array3D &)
 
void bitpit::CGElem::vertexOfSegment (int, array3D const &, array3D const &, array3D &)
 
void bitpit::CGElem::vertexOfTriangle (int, array3D const &, array3D const &, array3D const &, array3D &)
 
void bitpit::CGElem::edgeOfTriangle (int, array3D const &, array3D const &, array3D const &, array3D &, array3D &)
 
void bitpit::CGElem::faceOfBox (int, array3D const &, array3D const &, array3D &, array3D &, array3D &, array3D &)
 
void bitpit::CGElem::edgeOfBox (int, array3D const &, array3D const &, array3D &, array3D &)
 
void bitpit::CGElem::vertexOfBox (int, array3D const &, array3D const &, array3D &)
 
array3D bitpit::CGElem::rotateVector (array3D const &, array3D const &, double)
 
double bitpit::CGElem::areaTriangle (array3D const &, array3D const &, array3D const &)
 
int bitpit::CGElem::polygonEdgesCount (std::vector< array3D > const &)
 
int bitpit::CGElem::polygonEdgesCount (std::size_t, array3D const *)
 
int bitpit::CGElem::polygonSubtriangleCount (std::vector< array3D > const &)
 
int bitpit::CGElem::polygonSubtriangleCount (std::size_t, array3D const *)
 
void bitpit::CGElem::edgeOfPolygon (int, std::vector< array3D > const &, array3D &, array3D &)
 
void bitpit::CGElem::edgeOfPolygon (int, std::size_t, array3D const *, array3D &, array3D &)
 
void bitpit::CGElem::subtriangleOfPolygon (int, std::vector< array3D > const &, array3D &, array3D &, array3D &)
 
void bitpit::CGElem::subtriangleOfPolygon (int, std::size_t, array3D const *, array3D &, array3D &, array3D &)
 

Detailed Description

Function Documentation

◆ areaTriangle()

double bitpit::CGElem::areaTriangle ( array3D const & a,
array3D const & b,
array3D const & c )

computes the area of an triangle

Parameters
[in]afirst vertex coordinates
[in]bsecond vertex coordinates
[in]cthird vertex coordinates

Definition at line 2987 of file CG_elem.cpp.

◆ computeAABBPolygon() [1/2]

void bitpit::CGElem::computeAABBPolygon ( std::size_t nVS,
array3D const * VS,
array3D & P0,
array3D & P1 )

computes axis aligned boundig box of a polygon

Parameters
[in]nVSnumber of polygon vertices
[in]VSpolygon vertices coordinates
[out]P0min point of bounding box
[out]P1max point of bounding box

Definition at line 2643 of file CG_elem.cpp.

◆ computeAABBPolygon() [2/2]

void bitpit::CGElem::computeAABBPolygon ( std::vector< array3D > const & VS,
array3D & P0,
array3D & P1 )

computes axis aligned boundig box of a polygon

Parameters
[in]VSpolygon vertices coordinates
[out]P0min point of bounding box
[out]P1max point of bounding box

Definition at line 2631 of file CG_elem.cpp.

◆ computeAABBSegment()

void bitpit::CGElem::computeAABBSegment ( array3D const & A,
array3D const & B,
array3D & P0,
array3D & P1 )

computes axis aligned boundig box of a segment

Parameters
[in]Astart point of segment
[in]Bend point of segment
[out]P0min point of bounding box
[out]P1max point of bounding box

Definition at line 2587 of file CG_elem.cpp.

◆ computeAABBTriangle()

void bitpit::CGElem::computeAABBTriangle ( array3D const & A,
array3D const & B,
array3D const & C,
array3D & P0,
array3D & P1 )

computes axis aligned boundig box of a triangle

Parameters
[in]Afirst vertex of triangle
[in]Bsecond vertex of triangle
[in]Cthird vertex of triangle
[out]P0min point of bounding box
[out]P1max point of bounding box

Definition at line 2609 of file CG_elem.cpp.

◆ computeGeneralizedBarycentric() [1/3]

void bitpit::CGElem::computeGeneralizedBarycentric ( array3D const & p,
std::size_t nVertices,
array3D const * vertex,
double * lambda )

Computes Generalized Barycentric Coordinates of a point in convex polygons or polyedra. No check is performed to check convexity. Formula [6] of this paper is implemented. This formula actually refers to the method of Eugene Wachpress in the manuscript A Rational Finite Elment Basis. Generalized Barycentric Coordinates cannot be evaluated for degenerate polygons (i.e. polygons with consecutive collinear edges). No checks are performed to find out if the specified polygon is degenerate.

Parameters
[in]ppoint
[in]nVerticesnumber of polygon vertices
[in]vertexvertex coordinates of polygon
[out]lambdageneralized barycentric coordinates of p

Definition at line 788 of file CG_elem.cpp.

◆ computeGeneralizedBarycentric() [2/3]

void bitpit::CGElem::computeGeneralizedBarycentric ( array3D const & p,
std::size_t nVertices,
array3D const * vertex,
std::vector< double > & lambda )

Computes Generalized Barycentric Coordinates of a point in convex polygons or polyedra. No check is performed to check convexity. Formula [6] of this paper is implemented. This formula actually refers to the method of Eugene Wachpress in the manuscript A Rational Finite Elment Basis. Generalized Barycentric Coordinates cannot be evaluated for degenerate polygons (i.e. polygons with consecutive collinear edges). No checks are performed to find out if the specified polygon is degenerate.

Parameters
[in]ppoint
[in]nVerticesnumber of polygon vertices
[in]vertexvertex coordinates of polygon
[out]lambdageneralized barycentric coordinates of p

Definition at line 768 of file CG_elem.cpp.

◆ computeGeneralizedBarycentric() [3/3]

void bitpit::CGElem::computeGeneralizedBarycentric ( array3D const & p,
std::vector< array3D > const & vertex,
std::vector< double > & lambda )

Computes Generalized Barycentric Coordinates of a point in convex polygons or polyedra. No check is performed to check convexity. Formula [6] of this paper is implemented. This formula actually refers to the method of Eugene Wachpress in the manuscript A Rational Finite Elment Basis. Generalized Barycentric Coordinates cannot be evaluated for degenerate polygons (i.e. polygons with consecutive collinear edges). No checks are performed to find out if the specified polygon is degenerate.

Parameters
[in]ppoint
[in]vertexvertex coordinates of polygon
[out]lambdageneralized barycentric coordinates of p

Definition at line 750 of file CG_elem.cpp.

◆ convertBarycentricToFlagPolygon() [1/2]

int bitpit::CGElem::convertBarycentricToFlagPolygon ( std::size_t nLambda,
double const * lambda,
double tolerance )

Converts barycentric coordinates of a point on a convex polygon to a flag that indicates where the point lies. Flag = 0 Point lies within the simplex Flag = i Point coincides with the (ith - 1) vertex of simplex or lies within the area spanned by the edges incident in the (ith - 1) vertex Flag = -i Point lies on the edge starting from the (ith - 1) vertex and connecting the following vertex in counter-clockwise direction or in its shaddowed area

Parameters
[in]nLambdanumber of barycentric coordinates of point
[in]lambdabarycentric coordinates of point
[in]tolerancetolerance used for comparisons
Returns
flag

Definition at line 701 of file CG_elem.cpp.

◆ convertBarycentricToFlagPolygon() [2/2]

int bitpit::CGElem::convertBarycentricToFlagPolygon ( std::vector< double > const & lambda,
double tolerance )

Converts barycentric coordinates of a point on a convex polygon to a flag that indicates where the point lies. Flag = 0 Point lies within the simplex Flag = i Point coincides with the (ith - 1) vertex of simplex or lies within the area spanned by the edges incident in the (ith - 1) vertex Flag = -i Point lies on the edge starting from the (ith - 1) vertex and connecting the following vertex in counter-clockwise direction or in its shaddowed area

Parameters
[in]lambdabarycentric coordinates of point
[in]tolerancetolerance used for comparisons
Returns
flag

Definition at line 686 of file CG_elem.cpp.

◆ convertBarycentricToFlagSegment() [1/2]

int bitpit::CGElem::convertBarycentricToFlagSegment ( const double * lambda,
double tolerance )

Converts barycentric coordinates of a point on a segment to a flag that indicates where the point lies. Flag = 0 Point lies within the segment Flag = 1 Point coincides with the first vertex or is positioned befor the line Flag = 2 Point coincides with the second vertex or is positioned after the line

Parameters
[in]lambdabarycentric coordinates of point
[in]tolerancetolerance used for comparisons
Returns
flag

Definition at line 633 of file CG_elem.cpp.

◆ convertBarycentricToFlagSegment() [2/2]

int bitpit::CGElem::convertBarycentricToFlagSegment ( std::array< double, 2 > const & lambda,
double tolerance )

Converts barycentric coordinates of a point on a segment to a flag that indicates where the point lies. Flag = 0 Point lies within the segment Flag = 1 Point coincides with the first vertex or is positioned befor the line Flag = 2 Point coincides with the second vertex or is positioned after the line

Parameters
[in]lambdabarycentric coordinates of point
[in]tolerancetolerance used for comparisons
Returns
flag

Definition at line 618 of file CG_elem.cpp.

◆ convertBarycentricToFlagTriangle() [1/2]

int bitpit::CGElem::convertBarycentricToFlagTriangle ( const double * lambda,
double tolerance )

Converts barycentric coordinates of a point on a triangle to a flag that indicates where the point lies. Flag = 0 Point lies within the triangle Flag = i Point coincides with the (ith - 1) vertex of triangle or lies within the area spanned by the edges incident in the (ith - 1) vertex Flag = -i Point lies on the edge starting from the (ith - 1) vertex and connecting the following vertex in clockwise direction or in its shaddowed area

Parameters
[in]lambdabarycentric coordinates of point
[in]tolerancetolerance used for comparisons
Returns
flag

Definition at line 672 of file CG_elem.cpp.

◆ convertBarycentricToFlagTriangle() [2/2]

int bitpit::CGElem::convertBarycentricToFlagTriangle ( array3D const & lambda,
double tolerance )

Converts barycentric coordinates of a point on a triangle to a flag that indicates where the point lies. Flag = 0 Point lies within the triangle Flag = i Point coincides with the (ith - 1) vertex of triangle or lies within the area spanned by the edges incident in the (ith - 1) vertex Flag = -i Point lies on the edge starting from the (ith - 1) vertex and connecting the following vertex in clockwise direction or in its shaddowed area

Parameters
[in]lambdabarycentric coordinates of point
[in]tolerancetolerance used for comparisons
Returns
flag

Definition at line 658 of file CG_elem.cpp.

◆ distanceCloudPolygon() [1/6]

std::vector< double > bitpit::CGElem::distanceCloudPolygon ( std::vector< array3D > const & P,
std::size_t nV,
array3D const * V )

Computes distances of point cloud to a convex polygon

Parameters
[in]Ppoint cloud coordinates
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
Returns
distance

Definition at line 1653 of file CG_elem.cpp.

◆ distanceCloudPolygon() [2/6]

std::vector< double > bitpit::CGElem::distanceCloudPolygon ( std::vector< array3D > const & cloud,
std::size_t nV,
array3D const * V,
std::vector< array3D > & xP,
std::vector< int > & flag )

Computes distances of point cloud to a convex polygon

Parameters
[in]cloudpoint cloud coordinates
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
[out]xPclosest points on simplex
[out]flagpoint projecting onto polygon's interior (flag = 0), polygon's vertices (flag = 1, 2, ...) or polygon's edges (flag = -1, -2, -...)
Returns
distance

Definition at line 1611 of file CG_elem.cpp.

◆ distanceCloudPolygon() [3/6]

std::vector< double > bitpit::CGElem::distanceCloudPolygon ( std::vector< array3D > const & cloud,
std::size_t nV,
array3D const * V,
std::vector< std::vector< double > > & lambda )

Computes distances of point cloud to a convex polygon

Parameters
[in]cloudpoint cloud coordinates
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
[out]lambdabarycentric coordinates of the projection points
Returns
distance

Definition at line 1692 of file CG_elem.cpp.

◆ distanceCloudPolygon() [4/6]

std::vector< double > bitpit::CGElem::distanceCloudPolygon ( std::vector< array3D > const & P,
std::vector< array3D > const & V )

Computes distances of point cloud to a convex polygon

Parameters
[in]Ppoint cloud coordinates
[in]Vpolygon vertices coordinates
Returns
distance

Definition at line 1641 of file CG_elem.cpp.

◆ distanceCloudPolygon() [5/6]

std::vector< double > bitpit::CGElem::distanceCloudPolygon ( std::vector< array3D > const & cloud,
std::vector< array3D > const & V,
std::vector< array3D > & xP,
std::vector< int > & flag )

Computes distances of point cloud to a convex polygon

Parameters
[in]cloudpoint cloud coordinates
[in]Vpolygon vertices coordinates
[out]xPclosest points on simplex
[out]flagpoint projecting onto polygon's interior (flag = 0), polygon's vertices (flag = 1, 2, ...) or polygon's edges (flag = -1, -2, -...)
Returns
distance

Definition at line 1597 of file CG_elem.cpp.

◆ distanceCloudPolygon() [6/6]

std::vector< double > bitpit::CGElem::distanceCloudPolygon ( std::vector< array3D > const & cloud,
std::vector< array3D > const & V,
std::vector< std::vector< double > > & lambda )

Computes distances of point cloud to a convex polygon

Parameters
[in]cloudpoint cloud coordinates
[in]Vpolygon vertices coordinates
[out]lambdabarycentric coordinates of the projection points
Returns
distance

Definition at line 1679 of file CG_elem.cpp.

◆ distanceCloudTriangle() [1/2]

std::vector< double > bitpit::CGElem::distanceCloudTriangle ( std::vector< array3D > const & cloud,
array3D const & Q0,
array3D const & Q1,
array3D const & Q2 )

Computes distances of point cloud to triangle

Parameters
[in]cloudpoint cloud coordinates
[in]Q0first triangle vertex
[in]Q1second triangle vertex
[in]Q2third triangle vertex
Returns
distances

Definition at line 1452 of file CG_elem.cpp.

◆ distanceCloudTriangle() [2/2]

std::vector< double > bitpit::CGElem::distanceCloudTriangle ( std::vector< array3D > const & cloud,
array3D const & Q0,
array3D const & Q1,
array3D const & Q2,
std::vector< array3D > & lambda )

Computes distances of point cloud to triangle

Parameters
[in]cloudpoint cloud coordinates
[in]Q0first triangle vertex
[in]Q1second triangle vertex
[in]Q2third triangle vertex
[out]lambdabarycentric coordinates of projection points
Returns
distances

Definition at line 1467 of file CG_elem.cpp.

◆ distanceLineLine() [1/2]

double bitpit::CGElem::distanceLineLine ( array3D const & P0,
array3D const & n0,
array3D const & P1,
array3D const & n1 )

Computes distance between two lines in 3D

Parameters
[in]n0direction of first line
[in]P0point on first line
[in]n1direction of second line
[in]P1point on second line
Returns
distance

Definition at line 1727 of file CG_elem.cpp.

◆ distanceLineLine() [2/2]

double bitpit::CGElem::distanceLineLine ( array3D const & P0,
array3D const & n0,
array3D const & P1,
array3D const & n1,
array3D & xP0,
array3D & xP1 )

Computes distance between two lines in 3D

Parameters
[in]n0direction of first line
[in]P0point on first line
[in]n1direction of second line
[in]P1point on second line
[out]xP0projection of line1 on line0
[out]xP1projection of line0 on line1
Returns
distance

Definition at line 1743 of file CG_elem.cpp.

◆ distancePointCone()

double bitpit::CGElem::distancePointCone ( array3D const & point,
array3D const & apex,
array3D const & axis,
double alpha )

Computes distance point to semi-infinite cone surface

Parameters
[in]pointpoint coordinates
[in]apexcone apex
[in]axiscone axis
[in]alphacone half angle
Returns
distance

Definition at line 1438 of file CG_elem.cpp.

◆ distancePointLine()

double bitpit::CGElem::distancePointLine ( array3D const & P,
array3D const & Q,
array3D const & n,
array3D & xP )

Computes distance point to line in 3D

Parameters
[in]Ppoint coordinates
[in]Qpoint on line
[in]nline direction
[out]xPclosest point on line
Returns
distance

Definition at line 1354 of file CG_elem.cpp.

◆ distancePointPlane()

double bitpit::CGElem::distancePointPlane ( array3D const & P,
array3D const & Q,
array3D const & n,
array3D & xP )

Computes distance point to plane

Parameters
[in]Ppoint coordinates
[in]Qpoint on plane
[in]nplane normal
[out]xPclosest point on line
Returns
distance

Definition at line 1368 of file CG_elem.cpp.

◆ distancePointPolygon() [1/7]

double bitpit::CGElem::distancePointPolygon ( array3D const & P,
std::size_t nV,
array3D const * V )

Computes distances of point to a convex polygon

Parameters
[in]Ppoint coordinates
[in]nVnumber of polygon vertices
[in]Vsimplex vertices coordinates
Returns
distance

Definition at line 1542 of file CG_elem.cpp.

◆ distancePointPolygon() [2/7]

double bitpit::CGElem::distancePointPolygon ( array3D const & P,
std::size_t nV,
array3D const * V,
array3D & xP,
int & flag )

Computes distances of point to a convex polygon

Parameters
[in]Ppoint coordinates
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
[out]xPclosest points on polygon
[out]flagpoint projecting onto polygon's interior (flag = 0), polygon's vertices (flag = 1, 2, ...) or polygon's edges (flag = -1, -2, -...)
Returns
distance

Definition at line 1512 of file CG_elem.cpp.

◆ distancePointPolygon() [3/7]

double bitpit::CGElem::distancePointPolygon ( array3D const & P,
std::size_t nV,
array3D const * V,
double * lambda )

Computes distances of point to a convex polygon

Parameters
[in]Ppoint coordinates
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
[out]lambdabarycentric coordinates
Returns
distance

Definition at line 1583 of file CG_elem.cpp.

◆ distancePointPolygon() [4/7]

double bitpit::CGElem::distancePointPolygon ( array3D const & P,
std::size_t nV,
array3D const * V,
std::vector< double > & lambda )

Computes distances of point to a convex polygon

Parameters
[in]Ppoint coordinates
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
[out]lambdabarycentric coordinates
Returns
distance

Definition at line 1568 of file CG_elem.cpp.

◆ distancePointPolygon() [5/7]

double bitpit::CGElem::distancePointPolygon ( array3D const & P,
std::vector< array3D > const & V )

Computes distances of point to a convex polygon

Parameters
[in]Ppoint coordinates
[in]Vsimplex vertices coordinates
Returns
distance

Definition at line 1530 of file CG_elem.cpp.

◆ distancePointPolygon() [6/7]

double bitpit::CGElem::distancePointPolygon ( array3D const & P,
std::vector< array3D > const & V,
array3D & xP,
int & flag )

Computes distances of point to a convex polygon

Parameters
[in]Ppoint coordinates
[in]Vpolygon vertices coordinates
[out]xPclosest points on polygon
[out]flagpoint projecting onto polygon's interior (flag = 0), polygon's vertices (flag = 1, 2, ...) or polygon's edges (flag = -1, -2, -...)
Returns
distance

Definition at line 1498 of file CG_elem.cpp.

◆ distancePointPolygon() [7/7]

double bitpit::CGElem::distancePointPolygon ( array3D const & P,
std::vector< array3D > const & V,
std::vector< double > & lambda )

Computes distances of point to a convex polygon

Parameters
[in]Ppoint coordinates
[in]Vpolygon vertices coordinates
[out]lambdabarycentric coordinates
Returns
distance

Definition at line 1555 of file CG_elem.cpp.

◆ distancePointSegment() [1/2]

double bitpit::CGElem::distancePointSegment ( array3D const & P,
array3D const & Q0,
array3D const & Q1 )

Computes distance point to segment

Parameters
[in]Ppoint coordinates
[in]Q0segment starting point
[in]Q1segment ending point
Returns
distance

Definition at line 1381 of file CG_elem.cpp.

◆ distancePointSegment() [2/2]

double bitpit::CGElem::distancePointSegment ( array3D const & P,
array3D const & Q0,
array3D const & Q1,
std::array< double, 2 > & lambda )

Computes distance point to segment in 3D using barycentric coordinates

Parameters
[in]Ppoint coordinates
[in]Q0segment starting point
[in]Q1segment ending point
[out]lambdabarycentric coordinates
Returns
distance

Definition at line 1395 of file CG_elem.cpp.

◆ distancePointTriangle() [1/2]

double bitpit::CGElem::distancePointTriangle ( array3D const & P,
array3D const & Q0,
array3D const & Q1,
array3D const & Q2 )

Computes distance point to triangle

Parameters
[in]Ppoint coordinates
[in]Q0first triangle vertex
[in]Q1second triangle vertex
[in]Q2third triangle vertex
Returns
distance

Definition at line 1409 of file CG_elem.cpp.

◆ distancePointTriangle() [2/2]

double bitpit::CGElem::distancePointTriangle ( array3D const & P,
array3D const & Q0,
array3D const & Q1,
array3D const & Q2,
array3D & lambda )

Computes distance point to triangle

Parameters
[in]Ppoint coordinates
[in]Q0first triangle vertex
[in]Q1second triangle vertex
[in]Q2third triangle vertex
[out]lambdabarycentric coordinates of projection point
Returns
distance

Definition at line 1424 of file CG_elem.cpp.

◆ edgeOfBox()

void bitpit::CGElem::edgeOfBox ( int i,
array3D const & A0,
array3D const & A1,
array3D & P0,
array3D & P1 )

computes the edge coordiantes of a box

Parameters
[in]iedge index
[in]A0min point of bounding box
[in]A1max point of bounding box
[out]P0first vertex of edge
[out]P1first vertex of edge

Definition at line 2879 of file CG_elem.cpp.

◆ edgeOfPolygon() [1/2]

void bitpit::CGElem::edgeOfPolygon ( int edge,
std::size_t nV,
array3D const * V,
array3D & V0,
array3D & V1 )

Gets the edge coordinates of a convex polygon

Parameters
[in]edgeindex
[in]nVnumber of polygon vertices
[in]Vpolgon vertices
[in]V0first vertice coordinates of edge
[in]V1second vertice coordinates of edge

Definition at line 3064 of file CG_elem.cpp.

◆ edgeOfPolygon() [2/2]

void bitpit::CGElem::edgeOfPolygon ( int edge,
std::vector< array3D > const & V,
array3D & V0,
array3D & V1 )

Gets the edge coordinates of a convex polygon

Parameters
[in]edgeindex
[in]Vpolgon vertices
[in]V0first vertice coordinates of edge
[in]V1second vertice coordinates of edge

Definition at line 3051 of file CG_elem.cpp.

◆ edgeOfTriangle()

void bitpit::CGElem::edgeOfTriangle ( int i,
array3D const & V0,
array3D const & V1,
array3D const & V2,
array3D & P0,
array3D & P1 )

computes the edge coordiantes of a triangle

Parameters
[in]iedge index
[in]V0first vertex of triangle
[in]V1second vertex of triangle
[in]V2third vertex of triangle
[out]P0first vertex of edge
[out]P1first vertex of edge

Definition at line 2816 of file CG_elem.cpp.

◆ faceOfBox()

void bitpit::CGElem::faceOfBox ( int i,
array3D const & A0,
array3D const & A1,
array3D & P0,
array3D & P1,
array3D & P2,
array3D & P3 )

computes the face coordiantes of a box

Parameters
[in]iface index
[in]A0min point of bounding box
[in]A1max point of bounding box
[out]P0first vertex of face
[out]P1first vertex of face
[out]P2first vertex of face
[out]P3first vertex of face

Definition at line 2853 of file CG_elem.cpp.

◆ intersectBoxBox() [1/2]

bool bitpit::CGElem::intersectBoxBox ( array3D const & A1,
array3D const & A2,
array3D const & B1,
array3D const & B2,
array3D & I1,
array3D & I2,
int dim,
const double distanceTolerance )

Computes intersection between two axis aligned bounding boxes

Parameters
[in]A1min point of first box
[in]A2max point of first box
[in]B1min point of second box
[in]B2max point of second box
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]I1min point of intersection box
[out]I2max point of intersection box
[in]dimnumber of dimensions to be checked
Returns
if intersect

Definition at line 2148 of file CG_elem.cpp.

◆ intersectBoxBox() [2/2]

bool bitpit::CGElem::intersectBoxBox ( array3D const & A1,
array3D const & A2,
array3D const & B1,
array3D const & B2,
int dim,
const double distanceTolerance )

Computes intersection between two axis aligned bounding boxes

Parameters
[in]A1min point of first box
[in]A2max point of first box
[in]B1min point of second box
[in]B2max point of second box
[in]dimnumber of dimensions to be checked
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if intersect

Definition at line 2125 of file CG_elem.cpp.

◆ intersectBoxCircle()

bool bitpit::CGElem::intersectBoxCircle ( array3D const & A0,
array3D const & A1,
array3D const & centre,
double radius,
const double distanceTolerance )

Checks it the axis aligned bounding box intersects the circle.

Parameters
[in]A0min point of box
[in]A1max point of box
[in]centreis the centre of the circle
[in]radiusis the radius of the circle
[in]distanceToleranceis the tolerance used to checking the intersection
Returns
Returns true if the box intersects the circle, false otherwise.

Definition at line 2390 of file CG_elem.cpp.

◆ intersectBoxPolygon() [1/6]

bool bitpit::CGElem::intersectBoxPolygon ( array3D const & A0,
array3D const & A1,
std::size_t nVS,
array3D const * VS,
bool innerPolygonPoints,
bool polygonEdgeBoxFaceIntersections,
bool polygonBoxEdgeIntersections,
std::vector< array3D > & P,
int dim,
const double distanceTolerance )

Computes intersection between an axis aligned bounding box and a convex polygon

Parameters
[in]A0min point of first box
[in]A1max point of first box
[in]nVSnumber of polygon vertices
[in]VSpolygon vertices coordinates
[in]innerPolygonPointssimplex vertices within the box should be added to the intersection list
[in]polygonEdgeBoxFaceIntersectionsintersection between the edges of the polygon and the hull of the box should be added to the intersection list
[in]polygonBoxEdgeIntersectionsintersection between the polygon and the edges of the box should be added to the intersection list
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Pcalculated intersection points
[in]dimnumber of dimensions to be checked
Returns
if intersect

Definition at line 2336 of file CG_elem.cpp.

◆ intersectBoxPolygon() [2/6]

bool bitpit::CGElem::intersectBoxPolygon ( array3D const & A0,
array3D const & A1,
std::size_t nVS,
array3D const * VS,
bool innerPolygonPoints,
bool polygonEdgeBoxFaceIntersections,
bool polygonBoxEdgeIntersections,
std::vector< array3D > & P,
std::vector< int > & flag,
int dim,
const double distanceTolerance )

Computes intersection between an axis aligned bounding box and a simplex

Parameters
[in]A0min point of first box
[in]A1max point of first box
[in]nVSnumber of polygon vertices
[in]VSsimplex vertices coordinates
[in]innerPolygonPointssimplex vertices within the box should be added to the intersection list
[in]polygonEdgeBoxFaceIntersectionsintersection between the edges of the polygon and the hull of the box should be added to the intersection list
[in]polygonBoxEdgeIntersectionsintersection between the polygon and the edges of the box should be added to the intersection list
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Pcalculated intersection points
[out]flaghas the same size of P. If the ith flag=0, the intersection is due to innerPolygonPoints. If the ith flag=1, the intersection is due to polygonEdgeBoxFaceIntersections. If the ith flag=2, the intersection is due to polygonBoxEdgeIntersections.
[in]dimnumber of dimensions to be checked
Returns
if intersect

Definition at line 2375 of file CG_elem.cpp.

◆ intersectBoxPolygon() [3/6]

bool bitpit::CGElem::intersectBoxPolygon ( array3D const & A0,
array3D const & A1,
std::size_t nVS,
array3D const * VS,
int dim,
const double distanceTolerance )

Computes intersection between an axis aligned bounding box and a simplex

Parameters
[in]A0min point of first box
[in]A1max point of first box
[in]nVSnumber of polygon vertices
[in]VSsimplex vertices coordinates
[in]dimnumber of dimensions to be checked
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if intersect

Definition at line 2298 of file CG_elem.cpp.

◆ intersectBoxPolygon() [4/6]

bool bitpit::CGElem::intersectBoxPolygon ( array3D const & A0,
array3D const & A1,
std::vector< array3D > const & VS,
bool innerPolygonPoints,
bool polygonEdgeBoxFaceIntersections,
bool polygonBoxEdgeIntersections,
std::vector< array3D > & P,
int dim,
const double distanceTolerance )

Computes intersection between an axis aligned bounding box and a convex polygon

Parameters
[in]A0min point of first box
[in]A1max point of first box
[in]VSpolygon vertices coordinates
[in]innerPolygonPointssimplex vertices within the box should be added to the intersection list
[in]polygonEdgeBoxFaceIntersectionsintersection between the edges of the polygon and the hull of the box should be added to the intersection list
[in]polygonBoxEdgeIntersectionsintersection between the polygon and the edges of the box should be added to the intersection list
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Pcalculated intersection points
[in]dimnumber of dimensions to be checked
Returns
if intersect

Definition at line 2316 of file CG_elem.cpp.

◆ intersectBoxPolygon() [5/6]

bool bitpit::CGElem::intersectBoxPolygon ( array3D const & A0,
array3D const & A1,
std::vector< array3D > const & VS,
bool innerPolygonPoints,
bool polygonEdgeBoxFaceIntersections,
bool polygonBoxEdgeIntersections,
std::vector< array3D > & P,
std::vector< int > & flag,
int dim,
const double distanceTolerance )

Computes intersection between an axis aligned bounding box and a simplex

Parameters
[in]A0min point of first box
[in]A1max point of first box
[in]VSsimplex vertices coordinates
[in]innerPolygonPointssimplex vertices within the box should be added to the intersection list
[in]polygonEdgeBoxFaceIntersectionsintersection between the edges of the polygon and the hull of the box should be added to the intersection list
[in]polygonBoxEdgeIntersectionsintersection between the polygon and the edges of the box should be added to the intersection list
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Pcalculated intersection points
[out]flaghas the same size of P. If the ith flag=0, the intersection is due to innerPolygonPoints. If the ith flag=1, the intersection is due to polygonEdgeBoxFaceIntersections. If the ith flag=2, the intersection is due to polygonBoxEdgeIntersections.
[in]dimnumber of dimensions to be checked
Returns
if intersect

Definition at line 2355 of file CG_elem.cpp.

◆ intersectBoxPolygon() [6/6]

bool bitpit::CGElem::intersectBoxPolygon ( array3D const & A0,
array3D const & A1,
std::vector< array3D > const & VS,
int dim,
const double distanceTolerance )

Computes intersection between an axis aligned bounding box and a simplex

Parameters
[in]A0min point of first box
[in]A1max point of first box
[in]VSsimplex vertices coordinates
[in]dimnumber of dimensions to be checked
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if intersect

Definition at line 2284 of file CG_elem.cpp.

◆ intersectBoxSphere()

bool bitpit::CGElem::intersectBoxSphere ( array3D const & A0,
array3D const & A1,
array3D const & centre,
double radius,
const double distanceTolerance )

Checks it the axis aligned bounding box intersects the sphere.

Parameters
[in]A0min point of box
[in]A1max point of box
[in]centreis the centre of the sphere
[in]radiusis the radius of the sphere
[in]distanceToleranceis the tolerance used to checking the intersection
Returns
Returns true if the box intersects the sphere, false otherwise.

Definition at line 2416 of file CG_elem.cpp.

◆ intersectBoxTriangle() [1/3]

bool bitpit::CGElem::intersectBoxTriangle ( array3D const & A0,
array3D const & A1,
array3D const & V0,
array3D const & V1,
array3D const & V2,
bool interiorTriangleVertices,
bool triangleEdgeBoxFaceIntersections,
bool triangleBoxEdgeIntersections,
std::vector< array3D > & P,
int dim,
const double distanceTolerance )

Checks if an axis aligned bounding box and a triangle intersect

Parameters
[in]A0min point of box
[in]A1max point of box
[in]V0first vertex of triangle
[in]V1second vertex of triangle
[in]V2third vertex of triangle
[in]interiorTriangleVerticesif true, all triangle vertices within the box will be added to the intersection points P
[in]triangleEdgeBoxFaceIntersectionsif true, the intersections between the edges of the triangle and the hull of the box will be added to the intersection points P
[in]triangleBoxEdgeIntersectionsif true, the intersections between the edges (dim=3) or vertices (dim=2) of the box and the triangle will be added to the intersection points P
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Pcalculated intersection points
[in]dimnumber of dimensions to be checked
Returns
if intersect

Definition at line 2197 of file CG_elem.cpp.

◆ intersectBoxTriangle() [2/3]

bool bitpit::CGElem::intersectBoxTriangle ( array3D const & A0,
array3D const & A1,
array3D const & V0,
array3D const & V1,
array3D const & V2,
bool interiorTriangleVertices,
bool triangleEdgeBoxHullIntersections,
bool triangleBoxEdgeIntersections,
std::vector< array3D > & P,
std::vector< int > & flag,
int dim,
const double distanceTolerance )

Checks if an axis aligned bounding box and a triangle intersect

Parameters
[in]A0min point of box
[in]A1max point of box
[in]V0first vertex of triangle
[in]V1second vertex of triangle
[in]V2third vertex of triangle
[in]interiorTriangleVerticesif true, all triangle vertices within the box will be added to the intersection points P
[in]triangleEdgeBoxHullIntersectionsif true, the intersections between the edges of the triangle and the outer hull of the box will be added to the intersection points P
[in]triangleBoxEdgeIntersectionsif true, the intersections between the edges (dim=3) or vertices (dim=2) of the box and the triangle will be added to the intersection points P
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Pcalculated intersection points
[out]flaghas the same size of P. If the ith flag=0, the intersection is due to interiorTriangleVertices. If the ith flag=1, the intersection is due to triangleEdgeBoxHullIntersection. If the ith flag=2, the intersection is due to triangleBoxEdgeIntersections.
[in]dimnumber of dimensions to be checked
Returns
if intersect

Definition at line 2218 of file CG_elem.cpp.

◆ intersectBoxTriangle() [3/3]

bool bitpit::CGElem::intersectBoxTriangle ( array3D const & A0,
array3D const & A1,
array3D const & V0,
array3D const & V1,
array3D const & V2,
int dim,
const double distanceTolerance )

Checks if an axis aligned bounding box and a triangle intersect

Parameters
[in]A0min point of box
[in]A1max point of box
[in]V0first vertex of triangle
[in]V1second vertex of triangle
[in]V2third vertex of triangle
[in]dimnumber of dimensions to be checked
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if intersect

Definition at line 2177 of file CG_elem.cpp.

◆ intersectionAABB()

void bitpit::CGElem::intersectionAABB ( array3D const & A0,
array3D const & A1,
array3D const & B0,
array3D const & B1,
array3D & C0,
array3D & C1 )

computes the bounding box of the intersection of two axis aligned bounding boxes

Parameters
[in]A0min point of first bounding box
[in]A1max point of first bounding box
[in]B0min point of second bounding box
[in]B1max point of second bounding box
[out]C0min point of intersection of boxes
[out]C1max point of intersection of boxes

Definition at line 2710 of file CG_elem.cpp.

◆ intersectLineLine()

bool bitpit::CGElem::intersectLineLine ( array3D const & P1,
array3D const & n1,
array3D const & P2,
array3D const & n2,
array3D & P,
double distanceTolerance )

Computes intersection between two lines in 3D

Parameters
[in]n1direction of first line
[in]P1point on first line
[in]n2direction of second line
[in]P2point on second line
[out]Pintersection point if intersect, else unaltered
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if intersect

Definition at line 1785 of file CG_elem.cpp.

◆ intersectLinePlane()

bool bitpit::CGElem::intersectLinePlane ( array3D const & P1,
array3D const & n1,
array3D const & P2,
array3D const & n2,
array3D & P,
const double coplanarityTolerance )

Computes intersection between line and plane

Parameters
[in]P1point on line
[in]n1direction of line
[in]P2point on plane
[in]n2normal to plane
[in]coplanarityToleranceif angle between the line and plane is less than this value, they are considered as coplanar and not intersecting
[out]Pintersection point if intersect, else unaltered
Returns
if intersect

Definition at line 1837 of file CG_elem.cpp.

◆ intersectLinePolygon() [1/2]

bool bitpit::CGElem::intersectLinePolygon ( array3D const & P,
array3D const & n,
std::size_t nV,
array3D const * V,
array3D & Q,
const double distanceTolerance )

Computes intersection between triangle and a convex polygon

Parameters
[in]Ppoint on line
[in]ndirection of line
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Qintersection point
Returns
if intersect

Definition at line 2055 of file CG_elem.cpp.

◆ intersectLinePolygon() [2/2]

bool bitpit::CGElem::intersectLinePolygon ( array3D const & P,
array3D const & n,
std::vector< array3D > const & V,
array3D & Q,
const double distanceTolerance )

Computes intersection between triangle and a convex polygon

Parameters
[in]Ppoint on line
[in]ndirection of line
[in]Vpolygon vertices coordinates
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Qintersection point
Returns
if intersect

Definition at line 2040 of file CG_elem.cpp.

◆ intersectLineTriangle()

bool bitpit::CGElem::intersectLineTriangle ( array3D const & P,
array3D const & n,
array3D const & A,
array3D const & B,
array3D const & C,
array3D & Q,
const double distanceTolerance )

Computes intersection between triangle and a line

Parameters
[in]Ppoint on plane
[in]nnormal to plane
[in]Afirst vertex of triangle
[in]Bsecond vertex of triangle
[in]Cthird vertex of triangle
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Qintersection point
Returns
if intersect

Definition at line 1986 of file CG_elem.cpp.

◆ intersectPlaneBox() [1/2]

bool bitpit::CGElem::intersectPlaneBox ( array3D const & P1,
array3D const & n1,
array3D const & A0,
array3D const & A1,
int dim,
const double distanceTolerance )

Computes if plane a box intersect

Parameters
[in]P1point on first plane
[in]n1normal to first plane
[in]A0min point of box
[in]A1max point of box
[in]dimnumber of dimensions
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if intersect

Definition at line 1952 of file CG_elem.cpp.

◆ intersectPlaneBox() [2/2]

bool bitpit::CGElem::intersectPlaneBox ( array3D const & P1,
array3D const & n1,
array3D const & A0,
array3D const & A1,
std::vector< array3D > & intersects,
int dim,
const double distanceTolerance )

Computes if plane a box intersect and intersection points between plane and edges of box

Parameters
[in]P1point on first plane
[in]n1normal to first plane
[in]A0min point of box
[in]A1max point of box
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]intersectsintersection points
[in]dimnumber of dimensions
Returns
if intersect

Definition at line 1969 of file CG_elem.cpp.

◆ intersectPlanePlane()

bool bitpit::CGElem::intersectPlanePlane ( array3D const & P1,
array3D const & n1,
array3D const & P2,
array3D const & n2,
array3D & Pl,
array3D & nl,
const double coplanarityTolerance )

Computes intersection between two planes

Parameters
[in]P1point on first plane
[in]n1normal to first plane
[in]P2point on second plane
[in]n2normal to second plane
[out]Plpoint on intersection line
[out]nldirection of intersection line
[in]coplanarityToleranceif angle between planes is less than this value, they are considered as coplanar and not intersecting
Returns
if intersect

Definition at line 1900 of file CG_elem.cpp.

◆ intersectPointBox()

bool bitpit::CGElem::intersectPointBox ( array3D const & P,
array3D const & B1,
array3D const & B2,
int dim,
const double distanceTolerance )

checks if points lies within axis aligned box

Parameters
[in]Ppoint coordinates
[in]B1min coodinates of box
[in]B2max coodinates of box
[in]dimnumber of dimensions to be checked
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if point in box

Definition at line 2568 of file CG_elem.cpp.

◆ intersectPointLine()

bool bitpit::CGElem::intersectPointLine ( array3D const & P,
array3D const & Q,
array3D const & n,
const double distanceTolerance )

checks if points lies on line defined by two given points in 3D

Parameters
[in]Ppoint coordinates
[in]Qpoint on line
[in]nline direction
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if point lies on segment

Definition at line 2510 of file CG_elem.cpp.

◆ intersectPointSegment()

bool bitpit::CGElem::intersectPointSegment ( array3D const & P,
array3D const & P1,
array3D const & P2,
const double distanceTolerance )

checks if points lies on segment in 3D

Parameters
[in]Ppoint coordinates
[in]P1start point of segment
[in]P2end point of segment
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if point lies on segment

Definition at line 2530 of file CG_elem.cpp.

◆ intersectPointTriangle()

bool bitpit::CGElem::intersectPointTriangle ( array3D const & P,
array3D const & A,
array3D const & B,
array3D const & C,
const double distanceTolerance )

checks if points lies on triangle

Parameters
[in]Ppoint coordinates
[in]Afirst vertex of triangle
[in]Bsecond vertex of triangle
[in]Cthird vertex of triangle
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if point lies on triangle

Definition at line 2549 of file CG_elem.cpp.

◆ intersectSegmentBox() [1/3]

bool bitpit::CGElem::intersectSegmentBox ( array3D const & V0,
array3D const & V1,
array3D const & A0,
array3D const & A1,
bool interiorSegmentVertice,
bool segmentBoxHullIntersection,
std::vector< array3D > & P,
int dim,
const double distanceTolerance )

Computes intersection between an axis aligned bounding box and a segment

Parameters
[in]V0start point of segment
[in]V1end point of segment
[in]A0min point of box
[in]A1max point of box
[in]interiorSegmentVerticeif the segment vertices within the box should be added to the list of intersection points
[in]segmentBoxHullIntersectionif the intersections between the segment and the outer hull of the box should be added to the list of intersection points
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Plist of intersection points. If no intersetion points should be calculated nullptr can be passed as argument
[in]dimnumber of dimensions to be checked
Returns
if intersect

Definition at line 2251 of file CG_elem.cpp.

◆ intersectSegmentBox() [2/3]

bool bitpit::CGElem::intersectSegmentBox ( array3D const & V0,
array3D const & V1,
array3D const & A0,
array3D const & A1,
bool interiorSegmentVertice,
bool segmentBoxHullIntersection,
std::vector< array3D > & P,
std::vector< int > & flag,
int dim,
const double distanceTolerance )

Computes intersection between an axis aligned bounding box and a segment

Parameters
[in]V0start point of segment
[in]V1end point of segment
[in]A0min point of box
[in]A1max point of box
[in]interiorSegmentVerticeif the segment vertices within the box should be added to the list of intersection points
[in]segmentBoxHullIntersectionif the intersections between the segment and the outer hull of the box should be added to the list of intersection points
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Plist of intersection points. If no intersetion points should be calculated nullptr can be passed as argument
[out]flagindicates for each intersection if it belongs to interiorSegmentVertice (flag=0) or segmentHullIntersection (flag=1)
[in]dimnumber of dimensions to be checked
Returns
if intersect

Definition at line 2270 of file CG_elem.cpp.

◆ intersectSegmentBox() [3/3]

bool bitpit::CGElem::intersectSegmentBox ( array3D const & V0,
array3D const & V1,
array3D const & A0,
array3D const & A1,
int dim,
const double distanceTolerance )

Computes intersection between an axis aligned bounding box and a segment

Parameters
[in]V0start point of segment
[in]V1end point of segment
[in]A0min point of box
[in]A1max point of box
[in]dimnumber of dimensions to be checked
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
Returns
if intersect

Definition at line 2233 of file CG_elem.cpp.

◆ intersectSegmentPlane()

bool bitpit::CGElem::intersectSegmentPlane ( array3D const & Q1,
array3D const & Q2,
array3D const & P2,
array3D const & n2,
array3D & P,
const double distanceTolerance )

Computes intersection between segment and plane

Parameters
[in]Q1start point of segment
[in]Q2end point of segment
[in]P2point on plane
[in]n2normal to plane
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Pintersection point if intersect, else unaltered
Returns
if intersect

Definition at line 1870 of file CG_elem.cpp.

◆ intersectSegmentPolygon() [1/2]

bool bitpit::CGElem::intersectSegmentPolygon ( array3D const & P0,
array3D const & P1,
std::size_t nV,
array3D const * V,
array3D & Q,
const double distanceTolerance )

Computes intersection between a segment and a polygon

Parameters
[in]P0start point of segment
[in]P1end point of segment
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Qintersection point
Returns
if intersect

Definition at line 2097 of file CG_elem.cpp.

◆ intersectSegmentPolygon() [2/2]

bool bitpit::CGElem::intersectSegmentPolygon ( array3D const & P0,
array3D const & P1,
std::vector< array3D > const & V,
array3D & Q,
const double distanceTolerance )

Computes intersection between a segment and a polygon

Parameters
[in]P0start point of segment
[in]P1end point of segment
[in]Vpolygon vertices coordinates
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Qintersection point
Returns
if intersect

Definition at line 2082 of file CG_elem.cpp.

◆ intersectSegmentSegment()

bool bitpit::CGElem::intersectSegmentSegment ( array3D const & P1,
array3D const & P2,
array3D const & Q1,
array3D const & Q2,
array3D & x,
double distanceTolerance )

Computes intersection between two segments in 3D

Parameters
[in]P1start point of first segment
[in]P2end point of first segment
[in]Q1start point of second segment
[in]Q2end point of second segment
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]xintersection point if intersect, else unaltered
Returns
if intersect

Definition at line 1806 of file CG_elem.cpp.

◆ intersectSegmentTriangle()

bool bitpit::CGElem::intersectSegmentTriangle ( array3D const & P0,
array3D const & P1,
array3D const & A,
array3D const & B,
array3D const & C,
array3D & Q,
const double distanceTolerance )

Computes intersection between triangle and a segment

Parameters
[in]P0start point of segment
[in]P1end point of segment
[in]Afirst vertex of triangle
[in]Bsecond vertex of triangle
[in]Cthird vertex of triangle
[in]distanceToleranceif distance among features exceed this value they are considered as not intersecting
[out]Qintersection point
Returns
if intersect

Definition at line 2014 of file CG_elem.cpp.

◆ polygonEdgesCount() [1/2]

int bitpit::CGElem::polygonEdgesCount ( std::size_t nV,
array3D const * V )

Gets the number of edges of a polygon

Parameters
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
Returns
number of edges

Definition at line 3007 of file CG_elem.cpp.

◆ polygonEdgesCount() [2/2]

int bitpit::CGElem::polygonEdgesCount ( std::vector< array3D > const & V)

Gets the number of edges of a polygon

Returns
number of edges

Definition at line 2996 of file CG_elem.cpp.

◆ polygonSubtriangleCount() [1/2]

int bitpit::CGElem::polygonSubtriangleCount ( std::size_t nV,
array3D const * V )

Gets the number of subtriangles of a polygon

See subtriangleOfPolygon(int triangle, std::size_t nV, array3D const *V, array3D &V0, array3D &V1, array3D &V2) for an explanation of how a polygon is divided in triangles.

Parameters
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
Returns
number of subtriangles

Definition at line 3037 of file CG_elem.cpp.

◆ polygonSubtriangleCount() [2/2]

int bitpit::CGElem::polygonSubtriangleCount ( std::vector< array3D > const & V)

Gets the number of subtriangles of a polygon

See subtriangleOfPolygon(int triangle, std::vector<array3D> const &V, array3D &V0, array3D &V1, array3D &V2) for an explanation of how a polygon is divided in triangles.

Returns
number of subtriangles

Definition at line 3022 of file CG_elem.cpp.

◆ projectCloudTriangle()

std::vector< array3D > bitpit::CGElem::projectCloudTriangle ( std::vector< array3D > const & cloud,
array3D const & Q0,
array3D const & Q1,
array3D const & Q2,
std::vector< array3D > & lambda )

Projects a point cloud onto a triangle. Projection points are the closest points to the original points within the triangle.

Parameters
[in]cloudpoint cloud coordinates
[in]Q0first triangle vertex
[in]Q1second triangle vertex
[in]Q2third triangle vertex
[in,out]lambdabarycentric coordinates of projection points
Returns
distances

Definition at line 1193 of file CG_elem.cpp.

◆ projectPointCone()

array3D bitpit::CGElem::projectPointCone ( array3D const & point,
array3D const & apex,
array3D const & axis,
double alpha )

Computes projection point on semi-infinite cone surface

Parameters
[in]pointpoint coordinates
[in]apexcone apex
[in]axiscone axis
[in]alphacone half angle
Returns
projection point

Definition at line 1313 of file CG_elem.cpp.

◆ projectPointLine()

array3D bitpit::CGElem::projectPointLine ( array3D const & P,
array3D const & Q,
array3D const & n )

Computes projection of point on line in 3D

Parameters
[in]Ppoint coordinates
[in]Qpoint on line
[in]nline direction
Returns
projection point

Definition at line 970 of file CG_elem.cpp.

◆ projectPointPlane()

array3D bitpit::CGElem::projectPointPlane ( array3D const & P,
array3D const & Q,
array3D const & n )

Computes projection of point on line in 3D

Parameters
[in]Ppoint coordinates
[in]Qpoint on plane
[in]nplane normal
Returns
projection point

Definition at line 983 of file CG_elem.cpp.

◆ projectPointPolygon() [1/5]

array3D bitpit::CGElem::projectPointPolygon ( array3D const & P,
std::size_t nV,
array3D const * V )

Computes projection of point onto a convex polygon

Parameters
[in]Ppoint coordinates
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
Returns
coordinates of projection point

Definition at line 1226 of file CG_elem.cpp.

◆ projectPointPolygon() [2/5]

array3D bitpit::CGElem::projectPointPolygon ( array3D const & P,
std::size_t nV,
array3D const * V,
double * lambda )

Computes projection of point onto a convex polygon

Parameters
[in]Ppoint coordinates
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
[out]lambdabaycentric coordinates of projection point
Returns
coordinates of projection point

Definition at line 1267 of file CG_elem.cpp.

◆ projectPointPolygon() [3/5]

array3D bitpit::CGElem::projectPointPolygon ( array3D const & P,
std::size_t nV,
array3D const * V,
std::vector< double > & lambda )

Computes projection of point onto a convex polygon

Parameters
[in]Ppoint coordinates
[in]nVnumber of polygon vertices
[in]Vpolygon vertices coordinates
[out]lambdabaycentric coordinates of projection point
Returns
coordinates of projection point

Definition at line 1252 of file CG_elem.cpp.

◆ projectPointPolygon() [4/5]

array3D bitpit::CGElem::projectPointPolygon ( array3D const & P,
std::vector< array3D > const & V )

Computes projection of point onto a convex polygon

Parameters
[in]Ppoint coordinates
[in]Vpolygon vertices coordinates
Returns
coordinates of projection point

Definition at line 1214 of file CG_elem.cpp.

◆ projectPointPolygon() [5/5]

array3D bitpit::CGElem::projectPointPolygon ( array3D const & P,
std::vector< array3D > const & V,
std::vector< double > & lambda )

Computes projection of point onto a convex polygon

Parameters
[in]Ppoint coordinates
[in]Vpolygon vertices coordinates
[out]lambdabaycentric coordinates of projection point
Returns
coordinates of projection point

Definition at line 1239 of file CG_elem.cpp.

◆ projectPointSegment() [1/3]

array3D bitpit::CGElem::projectPointSegment ( array3D const & P,
array3D const & Q0,
array3D const & Q1 )

Computes projection of point on line in 3D

Parameters
[in]Ppoint coordinates
[in]Q0first line vertex
[in]Q1second line vertex
Returns
projection point

Definition at line 996 of file CG_elem.cpp.

◆ projectPointSegment() [2/3]

array3D bitpit::CGElem::projectPointSegment ( array3D const & P,
array3D const & Q0,
array3D const & Q1,
double * lambda )

Computes projection of point on line in 3D

Parameters
[in]Ppoint coordinates
[in]Q0first line vertex
[in]Q1second line vertex
[out]lambdabarycentric coordinates of projection point
Returns
projection point

Definition at line 1024 of file CG_elem.cpp.

◆ projectPointSegment() [3/3]

array3D bitpit::CGElem::projectPointSegment ( array3D const & P,
array3D const & Q0,
array3D const & Q1,
std::array< double, 2 > & lambda )

Computes projection of point on line in 3D

Parameters
[in]Ppoint coordinates
[in]Q0first line vertex
[in]Q1second line vertex
[out]lambdabarycentric coordinates of projection point
Returns
projection point

Definition at line 1011 of file CG_elem.cpp.

◆ projectPointTriangle() [1/3]

array3D bitpit::CGElem::projectPointTriangle ( array3D const & P,
array3D const & Q0,
array3D const & Q1,
array3D const & Q2 )

Computes projection of point on triangle

Parameters
[in]Ppoint coordinates
[in]Q0first triangle vertex
[in]Q1second triangle vertex
[in]Q2third triangle vertex
Returns
coordinates of projection point

Definition at line 1049 of file CG_elem.cpp.

◆ projectPointTriangle() [2/3]

array3D bitpit::CGElem::projectPointTriangle ( array3D const & P,
array3D const & Q0,
array3D const & Q1,
array3D const & Q2,
array3D & lambda )

Computes projection of point on triangle

Parameters
[in]Ppoint coordinates
[in]Q0first triangle vertex
[in]Q1second triangle vertex
[in]Q2third triangle vertex
[out]lambdabarycentric coordinates of projection point
Returns
coordinates of projection point

Definition at line 1066 of file CG_elem.cpp.

◆ projectPointTriangle() [3/3]

array3D bitpit::CGElem::projectPointTriangle ( array3D const & P,
array3D const & Q0,
array3D const & Q1,
array3D const & Q2,
double * lambda )

Computes projection of point on triangle

Parameters
[in]Ppoint coordinates
[in]Q0first triangle vertex
[in]Q1second triangle vertex
[in]Q2third triangle vertex
[out]lambdabarycentric coordinates of projection point
Returns
coordinates of projection point

Definition at line 1080 of file CG_elem.cpp.

◆ reconstructPointFromBarycentricPolygon() [1/3]

array3D bitpit::CGElem::reconstructPointFromBarycentricPolygon ( std::size_t nV,
array3D const * V,
double const * lambda )

Reconstructs a point from barycentric coordinates of a polygon

Parameters
[in]nVnumber of polygon vertices
[in]Vvertices of simplex
[in]lambdabarycentric coordinates
Returns
reconstructed Point

Definition at line 951 of file CG_elem.cpp.

◆ reconstructPointFromBarycentricPolygon() [2/3]

array3D bitpit::CGElem::reconstructPointFromBarycentricPolygon ( std::size_t nV,
array3D const * V,
std::vector< double > const & lambda )

Reconstructs a point from barycentric coordinates of a polygon

Parameters
[in]nVnumber of polygon vertices
[in]Vvertices of simplex
[in]lambdabarycentric coordinates
Returns
reconstructed Point

Definition at line 939 of file CG_elem.cpp.

◆ reconstructPointFromBarycentricPolygon() [3/3]

array3D bitpit::CGElem::reconstructPointFromBarycentricPolygon ( std::vector< array3D > const & V,
std::vector< double > const & lambda )

Reconstructs a point from barycentric coordinates of a polygon

Parameters
[in]Vvertices of simplex
[in]lambdabarycentric coordinates
Returns
reconstructed Point

Definition at line 927 of file CG_elem.cpp.

◆ reconstructPointFromBarycentricSegment() [1/2]

array3D bitpit::CGElem::reconstructPointFromBarycentricSegment ( array3D const & Q0,
array3D const & Q1,
double const * lambda )

Reconstructs a point from barycentric coordinates of a segment

Parameters
[in]Q0first vertex of segment
[in]Q1second vertex of segment
[in]lambdabarycentric coordinates
Returns
The reconstructed point

Definition at line 842 of file CG_elem.cpp.

◆ reconstructPointFromBarycentricSegment() [2/2]

array3D bitpit::CGElem::reconstructPointFromBarycentricSegment ( array3D const & Q0,
array3D const & Q1,
std::array< double, 2 > const & lambda )

Reconstructs a point from barycentric coordinates of a segment

Parameters
[in]Q0first vertex of segment
[in]Q1second vertex of segment
[in]lambdabarycentric coordinates
Returns
The reconstructed point

Definition at line 828 of file CG_elem.cpp.

◆ reconstructPointFromBarycentricTriangle() [1/2]

array3D bitpit::CGElem::reconstructPointFromBarycentricTriangle ( array3D const & Q0,
array3D const & Q1,
array3D const & Q2,
double const * lambda )

Reconstructs a point from barycentric coordinates of a triangle

Parameters
[in]Q0first vertex of triangle
[in]Q1second vertex of triangle
[in]Q2third vertex of triangle
[in]lambdabarycentric coordinates
Returns
The reconstructed point

Definition at line 872 of file CG_elem.cpp.

◆ reconstructPointFromBarycentricTriangle() [2/2]

array3D bitpit::CGElem::reconstructPointFromBarycentricTriangle ( array3D const & Q0,
array3D const & Q1,
array3D const & Q2,
array3D const & lambda )

Reconstructs a point from barycentric coordinates of a triangle

Parameters
[in]Q0first vertex of triangle
[in]Q1second vertex of triangle
[in]Q2third vertex of triangle
[in]lambdabarycentric coordinates
Returns
The reconstructed point

Definition at line 857 of file CG_elem.cpp.

◆ restrictPointTriangle() [1/2]

array3D bitpit::CGElem::restrictPointTriangle ( array3D const & Q0,
array3D const & Q1,
array3D const & Q2,
array3D & lambda )

Restricts a point given in barycentric coordinates on the triangle

Parameters
[in]Q0first triangle vertex
[in]Q1second triangle vertex
[in]Q2third triangle vertex
[in,out]lambdabarycentric coordinates before and after restriction
Returns
coordinates of restricted point

Definition at line 1096 of file CG_elem.cpp.

◆ restrictPointTriangle() [2/2]

array3D bitpit::CGElem::restrictPointTriangle ( array3D const & Q0,
array3D const & Q1,
array3D const & Q2,
double * lambda )

Restricts a point given in barycentric coordinates on the triangle

Parameters
[in]Q0first triangle vertex
[in]Q1second triangle vertex
[in]Q2third triangle vertex
[in,out]lambdabarycentric coordinates before and after restriction
Returns
coordinates of restricted point

Definition at line 1109 of file CG_elem.cpp.

◆ rotatePoint()

array3D bitpit::CGElem::rotatePoint ( const array3D & P,
const array3D & n0,
const array3D & n1,
double angle )

Rotates the point.

If the axis points are coincident, the function will return the given point with no rotation applied.

Parameters
[in]Pis the point that will be rotated
[in]n0is a first point on the rotation axis
[in]n1is a second point on the rotation axis
[in]angleis the rotation angle, expressed in radiants and positive for counterclockwise rotations
Returns
The rotated point.

Definition at line 892 of file CG_elem.cpp.

◆ rotateVector()

array3D bitpit::CGElem::rotateVector ( array3D const & vector,
array3D const & axis,
double theta )

rotates a vector in 3D using Rodrigues' formula.

Parameters
[in]vectorvector to be rotated
[in]axisrotation axis
[in]thetarotation angle
Returns
rotated vector

Definition at line 2968 of file CG_elem.cpp.

◆ subtractionAABB()

void bitpit::CGElem::subtractionAABB ( array3D const & A0,
array3D const & A1,
array3D const & B0,
array3D const & B1,
array3D & C0,
array3D & C1 )

computes the bounding box of the relative complement two axis aligned bounding boxes

Parameters
[in]A0min point of first bounding box
[in]A1max point of first bounding box
[in]B0min point of second bounding box
[in]B1max point of second bounding box
[out]C0min point of relative complement
[out]C1max point of relative complement

Definition at line 2725 of file CG_elem.cpp.

◆ subtriangleOfPolygon() [1/2]

void bitpit::CGElem::subtriangleOfPolygon ( int triangle,
std::size_t nV,
array3D const * V,
array3D & V0,
array3D & V1,
array3D & V2 )

Gets the subtriangle vertices' coordinates of a convex polygon

The vertices of the n-th subtriangle will be defined as follows: V0: is the centroid of the polygon; V1: is the n-th vertex of the polygon; V2: is the vertex following the n-th vertex of the polygon.

Parameters
[in]triangleindex of triangle
[in]nVnumber of polygon vertices
[in]Vpolgon vertices
[in]V0coordinates of first triangle's vertex
[in]V1coordinates of second triangle's vertex
[in]V2coordinates of third triangle's vertex

Definition at line 3107 of file CG_elem.cpp.

◆ subtriangleOfPolygon() [2/2]

void bitpit::CGElem::subtriangleOfPolygon ( int triangle,
std::vector< array3D > const & V,
array3D & V0,
array3D & V1,
array3D & V2 )

Gets the subtriangle vertices' coordinates of a convex polygon

The vertices of the n-th subtriangle are be defined as follows: V0: is the centroid of the polygon; V1: is the n-th vertex of the polygon; V2: is the vertex following the n-th vertex of the polygon.

Parameters
[in]triangleindex of triangle
[in]Vpolgon vertices
[in]V0coordinates of first triangle's vertex
[in]V1coordinates of second triangle's vertex
[in]V2coordinates of third triangle's vertex

Definition at line 3087 of file CG_elem.cpp.

◆ unionAABB() [1/2]

void bitpit::CGElem::unionAABB ( array3D const & A0,
array3D const & A1,
array3D const & B0,
array3D const & B1,
array3D & C0,
array3D & C1 )

computes the bounding box of the union of two axis aligned bounding boxes

Parameters
[in]A0min point of first bounding box
[in]A1max point of first bounding box
[in]B0min point of second bounding box
[in]B1max point of second bounding box
[out]C0min point of union bounding box
[out]C1max point of union bounding box

Definition at line 2667 of file CG_elem.cpp.

◆ unionAABB() [2/2]

void bitpit::CGElem::unionAABB ( std::vector< array3D > const & A0,
std::vector< array3D > const & A1,
array3D & C0,
array3D & C1 )

computes the bounding box of the union of several axis aligned bounding boxes

Parameters
[in]A0min points of bounding boxes
[in]A1max points of bounding boxes
[out]C0min point of union bounding box
[out]C1max point of union bounding box

Definition at line 2684 of file CG_elem.cpp.

◆ validBarycentric()

bool bitpit::CGElem::validBarycentric ( double const * lambdaPtr,
int n )

Checks if barycentric coordinates is valid

Parameters
[in]lambdaPtrpointer to barycentric coordinates
[in]nnumber of points
Returns
true if valid

Definition at line 585 of file CG_elem.cpp.

◆ validLine()

bool bitpit::CGElem::validLine ( const array3D & P,
const array3D & n )

Checks if a line is valid

Parameters
[in]Ppoint on line;
[in]nline direction
Returns
true if valid

Definition at line 528 of file CG_elem.cpp.

◆ validPlane()

bool bitpit::CGElem::validPlane ( const array3D & P,
const array3D & n )

Checks if a plane is valid

Parameters
[in]Ppoint on plane
[in]nplane normal
Returns
true if valid

Definition at line 540 of file CG_elem.cpp.

◆ validSegment()

bool bitpit::CGElem::validSegment ( const array3D & P0,
const array3D & P1 )

Checks if a segment is valid

Parameters
[in]P0start point of segment
[in]P1end point of segment
Returns
true if valid

Definition at line 517 of file CG_elem.cpp.

◆ validTriangle()

bool bitpit::CGElem::validTriangle ( const array3D & P0,
const array3D & P1,
const array3D & P2 )

Checks if a triangle is valid

Parameters
[in]P0first triangle vertex
[in]P1second triangle vertex
[in]P2third triangle vertex
Returns
true if valid

Definition at line 553 of file CG_elem.cpp.

◆ vertexOfBox()

void bitpit::CGElem::vertexOfBox ( int i,
array3D const & A0,
array3D const & A1,
array3D & P )

computes the vertex coordiantes of a box

Parameters
[in]ivertex index
[in]A0min point of bounding box
[in]A1max point of bounding box
[out]Pvertex coordinates

Definition at line 2899 of file CG_elem.cpp.

◆ vertexOfSegment()

void bitpit::CGElem::vertexOfSegment ( int i,
array3D const & V0,
array3D const & V1,
array3D & P )

returns the vertex coordiantes of a segment given its index

Parameters
[in]iedge index
[in]V0first vertex of segment
[in]V1second vertex of segment
[out]Pvertex

Definition at line 2755 of file CG_elem.cpp.

◆ vertexOfTriangle()

void bitpit::CGElem::vertexOfTriangle ( int i,
array3D const & V0,
array3D const & V1,
array3D const & V2,
array3D & P )

returns the vertex coordiantes of a triangle given its index

Parameters
[in]iedge index
[in]V0first vertex of triangle
[in]V1second vertex of triangle
[in]V2third vertex of triangle
[out]Pvertex

Definition at line 2783 of file CG_elem.cpp.

Variable Documentation

◆ boxEdgeVertexConnectivity

const std::array< std::array<int,2>,12> bitpit::CGElem::boxEdgeVertexConnectivity
Initial value:
=
{{
std::array<int,2>{ {0,2} },
std::array<int,2>{ {1,3} },
std::array<int,2>{ {0,1} },
std::array<int,2>{ {2,3} },
std::array<int,2>{ {4,6} },
std::array<int,2>{ {5,7} },
std::array<int,2>{ {4,5} },
std::array<int,2>{ {6,7} },
std::array<int,2>{ {0,4} },
std::array<int,2>{ {1,5} },
std::array<int,2>{ {2,6} },
std::array<int,2>{ {3,7} }
}}

The edge vertex connectivty of a box

Definition at line 53 of file CG.hpp.

◆ boxFaceVertexConnectivity

const std::array< std::array<int,4>, 6> bitpit::CGElem::boxFaceVertexConnectivity
Initial value:
=
{{
std::array<int,4>{ {0,2,6,4} },
std::array<int,4>{ {1,3,7,5} },
std::array<int,4>{ {0,4,5,1} },
std::array<int,4>{ {2,6,7,3} },
std::array<int,4>{ {0,1,3,2} },
std::array<int,4>{ {4,5,7,6} }
}}

The face vertex connectivty of a box

Definition at line 73 of file CG.hpp.

◆ DEFAULT_COPLANARITY_TOLERANCE

const double bitpit::CGElem::DEFAULT_COPLANARITY_TOLERANCE = 1.e-12

Definition at line 48 of file CG.hpp.

◆ DEFAULT_DISTANCE_TOLERANCE

const double bitpit::CGElem::DEFAULT_DISTANCE_TOLERANCE = 1.e-12

Definition at line 47 of file CG.hpp.

--- layout: doxygen_footer ---