如何在cad中画缓和曲线

上传人:kms****20 文档编号:40639059 上传时间:2018-05-26 格式:DOC 页数:5 大小:27.50KB
返回 下载 相关 举报
如何在cad中画缓和曲线_第1页
第1页 / 共5页
如何在cad中画缓和曲线_第2页
第2页 / 共5页
如何在cad中画缓和曲线_第3页
第3页 / 共5页
如何在cad中画缓和曲线_第4页
第4页 / 共5页
如何在cad中画缓和曲线_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

《如何在cad中画缓和曲线》由会员分享,可在线阅读,更多相关《如何在cad中画缓和曲线(5页珍藏版)》请在金锄头文库上搜索。

1、如何在如何在 CADCAD 中画缓和曲线中画缓和曲线如何在 CAD 中画缓和曲线 一、在 CAD 中画出切线长二、运行程序: 在命令行中输入 hh 回车三、选择两条切线,然后输入曲线半径如:2204.5 回车四、输入缓和曲线长,如 270,绘图完成!如图记事本格式内容,新建的 lisp 语言,在 CAD 中要先加载;多义线摹拟缓和曲线。;输入起止直线、半径、缓和曲线长或设计车速。;命令:HH(defun com_p() (setq l 0)(command “ucs“ “o“ (list (- 0 x1) 0 0)(command “pline“ (list 0 0 0) “w“ “0“ “(

2、repeat 1000(setq l (+ l (/ Ls 1000)x (+ (- l (/ (* l l l l l) 40 C C) (/ (* l l l l l l l l l) 3456 C C C C)y (* id_ (+ (- (/ (* l l l) 6 C) (/ (* l l l l l l l) 336 C C C) (/ (* l l l l l l l l l l l) 42240 C C C C C);setq(command (list x y 0);repaet);command (setq pt5 (trans (list x y 0) 1 0) );co

3、m_p(defun ll_v()(setq V (getreal “nGive Velocity:“)Ls1 (* V 0.85)Ls2 (/ (* 0.0357 V V V) R)Ls (max Ls1 Ls2 (/ R 9)Ls (* (fix (/ Ls 10) 10.0);setq(if ( Ls R) (setq Ls R)(ll_d);ll_v(defun ll_d() (setq os (getvar “osmode“)(setvar “osmode“ 0) (setq C (* Ls R)q (- (+ (- (/ Ls 2) (/ (* Ls Ls Ls) 240 R R)

4、(/ (* Ls Ls Ls Ls Ls) 34560 R R R R) (/ (* Ls Ls Ls Ls Ls Ls Ls) 8386560 R R R R R R)pt1 (cdr (assoc 10 (entget (car p1)pt2 (cdr (assoc 11 (entget (car p1)pt10(polar pt1 (angle pt1 pt2) (/ (distance pt1 pt2) 2)pt3 (cdr (assoc 10 (entget (car p2)pt4 (cdr (assoc 11 (entget (car p2)pt20(polar pt3 (angl

5、e pt3 pt4) (/ (distance pt3 pt4) 2)p (+ (- (/ (* Ls Ls) 24 R) (/ (* Ls Ls Ls Ls) 2688 R R R) (/ (* Ls Ls Ls Ls Ls Ls) 506880 R R R R R)jd (inters pt1 pt2 pt3 pt4 nil)alf1(angle pt10 jd)alf2(angle pt20 jd)alf (- (angle jd pt20) alf1) );setq (if (or ( alf pi) (and ( alf (- 0 pi)(progn(setq id_ -1)(if

6、( alf pi) (setq alf (- (+ pi pi) alf) (setq alf (abs alf);progn(progn(setq id_ 1)(if ( (abs(distance jd pt1) (abs(distance jd pt2)(setq ptt1 pt1)(setq ptt1 pt2);if(setq ptt2 (polar jd alf1 (- 0 x1) (thh p1 ptt1 10)(thh p1 ptt2 11)(if ( (abs(distance jd pt3) (abs(distance jd pt4)(setq ptt3 pt3)(setq

7、ptt3 pt4);if(setq ptt4 (polar jd alf2 (- 0 x1)(thh p2 ptt3 10)(thh p2 ptt4 11)(if (= id_ 1) (command “arc“ pt5 “e“ pt6 “r“ R) (command “arc“ pt6 “e“ pt5 “r“ R)(setq alfd (angf alf)(setvar “osmode“ os) (command “cmdecho“ “1“)(command “text“ pause pause “ (strcat “偏 角“ alfd)(command “cmdecho“ “0“)(com

8、mand “text“ “ (strcat “半 径“ (rtos R 2 2)(command “text“ “ (strcat “切 线 长“ (rtos x1 2 2)(command “text“ “ (strcat “曲 线 长“ (rtos Cl 2 2)(command “text“ “ (strcat “外 距“ (rtos E 2 2)(command “text“ “ (strcat “缓和曲线长“ (rtos Ls 2 2);ll_d(defun angf (alf)(setq alff (angtos alf 1 4)n 1kk (strlen alff)(repeat

9、 kk(setq alfn (substr alff n 1)(if (= alfn “d“)(setq nn n);if(setq n (+ n 1);repeat(strcat (substr alff 1 (- nn 1) “%“ (substr alff nn);angf(defun c:hh(/ p1 p2 pt1 pt2 pt3 pt4 pt5 pt6 pt10 pt20 id_ R V Ls E p3r1 x y l x0 x1 C jd alf alf1 alf2 q p Cl Ls1 Ls2)(command “ucs“ “)(setq p1 nil p2 nil) (whi

10、le (= p1 nil) (setq p1 (entsel “n 拾取第一条直线:“)(redraw (car p1) 3)(while (= p2 nil) (setq p2 (entsel “n 拾取第二条直线:“)(redraw (car p2) 3)(initget 1)(setq R (getdist “n 请输入弯道半径 R: “)(initget 1 “Ls V“)(setq p3 (getdist “n 输入缓和曲线长度(Ls)或设计速度(V):“)(if (= p3 “V“) (ll_v) (progn (setq ls p3) (ll_d)(princ);eline(defun thh(len pt h)(setq en_data (entget (car len)old_data (assoc h en_data)new_data (cons h pt)en (subst new_data old_data en_data);setq(entmod en);thh

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号