Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gimp.VectorsBezierStroke documentation?
#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


Messages In This Thread
RE: gimp.VectorsBezierStroke documentation? - by Ofnuts - 10-27-2023, 08:00 PM

Forum Jump: