- 积分
- 393
- 明经币
- 个
- 注册时间
- 2004-5-24
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
过三点 cp1 、cp2、 cp3作曲线,其中cp1 、cp2段为直线,cp2 、cp3段为圆弧,且圆弧与直线相切,有以下程序段:
sub test()
Dim cp1(1), cp2(1), cp3(1) As Double Dim ang1 As Double, ang2 As Double, ang As Double Dim cp(5) As Double cp1(0) = pnts1(0): cp1(1) = pnts1(1) cp2(0) = pnts(0): cp2(1) = pnts(1) cp3(0) = mc(0) + d / 2 + m + r: cp3(1) = mc(1) + r * (1 - Cos(r0)) cp(0) = cp1(0): cp(1) = cp1(1) cp(2) = cp2(0): cp(3) = cp2(1) cp(4) = cp3(0): cp(5) = cp3(1) ang1 = ThisDrawing.Utility.AngleFromXAxis(cp1, cp2) ang2 = ThisDrawing.Utility.AngleFromXAxis(cp2, cp3) ang = ang2 - ang1
Dim pl As AcadLWPolyline Set pl = ThisDrawing.ModelSpace.AddLightWeightPolyline(cp)
pl.SetBulge 1, Tan(ang / 2)
end sub
程序段中, mc(0) 、 d 、m 、r、 mc(1) 、r0、pnts1(0)、pnts1(1) pnts(0)、pnts(1)值已给出。为何运行结果不是直线与圆弧相切,而仅是直线段?
请大家帮忙看看!! |
|