It is currently Sat Jul 06, 2024 7:50 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Help I am stuck with this script (SOLVED)
PostPosted: Sat Jan 30, 2016 2:47 pm  (#1) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4003
Location: Canada
Just trying to create a script that's drawing a path that represents the Golden Ratio/Phi grid.
with 3 rectangles.

It's giving me this error and I have no idea why.

Execution error for 'New Golden Ratio/Phi Path':
Error: ( : 1) Procedure execution of gimp-vectors-stroke-new-from-points failed

; -*-scheme-*-
; Tin Tran 2016.  No copyright.  Public Domain.
; Based on Guillermo Maldonado Rule of Thirds
(define (script-fu-path-gr image drawable)
    (let* (
        (width (car (gimp-image-width image)))
        (height (car (gimp-image-height image)))
      (new-vector (car (gimp-vectors-new image "Phi Grid")))
      (new-stroke 0)
      
        )
   (gimp-image-insert-vectors image new-vector 0 0)
   ;border path
   (gimp-vectors-stroke-new-from-points new-vector 0 8
                           (list->vector (list
                           0 0
                           width 0
                           width height
                           0 height
                           ))
                           TRUE)
                           
   ;vertical Phi rectangle
   (gimp-vectors-stroke-new-from-points new-vector 0 8
                           (list->vector (list
                           (/ (* width 382) 1000) 0
                           (/ (* width 1000) 1618) 0
                           (/ (* width 1000) 1618) height
                           (/ (* width 382) 1000) height
                           ))
                           TRUE)
                           
   ;horizontal Phi rectangle
   (gimp-vectors-stroke-new-from-points new-vector 0 8
                           (list->vector (list
                           0     (/ (* height 382) 1000)   
                           width (/ (* height 382) 1000)
                           width (/ (* height 1000) 1618)
                           0     (/ (* height 1000) 1618)
                           ))
                           TRUE)
                           
    (gimp-displays-flush)
  )
)

(script-fu-register "script-fu-path-gr"
  "New Golden Ratio/Phi Path"
  "Adds Golden Ratio/Phi Path"
  "Tin Tran"
  "Tin Tran, 2016"
  "Jan 2016"
  ""
  SF-IMAGE      "Input Image"      0
  SF-DRAWABLE   "Input Drawable"   0
)

(script-fu-menu-register "script-fu-path-gr"
                         "<Image>/Script-Fu/Create New/")


Attachments:
golden-rule-path.scm [1.53 KiB]
Downloaded 94 times

_________________
TinT


Last edited by trandoductin on Sat Jan 30, 2016 3:50 pm, edited 1 time in total.
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Help I am stuck with this script
PostPosted: Sat Jan 30, 2016 3:49 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
You need to supply 'gimp-vectors-stroke-new-from-points' with the control handle coordinates as well as the anchor coordinates. For a polygonal path, the control handle coordinates are the same as the anchor coordinates.

(gimp-vectors-stroke-new-from-points new-vector 0 24
                           (vector
                             0 0 0 0 0 0
                             width 0 width 0 width 0
                             width height width height width height
                             0 height 0 height 0 height
                             )
                           TRUE)

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Help I am stuck with this script (SOLVED)
PostPosted: Sat Jan 30, 2016 4:28 pm  (#3) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4003
Location: Canada
thank you.
This is good to know for future references.
I found a Golden sections guide in gimp too so i don't have to build a script that does it :hehe

_________________
TinT


Top
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Diolog box stuck and notaccessable

9

No new posts Attachment(s) Tool Options stuck in corner

3

No new posts Attachment(s) Looking for Script Coder to make Script of my VHS effect

2

No new posts Attachment(s) A liitle Start Help with a Script-Fu Script

3

No new posts Attachment(s) Cannot run test script-fu script via console

7



* Login  



Powered by phpBB3 © phpBB Group