Tolerances

Many methods accept a tolerance value as one of their parameters. This value is of the AcGeTol class and always has a default value, as defined in AcGeContext::gTol. Functions such as isClosed() and isPlanar() calculate whether the start points and endpoints are within the defined tolerance before returning a Boolean value. You can change the tolerance for one particular function call, or you can change the global tolerance value.

The AcGeTol class provides two functions for setting the tolerance for points and vectors:

void
setEqualPoint(double val);
 
void
setEqualVector(double val);

The AcGeTol class also provides two functions for obtaining the tolerance for points and vectors:

double  equalPoint() const;
 
double  equalVector() const;

The equalPoint and equalVector tolerance values are used as follows:

(p1 - p2).length() <= equalPoint
(v1 - v2).length() <= equalVector
(v1/v1.length() - v2/v2.length()).length() < equalVector
 OR (v1/v1.length() + v2/v2.length()).length() < equalVector
abs((v1.dotProduct(v2))/(v1.length()*v2.length())) 
    <= equalVector
Note: These rules mean that two lines are close to each other as point sets in the part of the modeling space of diameter diam only if the tolerance equalVector is set tighter than equalPoint/diam.