CCCoreLib 31 May 2022
CloudCompare Core algorithms
Static Public Member Functions | List of all members
CCCoreLib::CCMiscTools Class Reference

Miscellaneous useful functions (geometrical elements handling) More...

#include <CCMiscTools.h>

Inheritance diagram for CCCoreLib::CCMiscTools:
Inheritance graph
[legend]
Collaboration diagram for CCCoreLib::CCMiscTools:
Collaboration graph
[legend]

Static Public Member Functions

static void EnlargeBox (CCVector3 &dimMin, CCVector3 &dimMax, double coef)
 Proportionally enlarges a 3D box. More...
 
static void MakeMinAndMaxCubical (CCVector3 &dimMin, CCVector3 &dimMax, double enlargeFactor)
 Transforms a 3D box into a 3D cube. More...
 
static void ComputeBaseVectors (const CCVector3 &N, CCVector3 &X, CCVector3 &Y)
 Computes base vectors for a given 3D plane. More...
 
static void ComputeBaseVectors (const CCVector3d &N, CCVector3d &X, CCVector3d &Y)
 Computes base vectors for a given 3D plane - double version. More...
 
static bool TriBoxOverlap (const CCVector3 &boxcenter, const CCVector3 &boxhalfsize, const CCVector3 *triverts[3])
 Ovelap test between a 3D box and a triangle. More...
 
static bool TriBoxOverlapd (const CCVector3d &boxcenter, const CCVector3d &boxhalfsize, const CCVector3d triverts[3])
 Ovelap test between a 3D box and a triangle (double version) More...
 

Detailed Description

Miscellaneous useful functions (geometrical elements handling)

Member Function Documentation

◆ ComputeBaseVectors() [1/2]

void CCMiscTools::ComputeBaseVectors ( const CCVector3 N,
CCVector3 X,
CCVector3 Y 
)
static

Computes base vectors for a given 3D plane.

Determines at least two orthogonal vectors perpendicular to a third one

Parameters
[in]Na non null vector
[out]Xthe first vector (a 3 coordinates array to be updated by the algorithm)
[out]Ythe second vector (a 3 coordinates array to be updated by the algorithm)

◆ ComputeBaseVectors() [2/2]

void CCMiscTools::ComputeBaseVectors ( const CCVector3d N,
CCVector3d X,
CCVector3d Y 
)
static

Computes base vectors for a given 3D plane - double version.

Determines at least two orthogonal vectors perpendicular to a third one

Parameters
[in]Na non null vector
[out]Xthe first vector (a 3 coordinates array to be updated by the algorithm)
[out]Ythe second vector (a 3 coordinates array to be updated by the algorithm)

◆ EnlargeBox()

void CCMiscTools::EnlargeBox ( CCVector3 dimMin,
CCVector3 dimMax,
double  coef 
)
static

Proportionally enlarges a 3D box.

Parameters
dimMinthe upper-left corner of the box
dimMaxthe lower-right corner of the box
coefthe enlargement coefficient (1.1 <-> +10%)

◆ MakeMinAndMaxCubical()

void CCMiscTools::MakeMinAndMaxCubical ( CCVector3 dimMin,
CCVector3 dimMax,
double  enlargeFactor 
)
static

Transforms a 3D box into a 3D cube.

The cube dimensions will be equal to the largest box dimension.

Parameters
dimMinthe upper-left corner of the rectangle
dimMaxthe lower-right corner of the rectangle
enlargeFactorthe resulting box can be automatically enlarged if this parameter is greater than 0

◆ TriBoxOverlap()

bool CCMiscTools::TriBoxOverlap ( const CCVector3 boxcenter,
const CCVector3 boxhalfsize,
const CCVector3 triverts[3] 
)
static

Ovelap test between a 3D box and a triangle.

Parameters
boxcenterthe box center
boxhalfsizethe box half dimensions
trivertsthe 3 triangle vertices
Returns
true if the input box and triangle overlap, false otherwise

◆ TriBoxOverlapd()

bool CCMiscTools::TriBoxOverlapd ( const CCVector3d boxcenter,
const CCVector3d boxhalfsize,
const CCVector3d  triverts[3] 
)
static

Ovelap test between a 3D box and a triangle (double version)

Parameters
boxcenterthe box center
boxhalfsizethe box half dimensions
trivertsthe 3 triangle vertices
Returns
true if the input box and triangle overlap, false otherwise

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