Tolerance-公差,可用来判断两点是否相等,,两向量是否相等、平行、垂直等

[StructLayout(LayoutKind.Sequential), Wrapper("AcGeTol")]
public struct Tolerance {
}

Description
This .NET class wraps AcGeTol ObjectARX class.

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:

1. Two points, p1 and p2, are equal if 

(p1 - p2).length() <= equalPoint

 

2. Two vectors, v1 and v2, are equal if

(v1 - v2).length() <= equalVector

 

3. 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

 

4. Two vectors, v1 and v2, are perpendicular if
abs((v1.dotProduct(v2))/(v1.length()*v2.length())) <= equalVector

 

5. Two lines or rays are parallel (perpendicular) if their directional vectors are parallel (perpendicular)

 

Notes
Two lines are equal as point sets if, for any point on any line, there is a point on the other line within the EqualPoint tolerance from the first point. This implies that two lines with common point and parallel directional vectors are equal as point sets in the portion of the modeling space of DIAM, if only the tolerance EqualVector is set tighter than EqualPoint.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值