Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python_fu_ofn_circumcircle usage/parameters
#4
I don't know if you need or want any more help in this. But I wrote quickly a Python function to create a path from a point list:
Code:
# Convert a pointlist=[[x,y],[x,y],...] to a path and insert in Gimp
def pointlist2path(image, pointlist, closed=False):
   path = pdb.gimp_vectors_new(image, 'path from pointlist')
   points = []
   for x,y in pointlist:
       points += [x,y,x,y,x,y]
   pdb.gimp_vectors_stroke_new_from_points(path, 0, len(points), points, closed)
   pdb.gimp_image_insert_vectors(image, path, None, 0)
   path.visible = True
   return path

##################

# Usage:
pointlist = [[0,0],[300,300],[500,10]]
path = pointlist2path(image, pointlist)
pdb.python_fu_ofn_circumcircle(image,path)
Reply


Messages In This Thread
RE: python_fu_ofn_circumcircle usage/parameters - by Ottia Tuota - 01-23-2022, 02:10 PM

Forum Jump: