Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gimp.VectorsBezierStroke documentation?
#1
Hi,
I've studying Python Fu code, and I came across this function call:

Code:
stroke = gimp.VectorsBezierStroke(vectors, points, 0)

My question is, where can I find documentation to this gimp module object, VectorsBezierStroke? I tried a 'help(gimp.VectorsBezierStroke)' command in the console, but the object lacks any '__init__' description as far I can tell. Searching the Gimp Python Documentation page that is online doesn't seen to have any references to this object either.
Reply
#2
In the Python console, do help(gimp.VectorsBezierStroke).

Otherwise, as usual most of this can also be accessed from the PDB API, so the very scanty description from the help() get a more detailed coverage in the Python procedure browser (gimp-vectors-stroke-*)(with the usual caveats about the auto-generated docs that are initially meant for Scheme).

In practice, the really useful calls are:
  • close
  • get_length
  • get_point_at_dist
  • get_points
  • interpolate
  • new_from_points
I have never found much use for the transforms because they are simple math functions that you can write yourself and one of them is buggy (rounds the result to the nearest integer).

gimp.VectorsBezierStroke(path,points,closed) is essentially a simplified/friendlier version of new_from_points.
  • path is a gimp.Vectors object to which the stroke is added
  • pointsis a linear list of triplets coordinates: [x0,y0,x1,y1,x2,y2,x3,y3,x4,y4,x5,y5]. Each part of 6 coordinate describes a "triplet" (backward tangent, anchor,forward tangent), so your list should always have a multiple of 6 elements. Usually I keep points coordinates together in some kind of tuple/pair to, so this list is generated form the list of points with something like [coord for point in points for coord in point].
  • closed is a closure indicator, that tells if there is a line from the last anchor back to the first anchor (True or False)
If the path concepts aren't too clear in your mind see: Paths Basics

Plenty of examples here: Ofnuts' Gimp path tools downloads
Reply
#3
Thank you kindly for the detailed reply which I find very helpful.
Reply


Forum Jump: