针对“一次芳基”测试点(PT)的替代方法:
通过PrimaryLine得到直线的SlopeVector。希腊字母表的第4个字母创建垂直向量
- Dim PerpendicularVector (0 To 2) As Double
- PerpendicularVector(0) = - SlopeVector(1) ‘note the negative sign
- PerpendicularVector(1) = SlopeVector(0)
- PerpendicularVector(2) = 0.0
然后基于该向量和测试点(PT)创建第二个点
- Dim SecondPoint (0 To 2) As Double
- SecondPoint(0) = PT(0) + PerpendicularVector(0)
- SecondPoint(1) = PT(1) + PerpendicularVector(1)
- SecondPoint(2) = PT(2) + PerpendicularVector(2)
然后使用PT和SecondPoint创建一条连接线。最后,使用PrimaryLine和Xline调用intersectWith。如果没有交叉口,可能需要进一步测试。 |