@mlightcad/geometry-engine
Version:
The geometry-engine package provides comprehensive geometric entities, mathematical operations, and transformations for 2D and 3D space. This package mimics AutoCAD ObjectARX's AcGe (Geometry) classes and provides the mathematical foundation for CAD opera
91 lines • 3.28 kB
TypeScript
import { AcGePoint2dLike, AcGePoint3dLike } from '../math';
/**
* The class used to store some tolerance values.
*/
export declare class AcGeTol {
/**
* Tolerance value to check whether two points are equal. Two points, p1 and p2, are equal if
* <pre>
* (p1 - p2).length() <= equalPointTol
* </pre
*/
equalPointTol: number;
/**
* Tolerance value to compare two vectors.
*
* 1. Two vectors, v1 and v2, are equal if
* <pre>
* (p1 - p2).length() <= equalPoint
* </pre>
*
* 2. Two vectors, v1 and v2, are parallel if
* <pre>
* (v1/v1.length() - v2/v2.length() ).length() < equalVectorTol
* </pre>
* 或
* <pre>
* (v1/v1.length() + v2/v2.length() ).length() < equalVectorTol
* </pre>
*
* 3. Two vectors, v1 and v2, are perpendicular if
* <pre>
* abs((v1.dotProduct(v2))/(v1.length()*v2.length())) <= equalVectorTol
* </pre>
*/
equalVectorTol: number;
/**
* Create tolerance class with default tolerance values
*/
constructor();
/**
* Return true if two points are equal with the specified tolerance.
* @param p1 Input the first 2d point
* @param p2 Input the second 2d point
* @returns Return true if two poitns are equal with the specified tolerance.
*/
equalPoint2d(p1: AcGePoint2dLike, p2: AcGePoint2dLike): boolean;
/**
* Return true if two points are equal with the specified tolerance.
* @param p1 Input the first 2d point
* @param p2 Input the second 2d point
* @returns Return true if two poitns are equal with the specified tolerance.
*/
equalPoint3d(p1: AcGePoint3dLike, p2: AcGePoint3dLike): boolean;
/**
* Return true if the value is equal to zero with the specified tolerance.
*/
static equalToZero(x: number, tol?: number): boolean;
/**
* Return true if two values are equal with the sepcified tolerance.
*
* @param value1 Input the first value
* @param value2 Input the second value
* @param tol Input the tolerance value
* @returns Return true if two values are equal with the sepcified tolerance
*/
static equal(value1: number, value2: number, tol?: number): boolean;
/**
* Return true if the first argument are greater than the second argument with the sepcified
* tolerance.
*
* @param value1 Input the first value
* @param value2 Input the second value
* @param tol Input the tolerance value
* @returns Return true if the first argument are greater than the second argument with the
* sepcified tolerance.
*/
static great(value1: number, value2: number, tol?: number): boolean;
/**
* Return true if the first argument less than the second argument with the specified tolerance
* value
*
* @param value1 Input the first value
* @param value2 Input the second value
* @param tol Input the tolerance value
* @returns Return *true* if the first argument less than the second argument with the specified
* tolerance value
*/
static less(value1: number, value2: number, tol?: number): boolean;
}
export declare const DEFAULT_TOL: AcGeTol;
//# sourceMappingURL=AcGeTol.d.ts.map