home *** CD-ROM | disk | FTP | other *** search
- ;;;----------------------------------------------------------------------------
- ;;;
- ;;; GP.LSP ¬⌐Ñ╗ 0.5
- ;;;
- ;;; ¬⌐┼v (C) 1991-1992 Autodesk ñ╜Ñq
- ;;;
- ;;; Ñ╗│n┼ΘºK╢O¿╤▒z╢iªµÑ⌠ª≤Ñ╬│~╗▌¿D¬║½■¿⌐íB¡╫º∩ñ╬╡oªµ, ª²¼O░╚╜╨┐φ┤`ñU¡z
- ;;; ¡∞½h :
- ;;;
- ;;; 1) ñWªC¬║¬⌐┼v│qºi░╚╗▌ÑX▓{ªb¿Cñ@Ñ≈½■¿⌐∙╪íC
- ;;; 2) ¼█├÷¬║╗í⌐·ñσÑ≤ñ]Ñ▓╢╖⌐·╕ⁿ¬⌐┼v│qºiñ╬Ñ╗╢╡│\Ñi│qºiíC
- ;;;
- ;;; Ñ╗│n┼Θ╢╚┤ú¿╤º@¼░└│Ñ╬ñW¬║░╤ª╥, ª╙Ñ╝┴n⌐·⌐╬┴⌠ºtÑ⌠ª≤½O├╥; ╣∩⌐≤Ñ⌠ª≤»S«φ
- ;;; Ñ╬│~ñº╛A║┘⌐╩, ÑHñ╬░╙╖~╛P░Γ⌐╥┴⌠ºtÑX¿π¬║½O├╥, ªbª╣ñ@╖ºñ⌐ÑHº_╗{íC
- ;;;
- ;;;
- ;;;----------------------------------------------------------------------------
-
-
- ; Convert angle in degrees to radians
-
- (defun dtr (a)
- (* pi (/ a 180.0))
- )
-
- ; Acquire information for garden path
-
- (defun gpuser ()
- (setq sp (getpoint "\nñp«|░_┬I: "))
- (setq ep (getpoint "\nñp«|▓╫┬I: "))
- (setq hwidth (getdist "\nñp«|Ñb╝e: " sp))
- (setq trad (getdist "\n┐jº≈Ñb«|: " sp))
- (setq tspac (getdist "\n╛Q┐j╢í╢Z: " sp))
- (setq pangle (angle sp ep))
- (setq plength (distance sp ep))
- (setq width (* 2 hwidth))
- (setq angp90 (+ pangle (dtr 90))) ; Path angle + 90 deg
- (setq angm90 (- pangle (dtr 90))) ; Path angle - 90 deg
- )
-
- ; Draw outline of path
-
- (defun drawout ()
- (command "_.PLINE"
- (setq p (polar sp angm90 hwidth))
- (setq p (polar p pangle plength))
- (setq p (polar p angp90 width))
- (polar p (+ pangle (dtr 180)) plength)
- "_C"
- )
- )
-
- ; Place one row of tiles given distance along path
- ; and possibly offset it
-
- (defun drow (pd offset)
- (setq pfirst (polar sp pangle pd))
- (setq pctile (polar pfirst angp90 offset))
- (setq p1tile pctile)
- (while (< (distance pfirst p1tile) (- hwidth trad))
- (command "_.CIRCLE" p1tile trad)
- (setq p1tile (polar p1tile angp90 (+ tspac trad trad)))
- )
- (setq p1tile (polar pctile angm90 (+ tspac trad trad)))
- (while (< (distance pfirst p1tile) (- hwidth trad))
- (command "_.CIRCLE" p1tile trad)
- (setq p1tile (polar p1tile angm90 (+ tspac trad trad)))
- )
- )
-
- ; Draw the rows of tiles
-
- (defun drawtiles ()
- (setq pdist (+ trad tspac))
- (setq off 0.0)
- (while (<= pdist (- plength trad))
- (drow pdist off)
- (setq pdist (+ pdist (* (+ tspac trad trad) (sin (dtr 60)))))
- (if (= off 0.0)
- (setq off (* (+ tspac trad trad) (cos (dtr 60))))
- (setq off 0.0)
- )
- )
- )
-
- ; Execute command, calling constituent functions
-
- (defun C:GPATH ()
- (gpuser)
- (setq sblip (getvar "blipmode"))
- (setq scmde (getvar "cmdecho"))
- (setvar "blipmode" 0)
- (setvar "cmdecho" 0)
- (drawout)
- (drawtiles)
- (setvar "blipmode" sblip)
- (setvar "cmdecho" scmde)
- (princ)
- )
-
-