home *** CD-ROM | disk | FTP | other *** search
- ;***********************************
- ;* The program for drawing ring. *
- ;***********************************
- (DEFUN RING ()
- (SETVAR "CMDECHO" 0)
- (SETVAR "BLIPMODE" 0)
- (setq schl 0 xchl 0 dgr1 0 angr 0 dgch " " schd 0 xchd 0 lk 1)
- (MENUCMD "S=RI1")
- (setq lk (getreal "\n╤í ╘± ╗╖ ▓█ └α ╨═(0:├▄╖Γ▓█ 1:╥╗░π▓█):(1) "))
- (if (null lk)(setq lk 1))
- (setq fpt (getpoint "\n╙├ ╩« ╫╓ ╧▀ ╢¿ ╗╖ ▓█ ╞≡ ╩╝ ├µ:"))
- (MENUCMD "S=IN1")
- (setq dr1 (getreal "\n╩Σ ╚δ ╗╖ ▓█ ─┌ ▓α ╓▒ ╛╢=: "))
- (MENUCMD "S=IN2")
- (setq lr (getstring "\n╙╨ ╖± ┼Σ ║╧ ╣½ ▓ε(N)? "))
- (MENUCMD "S=IN1")
- (if (or (= lr "y") (= lr "Y"))(progn
- (setq schd (getreal "\n╔╧ ╞½ ▓ε=: "))
- (setq xchd (getreal "\n╧┬ ╞½ ▓ε=: "))
- ))
- (if (= lk 0)(progn
- (setq b1 (getreal "\n╩Σ ╚δ ╗╖ ▓█ ┐φ=: "))
- (setq lr " ")
- (MENUCMD "S=IN2")
- (setq lr (getstring "\n▓█ ┐φ ╙╨ ╬▐ ╣½ ▓ε(N)? "))
- (MENUCMD "S=IN1")
- (if (or (= lr "y") (= lr "Y"))(progn
- (setq angr (getreal "\n╔╧ ╞½ ▓ε=: "))
- (setq dgr1 (getreal "\n╧┬ ╞½ ▓ε=: "))
- ))
- ))
- (if (= lk 1)(setq dl (getreal "\n╩Σ ╚δ ═Γ ▓α ╓▒ ╛╢=: ") b1 (/ (- dl dr1) 2)))
- (setq h1 (getreal "\n╩Σ ╚δ ╗╖ ▓█ ╔ε=: (╚⌠╗∙├µ╘┌╙╥,╩Σ╕║╓╡) "))
- (setq lr "n")
- (MENUCMD "S=IN2")
- (setq lr (getstring "\n╔ε ╙╨ ╬▐ ╣½ ▓ε(N)? "))
- (MENUCMD "S=IN1")
- (if (or (= lr "y") (= lr "Y"))(progn
- (setq schl (getreal "\n╔╧ ╞½ ▓ε=: "))
- (setq xchl (getreal "\n╧┬ ╞½ ▓ε=: "))
- ))
- (setq xg (car fpt))
- (setq dr (* (/ dr1 2) s) h (* h1 s) dl (+ dr (* b1 s)))
- (setq dgl1 (getreal "\n╩Σ ╚δ ╡╣ ╜╟ │ñ ╢╚=(0): "))
- (if (null dgl1)(setq dgl1 0))
- (if (/= dgl1 0)(setq angl (getreal "\n╩Σ ╚δ ╡╣ ╜╟ ╜╟ ╢╚=: ")))
- (setq tg (/ (sin (* (/ 3.1416 180) angl)) (cos (* (/ 3.1416 180) angl))))
- (setq dgl (* dgl1 s) atl (* dgl tg))
- (setq topl (list xg (+ yb dl atl)) botl (list xg (- (+ yb dr) atl)))
- (if (> h 0)(setq tof (list (+ xg dgl) (+ yb dl)) bof (list (+ xg dgl) (+ yb dr))))
- (if (< h 0)(setq tof (list (- xg dgl) (+ yb dl)) bof (list (- xg dgl) (+ yb dr))))
- (setq toe (list (+ xg h) (+ yb dl)) boe (list (+ xg h) (+ yb dr)))
- (setq topr (list (+ xg h) (- yb dr)))
- (command "layer" "n" "f9" "s" "f9" "l" "hidden" "" "color" "2" "" "")
- (command "line" botl bof tof topl tof toe boe bof boe topr "")
- (setq topl (list xg (+ (- yb dr) atl)) botl (list xg (- yb dl atl)))
- (if (> h 0)(setq tof (list (+ xg dgl) (- yb dr)) bof (list (+ xg dgl) (- yb dl))))
- (if (< h 0)(setq tof (list (- xg dgl) (- yb dr)) bof (list (- xg dgl) (- yb dl))))
- (setq boe (list (+ xg h) (- yb dl)))
- (command "line" topr boe bof botl bof tof topl tof topr "")
- (setq fpt (list xg yb) no (+ no 1) lx (- xg xf) lx (/ lx s))
- (if (< h 0)(setq fpt (list (+ xg h) yb)))
- (setq dl1 (+ dr1 (* 2 b1)) l1 h1 dgr dgr1)
- (attdef2)
- (attdef1 "schd1" schd fpt)
- (attdef1 "xchd1" xchd fpt)
- (attdef1 "ll1" lx fpt)
- (attdef1 "lk1" lk fpt)
- (attdef1 "gpsz1" "R" fpt)
- (setq toe (list (+ xg h) (+ yb dl)))
- (command "block" no fpt "w" botl toe "")
- (command "insert" no fpt "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "")
- ;(redraw)
- (MENUCMD "S=SCREEN")
- )
- (RING)