RSS/Atom feed Twitter
Site is read-only, email is disabled

need help with script-fu vector creation

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

need help with script-fu vector creation iheartgimp 05 Jun 23:29
  need help with script-fu vector creation saulgoode@flashingtwelve.brickfilms.com 05 Jun 23:57
   need help with script-fu vector creation iheartgimp 06 Jun 17:45
2009-06-05 23:29:07 UTC (over 15 years ago)
postings
2

need help with script-fu vector creation

So I wanted to use gimp-vectors-stroke-new-from-points to create a triangle-shaped stroke but every time I use it in the console or my script, it fails giving me this message:

Error: Procedure execution of gimp-vectors-stroke-new-from-points failed

I first use: (gimp-vectors-new 1 "vector-one")

where "1" represents the image's value

Then I use: (gimp-vectors-stroke-new-from-points 1037 0 3 #( 1000 0 1000 207 854 146 ) TRUE)

where 1037 is the image, 0 is the stroke type
3 is the number of points
#(...) are the values of the x and y coordinates of the 3 points and TRUE means the stroke is closed

I am still sort of new to script-fu.

saulgoode@flashingtwelve.brickfilms.com
2009-06-05 23:57:51 UTC (over 15 years ago)

need help with script-fu vector creation

I don't have access to GIMP right now but if I recall correctly, the PDB's description of the third parameter is misleading; it is actually the number of "coordinates" and not the number of "points".

Also, note that each vertex of your triangle will require three points: the anchor plus the two bezier control handles. This means that your stroke call will need to pass 18 coordinates overall.

(gimp-vectors-stroke-new-from-points 1037 0 18 #( ix1 iy1 ax1 ay1 oy1 oy1
ix2 iy2 ax2 ay2 oy2 oy2
ix3 iy3 ax3 ay3 oy3 oy3 ) TRUE)

ix and iy are the coordinates of the incoming control handle ax and ay are the coordinates of the anchor ox and oy are the coordinates of the outgoing control handle

For straight lines, the control handle coordinates are identical to the anchor's coordinates.

(Again, this is from memory and may not be perfectly correct.)

Quoting Greg Schwartz :

So I wanted to use gimp-vectors-stroke-new-from-points to create a triangle-shaped stroke but every time I use it in the console or my script, it
fails giving me this message:

Error: Procedure execution of gimp-vectors-stroke-new-from-points failed

I first use: (gimp-vectors-new 1 "vector-one")

where "1" represents the image's value

Then I use: (gimp-vectors-stroke-new-from-points 1037 0 3 #( 1000 0 1000 207 854 146 ) TRUE)

where 1037 is the image, 0 is the stroke type
3 is the number of points
#(...) are the values of the x and y coordinates of the 3 points and TRUE means the stroke is closed

I am still sort of new to script-fu.

-- Greg Schwartz (via www.gimpusers.com)

2009-06-06 17:45:59 UTC (over 15 years ago)
postings
2

need help with script-fu vector creation

thanks for the help!