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 <for...@gimpusers.com>:

> 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)
> _______________________________________________
> Gimp-developer mailing list
> Gimp-developer@lists.XCF.Berkeley.EDU
> https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
>



_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Reply via email to