;;;
;;; draw-spiral.scm
;;;
;;;
;;; Arch. Giuseppe Conte
;;;
;;; Raymond Ostertag 2004/09 changed menu entry
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;;; Define the function:
(define (script-fu-draw-spiral inImage inLayer dx dy Spire Passo)
(set! angolo (/ 360 Passo))
(set! arco (* angolo (/ 3.14 180)))
(set! beta 0)
(set! gamma 0)
(set! gcount arco)
(set! npoint 4)
(let* ( (segment (cons-array 4 'double))
(stepx dx)
(stepy dy)
(lunghezza (* 2 *pi* Spire))
)
(while (<= gcount lunghezza)
(set! raggio gcount)
(set! beta (+ beta arco))
(set! gamma (- beta arco))
(aset segment 0 (+ (* raggio (cos gamma)) stepx))
(aset segment 1 (+ (- (* raggio (sin gamma))) stepy))
(aset segment 2 (+ (* raggio (cos beta)) stepx))
(aset segment 3 (+ (- (* raggio (sin beta))) stepy))
(gimp-pencil inLayer npoint segment )
(set! gcount (+ gcount arco))
(gimp-displays-flush)
);end while
;(gimp-displays-flush)
);;let
) ;;def
(script-fu-register
"script-fu-draw-spiral"
_"/Script-Fu/Geometry/Draw Spiral..."
"Draw the spiral with the brush and color active."
"Arch. Giuseppe Conte "
"2002, Giuseppe Conte"
"08 Maggio 2002 - Florence - Italy"
"RGB* GRAY* INDEXED*"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-ADJUSTMENT "X center" '(0 0 9999 1 10 0 1)
SF-ADJUSTMENT "Y center" '(0 0 9999 1 10 0 1)
SF-ADJUSTMENT "Number of spire" '(3 0 9999 1 10 0 1)
SF-ADJUSTMENT "Segments for circle" '(60 0 9999 1 10 0 1)
)