Documente Academic
Documente Profesional
Documente Cultură
;d dimensiunea
;it treapta de precizie
;tol toleranta
(if (> it 16) (setq it 16))
(setq lista '(( 1 3 0.8 1.2 2 3 4 6 10 14 25 40 60 100 140 250 400 600)
( 3 6 1 1.5 2.5 4 5 8 12 18 30 48 75 120 180 300 480 750)
( 6 10 1 1.5 2.5 4 6 9 15 22 36 58 90 150 220 360 580 900)
( 10 18 1.2 2 3 5 8 11 18 27 43 70 110 180 270 430 700 1100)
( 18 30 1.5 2.5 4 6 9 13 21 33 52 84 130 210 330 520 840 1300)
( 30 50 1.5 2.5 4 7 11 16 25 39 62 100 160 250 390 620 1000 1600)
( 50 80 2 3 5 8 13 19 30 46 74 120 190 300 460 740 1200 1900)
( 80 120 2.5 4 6 10 15 22 35 54 87 140 220 350 540 870 1400 2200)
(120 180 3.5 5 8 12 18 25 40 63 100 160 250 400 630 1000 1600 2500)
(180 250 4.5 7 10 14 20 29 46 72 115 185 290 460 720 1150 1850 2900)
(250 315 6 8 12 16 23 32 52 81 130 210 320 520 810 1300 2100 3200)
(315 400 7 9 13 18 25 36 57 89 140 230 360 570 890 1400 2300 3600)
(400 500 8 10 15 20 27 40 63 97 155 250 400 630 970 1550 2500 4000)
)
)
(setq i 0)
(repeat 13
(if (and (> d (nth 0 (nth i lista))) (<= d (nth 1 (nth i lista)))) (setq tol (nth (+ it 1) (nth i
lista))))
(setq i (1+ i))
)
(/ tol 1000.0)
)
1
)
)
(setq i 0)
(repeat 13
(if (and (>= d (nth 0 (nth i lista))) (< d (nth 1 (nth i lista)))) (setq nl i))
(setq i (1+ i))
)
(setq linie (nth nl lista)
listag (member tol linie)
it (- (length linie) (length listag) 1)
)
(setq j 2 )
(repeat 15
(if (and (> tol (nth j linie)) (<= tol (nth (1+ j) linie))) (setq it j ))
(setq j (1+ j))
)
it
)
2
(initget "0.4,4 0.8,8 1.6,1 3.2,3 6.3,6 12.5,12 25,2")
(setq rug
(Getkword "\nRugozitatea suprafetei [0.4/0.8/1.6/3.2/6.3/12.5/25] <6.3>:" )
)
(if (not rug) (setq rug "6.3"))
(setq rug (read rug))
rug
)
3
(defun det_proc (it ra) ; determina procedeele de prelucrare a suprafetei
(setq procedee '("StrunjireD"))
(if (or (<= it 12) (<= ra 12.5)) (setq procedee '("StrunjireD")))
(if (or (<= it 11) (<= ra 6.3)) (setq procedee '("StrunjireD" "StrunjireF")))
(if (or (<= it 10) (<= ra 3.2)) (setq procedee '("StrunjireD" "StrunjireF" "RectficareD")))
(if (or (<= it 8) (<= ra 0.8)) (setq procedee '("StrunjireD" "StrunjireF" "RectficareD"
"RectficareF")))
(if (<= ra 0.2) (setq procedee '("StrunjireD" "StrunjireF" "RectficareD" "RectficareF"
"Superfinis")))
procedee
)
5
(sqrt
(+ (expt (* 0.020568 (expt d 0.366)) 2)
(*
(expt 0.06 2)
(+
(expt (* 0.032494 (/ 1 (expt d 0.4482)) l 2)
(expt (* 0.39985 (expt m 0.2728)) 2)))))))
(det_tol d 12))
)
)
((= tsf "Tras")
(setq valaminsf (* 0.4223 (expt d 0.18)(expt l 0.002)))
)
((= tsf "Laminat")
(setq valaminsf (* 0.44 (expt d 0.2)(expt l -0.0046)))
)
);cond
6
((= tsf "Laminat")
(setq valaminrf (* 0.0996 (expt d 0.23)))
)
);cond
(/ (fix (+ (* valaminrf 100)0.5)) 100.0)
)
7
(setq c1 20
h1 30
l1 25
h2 35
pc1 pb
pc2 (polar pc1 (/ (* 220 pi) 180) c1)
;pc1 pc2... pe conturul cutitului spre stanga
pc3 (polar pc2 (/ (* 270 pi) 180) h1)
pc4 (polar pc3 (/ (* 0 pi) 180) l1)
pc5 (polar pc4 (/ (* 90 pi) 180) h2)
)
(command
"pline" pc1 pc2 pc3 pc4 pc5 "c"
"region" "l" "")
(setq cutit (entlast))
(setq
pco1 (polar pb (/ pi 2) (- d (* 2 ad)))
pco2 (polar pc2 (/ pi 2) (+ d (* 2 (- (cadr pc1) (cadr pc2) ad))))
pco5 (polar pc5 (/ pi 2) (+ d (* 2 (- (cadr pc1) (cadr pc5) ad))))
)
(command "pline" pco1 pco5 pco2 "c"
"region" "l" "")
)
8
;ad - adancimea
(command
"pline" pb "@25,0" "@0,-40" "@-25,0" "c"
"region" "l" "")
)
)
(defun c:cilindrica ()
(setq cmd (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq osm (getvar "osmode"))
(setvar "osmode" 0)
(setq strat (getvar "clayer"))
(princ "\n")
(princ "\n R E Z U L T A T E")
(princ "\n")
11
(writeln "\n Abatere inferioara: " aisf)
(writeln "\n Abatere superioara: " assf)
)
)
(textscr)
(getpoint "\napasa enter pentru revenire in mod grafic")
(graphscr)
(initget "Shade Wireframe")
(setq opt_sim (getkword "\nSimularea se face in mod [Shade/Wireframe] <Wireframe>"))
(if (not opt_sim) (setq opt_sim "Wireframe"))
(if (= opt_sim "Wireframe")
(command "_shademode" "2")
(command "_shademode" "o")
)
(if (= ks 1)
(progn
(strunj_cil dsemif (/ asd 2) "red")
(getpoint "\napasa enter pentru strunjirea finisare")
(if (nth 1 procedee) (strunj_cil dsd (/ asf 2) "blue"))
(getpoint "\napasa enter pentru rectificare degrosare")
(if (nth 2 procedee) (rect_cil dsf (/ ard 2) "magenta"))
(getpoint "\napasa enter pentru rectificare finisare")
12
(if (nth 3 procedee) (rect_cil drd (/ arf 2) "green"))
)
)
(setvar "osmode" osm)
(setvar "clayer" strat)
(setvar "cmdecho" cmd)
(prin1)
)
13