点或向量在比较时,应用到了容差类的两个数值,实际使用时不需要重写这方面的方法 只需设置容差,然后直接判断就OK了 帮助文档中的相关内容 This is an instantiable class that is by default initialized to the default tolerances. Subsequently, the tolerances within it can be customized to suit a specific need. For example, an instance of this class may be specialized for use during surface intersection. Class Tolerance keeps two properties, EqualPoint and EqualVector, which are used in evaluation according to the following rules: - Two points, p1 and p2, are equal if
(p1 - p2).length() <= equalPoint - Two vectors, v1 and v2, are equal if
(v1 - v2).length() <= equalVector - Two vectors, v1 and v2, are parallel if
(v1/v1.length() - v2/v2.length() ).length() < equalVector OR (v1/v1.length() + v2/v2.length() ).length() < equalVector - Two vectors, v1 and v2, are perpendicular if
abs((v1.dotProduct(v2))/(v1.length()*v2.length())) <= equalVector - Two lines or rays are parallel (perpendicular) if their directional vectors are parallel (perpendicular)
|