Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python fu: Vector stroke scaling
#4
(08-24-2018, 06:01 PM)awan Wrote: I want something like grow/ shrink selection but for strokes. We specify how much to grow/ shrink.

Sorry for my BAD English.

I guessed so Smile

So, the 2.10 technique, to get the path that is 10px inwards or outwards from your path:

- Stroke the path in line mode (new 2.10 API (*)) on a transparent layer, with a 20px width
- Alpha to selection: gimp_select_item(layer)
- Select>ToPath: plug_in_sel2path(image, drawable)
- That path has two strokes, one is inside, one is outside (how to tell: get the length, the shortest is inside)

(*) The new 2.10 API, the calls you'll have to use:
Code:
pdb.gimp_context_set_stroke_method(STROKE_LINE)
pdb.gimp_context_set_line_cap_style(...)
pdb.gimp_context_set_line_join_style(...)
pdb.gimp_context_set_line_miter_limit(...)
pdb.gimp_context_set_line_width(width)
pdb.gimp_drawable_edit_stroke_item(drawable, path)
Reply


Messages In This Thread
Python fu: Vector stroke scaling - by awan - 08-24-2018, 04:04 PM
RE: Python fu: Vector stroke scaling - by Ofnuts - 08-24-2018, 04:57 PM
RE: Python fu: Vector stroke scaling - by awan - 08-24-2018, 06:01 PM
RE: Python fu: Vector stroke scaling - by Ofnuts - 08-24-2018, 07:18 PM
RE: Python fu: Vector stroke scaling - by awan - 08-25-2018, 04:38 AM
RE: Python fu: Vector stroke scaling - by Ofnuts - 08-25-2018, 08:16 AM

Forum Jump: