欢迎来到天天文库
浏览记录
ID:40889590
大小:47.51 KB
页数:4页
时间:2019-08-10
《CAD画缓和曲线lisp程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、CAD中画缓和曲线,首先复制本文☆后面的源程序保存至cad安装目录的SUPPORT文件夹,保存类型为.lsp可以随便复制一个SUPPORT文件夹内的lsp文件,然后替换本文的程序。打开CAD后,输入appload回车,找到你保存的缓和曲线lsp程序,点击加载,然后就可以画缓和曲线了。首先,要画出缓和曲线的两条直线,然后输入HH回车,按提示完成缓和曲线。注:本程序,缓和曲线段拟合长度为0.4m,如需更改拟合长度,将程序的第8行(repeat(FIX(/Ls0.4))及9行(setql(+l(/Ls(FIX(/Ls0.4
2、))))中的0.4修改即可。☆;;多义线摹拟缓和曲线。;;输入起止直线、半径、缓和曲线长或设计车速。;;命令:HH(defuncom_p()(setql0)(command"ucs""o"(list(-0x1)00))(command"pline"(list000)"w""0"""(repeat(FIX(/Ls0.4))(setql(+l(/Ls(FIX(/Ls0.4))))x(+(-l(/(*lllll)40CC))(/(*lllllllll)3456CCCC))y(*id__(+(-(/(*lll)6C)(/(*
3、lllllll)336CCC))(/(*lllllllllll)42240CCCCC))));setq(command(listxy0)));repaet);command(setqpt5(trans(listxy0)10)));com_p(defunll_v()(setqV(getreal"GiveVelocity:")Ls1(*V0.85)Ls2(/(*0.0357VVV)R)Ls(maxLs1Ls2(/R9))Ls(*(fix(/Ls10))10.0));setq(if(>LsR)(setqLsR))(ll
4、_d));ll_v(defunll_d()(setqos(getvar"osmode"))(setvar"osmode"0)(setqC(*LsR)q(-(+(-(/Ls2)(/(*LsLsLs)240RR))(/(*LsLsLsLsLs)34560RRRR))(/(*LsLsLsLsLsLsLs)8386560RRRRRR))pt1(cdr(assoc10(entget(carp1))))pt2(cdr(assoc11(entget(carp1))))pt10(polarpt1(anglept1pt2)(/(dis
5、tancept1pt2)2))pt3(cdr(assoc10(entget(carp2))))pt4(cdr(assoc11(entget(carp2))))pt20(polarpt3(anglept3pt4)(/(distancept3pt4)2))p(+(-(/(*LsLs)24R)(/(*LsLsLsLs)2688RRR))(/(*LsLsLsLsLsLs)506880RRRRR))jd(interspt1pt2pt3pt4nil)alf1(anglept10jd)alf2(anglept20jd)alf(-(
6、anglejdpt20)alf1));setq(if(or(>alfpi)(and(alf(-0pi))))(progn(setqid__-1)(if(>alfpi)(setqalf(-(+pipi)alf))(setqalf(absalf))));progn(progn(setqid__1)(if(<=alf(-0pi))(setqalf(+pipialf))));progn);if(setqx0(/(*(+pR)(sin(/alf2.0)))(cos(/alf2.0)))x1(+x0q)Cl(+(
7、*alfR)Ls)E(-(/(+Rp)(cos(/alf2)))R));setq(command"ucs""o"jd)(command"ucs""z"(/(*180alf1)pi))(com_p)(setqpt6pt5)(setqppt1(listx100))(command"ucs""")(command"ucs""o"jd)(command"ucs""z"(/(*180alf2)pi))(setqid__(-0id__))(com_p)(setqppt2(listx100))(command"ucs""")(if
8、(>(abs(distancejdpt1))(abs(distancejdpt2)))(setqptt1pt1)(setqptt1pt2));if(setqptt2(polarjdalf1(-0x1)))(thhp1ptt110)(thhp1ptt211)(if(>(abs(distancejdpt3))(abs(distancejdpt4))
此文档下载收益归作者所有