版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
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圖形后點(diǎn)擊“工具”菜單fAutoLISPf加載一找到自己所存的.LSP文件位置點(diǎn)“加載”、點(diǎn)“關(guān)閉”。在CAD環(huán)境下“命令”狀態(tài)欄里輸入飛8”命令后就可以調(diào)用。二、漸開線關(guān)系式(開始建模就要加入此關(guān)系式)m=(模數(shù))za=(齒數(shù))alpha=20壓力角db=0.5*m*za*cos(20)基園
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 中學(xué)學(xué)生社團(tuán)財(cái)務(wù)管理制度
- 企業(yè)招聘與選拔標(biāo)準(zhǔn)制度
- 企業(yè)財(cái)務(wù)預(yù)算與審核制度
- 2026年律師資格考試邏輯推理與法律實(shí)務(wù)題集
- 2026年體育賽事組織與管理規(guī)范題庫
- 2026年虛擬化技術(shù)專家認(rèn)證考試題及答案詳解
- 2026年IT項(xiàng)目管理師專業(yè)知識與實(shí)踐技能認(rèn)證題集
- 2025年煤矸石山生態(tài)修復(fù)合同
- 加油站安全事故報(bào)告與處理制度內(nèi)容
- 2025年鄭州智能科技職業(yè)學(xué)院馬克思主義基本原理概論期末考試模擬題帶答案解析(必刷)
- 河北省邢臺市2025-2026學(xué)年七年級上學(xué)期期末考試歷史試卷(含答案)
- 2026屆南通市高二數(shù)學(xué)第一學(xué)期期末統(tǒng)考試題含解析
- 寫字樓保潔培訓(xùn)課件
- 2026中國電信四川公用信息產(chǎn)業(yè)有限責(zé)任公司社會成熟人才招聘備考題庫有完整答案詳解
- 計(jì)量宣貫培訓(xùn)制度
- 2026中國電信四川公用信息產(chǎn)業(yè)有限責(zé)任公司社會成熟人才招聘備考題庫有答案詳解
- 《老年服務(wù)禮儀與溝通技巧》-《老年服務(wù)禮儀與溝通技巧》-老年服務(wù)禮儀與溝通技巧
- 2026.05.01施行的中華人民共和國漁業(yè)法(2025修訂)課件
- 原始股認(rèn)購協(xié)議書
- 八年級數(shù)學(xué)人教版下冊第十九章《二次根式》單元測試卷(含答案)
- 嚴(yán)肅財(cái)經(jīng)紀(jì)律培訓(xùn)班課件
評論
0/150
提交評論