‘判断点在线的左右
Function P2Line(ByVal P As Point3d, ByVal LineP1 As Point3d, ByVal LineP2 As Point3d) As Short
Dim ThisDrawing As AcadDocument = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication.ActiveDocument
Dim A1 As Double = ThisDrawing.Utility.AngleFromXAxis(LineP1.ToArray, LineP2.ToArray) * 180 / System.Math.PI
Dim A2 As Double = ThisDrawing.Utility.AngleFromXAxis(LineP1.ToArray, P.ToArray) * 180 / System.Math.PI
If A2 - A1 > 180 Then A2 = A2 - 360
If A1 - A2 > 180 Then A1 = A1 - 360
If A1 > A2 Then
P2Line = -1
Else
P2Line = 1
End If
End Function
[本日志由 tiancao1001 于 2022-03-18 06:11 PM 编辑]
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! |