资源预览内容
第1页 / 共14页
第2页 / 共14页
第3页 / 共14页
第4页 / 共14页
第5页 / 共14页
第6页 / 共14页
第7页 / 共14页
第8页 / 共14页
第9页 / 共14页
第10页 / 共14页
亲,该文档总共14页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
齿轮轮齿渐开线、螺栓、弹簧齿轮轮齿渐开线、螺栓、弹簧 autolspautolsp 源程序源程序一、齿轮轮齿渐开渐开线(defun c:gear(/)(setqp0 (getpoint“输入齿轮中心 p0: “)m (getreal“输入齿轮模数 M: “)z (getint“输入齿轮齿数 Z: “)ha 1c 0.25a (/ pi 9)ra(/ (* (+ z (+ ha ha) m) 2)rf(/ (* (- z (+ (+ ha ha) c) m) 2)r(/ ( * m z) 2)rb ( * r (cos a)ri rbang 0g (polar p0 ang rb)(command “circle“ p0 ra)(command “circle“ p0 rf)(command “circle“ p0 r)(command “line“ g)(while (= threadpitch 0.35) (setq radmid (+ radmid (nth order 6H)(setq h (* 0.866025 threadpitch) ; 计算齿高(setq radouter (+ radmid (/ h 4) ; 计算外径(setq radinner (- radouter (* h innerdiafactor) ; 计算内径(setq threadangle (+ 30 0) ; 计算齿顶角(auxithread radouter radmid radinner threadpitch threadlength threadangle ptStart) ; 调用绘制三维螺纹的子函数(princ “n 三维螺纹创建完成“)(setvar “osmode“ osmold) ; 恢复调用前的 osmode 系统变量值(setvar “cmdecho“ ocmdold) ; 恢复调用前的 cmdecho 系统变量值(princ)(defun auxithread (radouter radmid radinner threadpitch threadlength threadangle ptStart / ttal pt1z ang pt1apt1az pt3a pt1b pt1bz pt3b pttmp1 pttmp2 pttmp3 pttmp4 pttmp5 pttmp6 pttmp7 pttmp8 pttmp9 pttmp10 pttmp11 pttmp12 tstmp startcone endcone);(command “undo“ “begin“) ; 开始 undo 步骤(setq ttal (+ (fix (/ (abs threadlength) threadpitch) 3)pttmp1 (list (- (car ptStart) (/ radouter 2.0) (cadr ptStart) (caddr ptStart)pt1z (list (- (car ptStart) (/ radouter 2.0) (cadr ptStart) (+ (caddr pttmp1) 1.0)pttmp2 (polar pttmp1 (/ (* threadangle pi) 180.0) 1)pttmp3 (list (+ (car pttmp1) radouter) (+ (cadr pttmp1) (/ threadpitch 2.0) (caddr ptStart)ang (angle pttmp1 pttmp3)pt1a (polar pttmp1 (+ ang (/ pi 2.0) threadpitch)pt1az (list (car pt1a) (cadr pt1a) (+ (caddr pt1a) 1.0)pt3a (polar pt1a ang radouter)pt1b (polar pttmp1 (- ang (/ pi 2.0) threadpitch)pt1bz (list (car pt1b) (cadr pt1b) (+ (caddr pt1b) 1.0)pt3b (polar pt1b ang radouter)pttmp4 (polar pttmp3 (/ (* (- 180 threadangle) pi) 180.0) 1)pttmp5 (inters pttmp1 pttmp2 pttmp3 pttmp4 nil)pttmp6 (list (car pttmp5) (cadr ptStart) (caddr ptStart)pttmp7 (polar pttmp1 (/ (* (- 360 threadangle) pi) 180.0) 1)pttmp8 (polar pttmp3 (/ (* (+ 180 threadangle) pi) 180.0) 1)pttmp9 (inters pttmp1 pttmp7 pttmp3 pttmp8 nil)pttmp10 (list (car pttmp9) (cadr pttmp3) (caddr pttmp3)pttmp11 (polar ptStart (/ pi 2.0) threadpitch)pttmp12 (polar pttmp11 (/ pi 2.0) (abs threadlength);-; 绘制两个倒置的并偏移 1/2 螺距的圆锥; 这两个圆锥都以中剖面剖分; 进行并集运算;-(SETQ startcone “order“)(SETQ endcone “Y“)(command “zoom“ “w“ (list (car pt1a) (+ (cadr pt1a) (abs threadlength) (caddr pt1a) pt3b)(princ “n 正在绘制三维螺纹,请等待“)(command “pline“ pttmp1 pttmp5 pttmp6 “c“)(command “revolve“ “l“ “ pttmp5 pttmp6 “)(command “slice“ “l“ “ pttmp1 pttmp3 pt1z pttmp5)(command “slice“ “l“ “ pt1a pt3a pt1az pttmp3)(setq tstmp (ssadd (entlast)(command “pline“ pttmp3 pttmp9 pttmp10 “c“)(command “revolve“ “l“ “ pttmp9 pttmp10 “)(command “slice“ “l“ “ pttmp1 pttmp3 pt1z pttmp9)(command “slice“ “l“ “ pt1b pt3b pt1bz pttmp3)(setq tstmp (ssadd (entlast) tstmp)(command “union“ tstmp “);-; 上面的实体被剖切成两份,然后进行镜像以获得螺旋线的螺旋; 单线的高度实际上等于两倍螺距,但是超出或者是在内部或者是; 在最后一步被切除;-(command “slice“ tstmp “ “xy“ ptStart “b“)(setq tstmp (ssadd (entlast) tstmp)(command “mirror“ “l“ “ pttmp1 “10: “)(cond (null ptCntPerCircle) (setq ptCntPerCircle 35) (spring RottCnt cntPt horiGrw ptCntPerCircle bgnRdtn vertGrw)(setvar “cmdecho“ cmdch) ; 恢复调用前的 cmdecho 系统变量值(setvar “blipmode“ blpmd) ; 恢复调用前的 blipmode 系统变量值(setq *error* olderror) ; Restore old *error* handler(princ)
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号