版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、一、CAD中齿轮画法有下面一段渐开线程序:;begainsuprgear.lsp;*;SPURGEAR.LSP-alispprogrambyTonyHotchkiss;Thisroutinedrawsaspurgearusingjoined;polylines.Itletsyouuseanypressureangle;todesignthegearteeth.;*(defunerr(s)(if(=sFunctioncancelled)(princnSPURGEAR-cancelled:)(progn(princnSPURGEAR-Error:)(princs)(terpri);if(reset
2、ting)(princSYSTEMVARIABLEShavebeenresetn)(princ);err(defunsetv(systvarnewval)(setqx(read(strcatsystvar1)(setx(getvarsystvar)(setvarsystvarnewval);setv(defunsetting()(setqoerr*error*)(setq*error*err)(setvCMDECHO0)(setvBLIPMODE0);endofsetting(defunrsetv(systvar)(setqx(read(strcatsystvar1)(setvarsystva
3、r(evalx);restv(defunresetting()(rsetvCMDECHO)(rsetvBLIPMODE)(setq*error*oerr);endofresetting(defundxf(codeename)(cdr(assoccode(entgetename);dxf(defunspurgear(/DNphiDOROABDRDBinv-plstp1trimcodeinventp0pcurventlinentlinent2ent2p2)(setqD(getrealnPitchdiameter:)N(getintnNumberofteeth:)phi(getrealnPressu
4、reangle:)phi(*(/phi180)pi);PressureangleDO(*D(+(/2.0N)1.0);OutsidediameterRO(/DO2.0);OutsideradiusA(/DN);AddendumB(*1.25A);DedendumDR(-D(*B2.0);Rootdiameter););repeat););prognDB(*D(cosphi);Basecircledia.inv-plst(involuteDBNphi);involutepointstrimcodenil);setq(commandZOOM(list0(-B)(listRO(/RO1.5);com
5、mand(setqinvent(draw-invinv-plst);Drawinvolute.(setqp0(carinv-plst)trimcode(ext-trimp0DRD);trimorextend);setq;theinvolute.(if(andtrimcode(=trimcode0)(progn;Joinstheinvolutetotheextension.(setqp(list(/DR2.0)0)(commandPEDITpYJinventX)(setqcurvent(entlast)(setqcurvent(entlast);if(if(nulltrimcode)(setqc
6、urventinvent)(setqlinent(draw-top-lineDDBNRO);topline.(commandCOPYlinent0,00,0)(setqlinent2(entlast)(setqent2(mir-itcurventlinent);mirrorcurve(commandPEDITcurventJlinentent2X)(segmentDRNlinent2);Finishthejob!(setqp1(list(-RO)(-RO)(setqp2(listRORO)(commandZOOMp1p2)(promptnConvertingtoPOLYLINE,pleasew
7、ait.)(commandPEDIT(entlast)JCp1p2X)(promptnAlldone!);spurgear(defuninvolute(DBNphi/numerdenomfractheta2maxthetamaxtheta-incthetaplistRBxvalyvalp)(setqinvfact3)(setqnumer(+N2.0)denom(*N(cosphi)frac(/numerdenom)theta2max(-(*fracfrac)1)thetamax(sqrttheta2max)theta-inc(/thetamax(floatinvfact)theta0plist
8、nilRB(/DB2.0);setq(repeat(1+invfact)(setqxval(do-xRBtheta)yval(do-yRBtheta)p(listxvalyval)plist(appendplist(listp);setq(setqtheta(+thetatheta-inc)plist);involute(defundo-x(RBtheta)(*RB(+(costheta)(*theta(sintheta);do-x(defundo-y(RBtheta)(*RB(-(sintheta)(*theta(costheta);do-y(defundraw-inv(inv-plst/d
9、irptplistp)(commandPLINE(nth0inv-plst)(setqdirpt(polar(nth0inv-plst)01)(commandADdirpt)(setqplist(cdrinv-plst)(foreachpplist(commandp)(command)(entlast);draw-inv(defunext-trim(p0DRD/trimcodedistendr)(if(carp0)(/DR2.0);Extendstheinvolute(progn););draw-top-line(commandLINE(list(/DR2.0)0)p0)(setqtrimco
10、de0);progn);if(if(carp0)(/DR2.0);Trimstheinvolute(progn(commandCIRCLE0,0DDR);Rootcircle(setqdist(-(/D2.0)(carp0)(commandZOOMp0(polarp00.6dist)(setqendr(entlast)(commandTRIMendrp0)(commandZOOMP)(entdelendr)(setqtrimcode1);progn);iftrimcode);ext-trim(defundraw-top-line(DDBNRO/theta-pxpypalphabetatanga
11、ngendinv-endptlend)(setqtheta-p(sqrt(-(*(/DDB)(/DDB)1.0)xp(do-x(/DB2.0)theta-p);Thissectionyp(do-y(/DB2.0)theta-p);setsupanglesalpha(atanypxp);fordrawingaabeta(angle(list00)(lastinv-plst)beta(-abetaalpha);lineacrossthetang(/piN);topofatoothangend(-(+alphatang)beta)inv-endpt(lastinv-plst);Thisalsocre
12、ateslend(polar(list00)angendRO);thetooth);setq;thickness.(commandLINEinv-endptlend);Drawstheline(redraw)(entlast)(defunmir-it(cventlinent/pt)(setqpt(dxf11linent)(commandMIRRORcventMIDpt0,0)(entlast);mir-it(defunsegment(DRNen/p1p2angdistmidpp0pangpang2pp3ent3entl1entl2en1en2)(setqp1(dxf10en)p2(dxf11e
13、n)ang(anglep1p2)dist(/(distancep1p2)2.0)midp(polarp1angdist)p0(list00)pang(anglep0midp)pang2(/piN)p(polarp0pang(/DR2.0)p1(polarp0(-pangpang2)(/DR2.0)p2(polarp0(+pangpang2)(/DR2.0)p3(polarp0(+pangpang2pang2)(/DR2.0)ent3(entlast);Thisisthetoothp-line);setq(commandZOOMWp3p1)(commandCIRCLE0,0DDR);Rootci
14、rcle(commandTRIMent3p);Trimtherootcircle(commandZOOMP)(commandLINEp0p1)(setqentl1(entlast)(commandLINEp0p2)(setqentl2(entlast)(commandTRIMentl1entl2p3)(entdelentl1)(entdelentl2)(entdelen)(commandZOOMWp3p1)(commandPEDITp1YX)(setqen1(entlast)(commandPEDITp2YX)(setqen2(entlast)(commandPEDITen1Jmidpen2X
15、)(commandZOOMP)(commandARRAYp1P0,0N360Y);segment(defunc:sg()(setting)(spurgear)(resetting)(princ);c:sg(promptn*SPURGEAR.LSPLoaded!)(promptnEnterSGtostart);endsuprgear.lsp将上述代码保存成lsp文档格式,最好存入cad目录下的Support文件夹下。打开CAD图形后点击“工具”菜单fAutoLISPf加载一找到自己所存的.LSP文件位置点“加载”、点“关闭”。在CAD环境下“命令”状态栏里输入飞8”命令后就可以调用。二、渐开线关系式(开始建模就要加入此关系式)m=(模数)za=(齿数)alpha=20压力角db=0.5*m*za*cos(20)基园
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年泡沫保护包装行业分析报告及未来发展趋势报告
- 2026年汽化炉行业分析报告及未来发展趋势报告
- 2026年纳米氧化铝材料行业分析报告及未来发展趋势报告
- 2026年名片行业分析报告及未来发展趋势报告
- 2026年改善皮肤水份保健品行业分析报告及未来发展趋势报告
- 2025年实习生出科试题B卷附答案
- 2026年名片盒行业分析报告及未来发展趋势报告
- 2026年海洋运输行业分析报告及未来发展趋势报告
- 海南省琼海市法官逐级遴选考试题及答案
- 2026年家纺知识考试题及答案
- 2026年民航货运员技能考试试题及答案
- 2026年西医医师定期考核能力提升B卷题库附答案详解(B卷)
- 2026年北京市高校毕业生到农村从事支农工作招聘467人农业笔试参考题库及答案解析
- 【宁波】2025年中共浙江宁波市宁海县委党校招聘事业编制工作人员笔试历年典型考题及考点剖析附带答案详解
- 辽水集团笔试试题题库
- 鱼塘平地改造方案范本
- 2025-2026学年安徽省马鞍山市高三第一次教学质量监测物理试卷(含解析)
- 辽宁省抚顺市(2025年)招聘警务辅助人员考试真题及答案
- 客运反三违培训课件
- 贸易融资业务课件
- GB/T 46692.2-2025工作场所环境用气体探测器第2部分:有毒气体探测器的选型、安装、使用和维护
评论
0/150
提交评论