 ; SST - list based pattern drawer.
 ; Copyright 1993, 2002 by Rocket Software Ltd.
 ; The rumour that the mouse was originally called the hamster is untrue.
 (DEFUN C:SST (/ ppa reset sid nxpt nxangl nxlen shr num angg pb)
  (setvar "cmdecho" 0)
  (if (and angs lens ang fac shrink)
      (setq reset (strcase (getstring "Same again? <N>: "))))
  (if pa 
     (setq ppa (getpoint pa "Start point or <Return> for previous: "))
     (setq ppa (getpoint "Start point: ")))
  (if ppa (setq pa ppa))
  (if (or (null reset) (= reset "") (= reset "N") (= reset "NO"))
      (progn
           (setq ang 0)
           (setq fac 1)
           (setq lens ())
           (setq angs ())
           (while (setq nxpt (getpoint pa "Next angle and length: "))
                  (setq nxangl (angle pa nxpt))
                  (setq angs (append angs (list nxangl)))
                  (setq nxlen (distance pa nxpt))
                  (setq lens (append lens (list nxlen)))
                  (if (and pa nxpt) (grdraw pa nxpt -1))
                  (setq pa nxpt))
           (if (null shrink) (setq shrink 0.99))
           (setq shr (getreal (strcat "Spiral factor <"
                                      (rtos shrink 2 5) ">: ")))
           (if shr (setq shrink shr))))
  (if (null numm) (setq numm 100))
  (setq nump (getint (strcat "Number of repeats <" (itoa numm) ">: ")))
  (if nump (setq numm nump))
  (command ".pline" pa)
  (repeat numm
         (setq num 0)
         (while (setq angg (nth num angs))
                (setq sid (nth num lens))
                (setq fac (* shrink fac))
                (setq sid (* fac sid))
                (setq pb (polar pa ang sid))
                (command pb)
                (setq ang (+ ang angg))
                (setq pa pb)
                (setq num (1+ num))))
  (command "")
 (princ))