triangleFuncs Class Reference

Contains various triangle static functions. More...

Static Public Member Functions

static bool intersectAxesBundle (const point &V0, const point &V10, const point &V20, const label i0, const pointField &origin, const scalar maxLength, point &pInter)
 Intersect triangle with parallel edges aligned with axis i0. More...
 
static bool intersectBb (const point &p0, const point &p1, const point &p2, const treeBoundBox &cubeBb)
 Intersect triangle with bounding box. More...
 
static bool intersect (const point &va0, const point &va10, const point &va20, const point &basePoint, const vector &normal, point &pInter0, point &pInter1)
 Intersect triangle with plane. More...
 
static bool intersect (const point &va0, const point &va10, const point &va20, const point &vb0, const point &vb10, const point &vb20, point &pInter0, point &pInter1)
 Intersection of two triangles intersect. More...
 

Detailed Description

Contains various triangle static functions.

Source files

Definition at line 54 of file triangleFuncs.H.

Member Function Documentation

◆ intersectAxesBundle()

bool intersectAxesBundle ( const point V0,
const point V10,
const point V20,
const label  i0,
const pointField origin,
const scalar  maxLength,
point pInter 
)
static

Intersect triangle with parallel edges aligned with axis i0.

Returns true (and intersection in pInter) if any of them intersects triangle. Used in intersectBb.

Definition at line 67 of file triangleFuncs.C.

References alpha, beta(), Foam::det(), forAll, Foam::mag(), s(), and u0.

Here is the call graph for this function:

◆ intersectBb()

bool intersectBb ( const point p0,
const point p1,
const point p2,
const treeBoundBox cubeBb 
)
static

Intersect triangle with bounding box.

Returns
true if any bounding box faces intersect the triangle, returns false if the triangle is inside the bounding box

Definition at line 151 of file triangleFuncs.C.

References PointHit< PointType >::distance(), e, treeBoundBox::edges, forAll, intersection::HALF_RAY, PointHit< PointType >::hit(), triangle< Point, PointRef >::intersection(), treeBoundBox::intersects(), p0, points, and treeBoundBox::points().

Referenced by treeDataFace::overlaps(), and treeDataPrimitivePatch< PatchType >::overlaps().

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

◆ intersect() [1/2]

bool intersect ( const point va0,
const point va10,
const point va20,
const point basePoint,
const vector normal,
point pInter0,
point pInter1 
)
static

Intersect triangle with plane.

Returns
bool and set intersection segment.

Definition at line 208 of file triangleFuncs.C.

References Foam::mag(), and Foam::sqrt().

Here is the call graph for this function:

◆ intersect() [2/2]

bool intersect ( const point va0,
const point va10,
const point va20,
const point vb0,
const point vb10,
const point vb20,
point pInter0,
point pInter1 
)
static

Intersection of two triangles intersect.

Returns
bool and set intersection segment.

Definition at line 326 of file triangleFuncs.C.

References SortableList< T >::indices(), Foam::mag(), and SortableList< T >::sort().

Here is the call graph for this function:

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