home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p024 / 11.img / BONUS2.LIB / GP.LSP < prev    next >
Encoding:
Text File  |  1993-01-23  |  2.6 KB  |  102 lines

  1. ;;;----------------------------------------------------------------------------
  2. ;;;
  3. ;;;   GP.LSP   ¬⌐Ñ╗ 0.5
  4. ;;;
  5. ;;;   ¬⌐┼v (C) 1991-1992  Autodesk ñ╜Ñq
  6. ;;;
  7. ;;;   Ñ╗│n┼ΘºK╢O¿╤▒z╢iªµÑ⌠ª≤Ñ╬│~╗▌¿D¬║½■¿⌐íB¡╫º∩ñ╬╡oªµ, ª²¼O░╚╜╨┐φ┤`ñU¡z
  8. ;;;   ¡∞½h :
  9. ;;;
  10. ;;;   1)  ñWªC¬║¬⌐┼v│qºi░╚╗▌ÑX▓{ªb¿Cñ@Ñ≈½■¿⌐∙╪íC
  11. ;;;   2)  ¼█├÷¬║╗í⌐·ñσÑ≤ñ]Ñ▓╢╖⌐·╕ⁿ¬⌐┼v│qºiñ╬Ñ╗╢╡│\Ñi│qºiíC
  12. ;;;
  13. ;;;   Ñ╗│n┼Θ╢╚┤ú¿╤º@¼░└│Ñ╬ñW¬║░╤ª╥, ª╙Ñ╝┴n⌐·⌐╬┴⌠ºtÑ⌠ª≤½O├╥; ╣∩⌐≤Ñ⌠ª≤»S«φ
  14. ;;;   Ñ╬│~ñº╛A║┘⌐╩, ÑHñ╬░╙╖~╛P░Γ⌐╥┴⌠ºtÑX¿π¬║½O├╥, ªbª╣ñ@╖ºñ⌐ÑHº_╗{íC
  15. ;;;
  16. ;;;
  17. ;;;----------------------------------------------------------------------------
  18.  
  19.  
  20. ; Convert angle in degrees to radians
  21.  
  22. (defun dtr (a)
  23.   (* pi (/ a 180.0))
  24. )
  25.  
  26. ; Acquire information for garden path
  27.  
  28. (defun gpuser ()
  29.   (setq sp (getpoint "\nñp«|░_┬I: "))
  30.   (setq ep (getpoint "\nñp«|▓╫┬I: "))
  31.   (setq hwidth (getdist "\nñp«|Ñb╝e: " sp))
  32.   (setq trad (getdist "\n┐jº≈Ñb«|: " sp))
  33.   (setq tspac (getdist "\n╛Q┐j╢í╢Z: " sp))
  34.   (setq pangle (angle sp ep))
  35.   (setq plength (distance sp ep))
  36.   (setq width (* 2 hwidth))
  37.   (setq angp90 (+ pangle (dtr 90))) ; Path angle + 90 deg
  38.   (setq angm90 (- pangle (dtr 90))) ; Path angle - 90 deg
  39. )
  40.  
  41. ; Draw outline of path
  42.  
  43. (defun drawout ()
  44.   (command "_.PLINE"
  45.     (setq p (polar sp angm90 hwidth))
  46.     (setq p (polar p pangle plength))
  47.     (setq p (polar p angp90 width))
  48.     (polar p (+ pangle (dtr 180)) plength)
  49.     "_C"
  50.   )
  51. )
  52.  
  53. ; Place one row of tiles given distance along path
  54. ; and possibly offset it
  55.  
  56. (defun drow (pd offset)
  57.   (setq pfirst (polar sp pangle pd))
  58.   (setq pctile (polar pfirst angp90 offset))
  59.   (setq p1tile pctile)
  60.   (while (< (distance pfirst p1tile) (- hwidth trad))
  61.     (command "_.CIRCLE" p1tile trad)
  62.     (setq p1tile (polar p1tile angp90 (+ tspac trad trad)))
  63.   )
  64.   (setq p1tile (polar pctile angm90 (+ tspac trad trad)))
  65.   (while (< (distance pfirst p1tile) (- hwidth trad))
  66.     (command "_.CIRCLE" p1tile trad)
  67.     (setq p1tile (polar p1tile angm90 (+ tspac trad trad)))
  68.   )
  69. )
  70.  
  71. ; Draw the rows of tiles
  72.  
  73. (defun drawtiles ()
  74.   (setq pdist (+ trad tspac))
  75.   (setq off 0.0)
  76.   (while (<= pdist (- plength trad))
  77.     (drow pdist off)
  78.     (setq pdist (+ pdist (* (+ tspac trad trad) (sin (dtr 60)))))
  79.     (if (= off 0.0)
  80.       (setq off (* (+ tspac trad trad) (cos (dtr 60))))
  81.       (setq off 0.0)
  82.     )
  83.   )
  84. )
  85.  
  86. ; Execute command, calling constituent functions
  87.  
  88. (defun C:GPATH ()
  89.   (gpuser)
  90.   (setq sblip (getvar "blipmode"))
  91.   (setq scmde (getvar "cmdecho"))
  92.   (setvar "blipmode" 0)
  93.   (setvar "cmdecho" 0)
  94.   (drawout)
  95.   (drawtiles)
  96.   (setvar "blipmode" sblip)
  97.   (setvar "cmdecho" scmde)
  98.   (princ)
  99. )
  100.  
  101.  
  102.