RSS/Atom feed Twitter
Site is read-only, email is disabled

Visible Path anchors

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

Visible Path anchors Bob 29 May 13:41
  Visible Path anchors Joao S. O. Bueno 29 May 16:20
   Visible Path anchors Bob 29 May 21:58
Bob
2015-05-29 13:41:23 UTC (almost 9 years ago)

Visible Path anchors

Hi,
I have a situation where I need to draw some polylines with vertices. I thought the Path tool would be ideal for drawing the lines, and so it was. But I also need there to be a dot, or an X, or some such marker at each anchor point. So, is there a way to automatically place a glyph or something at each anchor location? Or, failing that, is there a way to make a mark at each desired anchor point location, then use those to create a path?

Thanks

Meddle not in the affairs of dragons, for thou art crunchy, and taste
good with ketchup.
Joao S. O. Bueno
2015-05-29 16:20:38 UTC (almost 9 years ago)

Visible Path anchors

Hi, the the way to do this is to use Python to iterate over the Path coordinates and
making a paintbrush stroke mark at each of them.

Set the paintbrush for your desired "X" mark, yur image in the last (right most) tab in GIMP, and your desired layer as the top layer - them open the Python console with filters->python console And paste this in there:

img = gimp.image_list()[0]

for stroke in img.vectors[0].strokes: for i in range (0, len(stroke.points[0]), 6): coords = stroke.points[0][i:i + 2] pdb.gimp_paintbrush_default(img.layers[0], 2, coords)

And you are set. The "[0]" on the first line is the index of the rightmost image tab, the "[0]" on the "for i" line is for the topmost path, and the "[0]" on the last line for the topmost layer. CHange your idnexes according to the desired targets.

On 29 May 2015 at 10:41, Bob wrote:

Hi,
I have a situation where I need to draw some polylines with vertices. I thought the Path tool would be ideal for drawing the lines, and so it was. But I also need there to be a dot, or an X, or some such marker at each anchor point. So, is there a way to automatically place a glyph or something at each anchor location? Or, failing that, is there a way to make a mark at each desired anchor point location, then use those to create a path?

Thanks

-- Meddle not in the affairs of dragons, for thou art crunchy, and taste good with ketchup.
_______________________________________________ gimp-user-list mailing list
List address: gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list List archives: https://mail.gnome.org/archives/gimp-user-list

Bob
2015-05-29 21:58:36 UTC (almost 9 years ago)

Visible Path anchors

That works beautifully, thank you! I modified it slightly so it loops through all the paths in the layer, and it works just as required.

Now I just need to figure out how to stroke the paths.

On Fri, May 29, 2015 at 10:20 AM, Joao S. O. Bueno wrote:

Hi, the the way to do this is to use Python to iterate over the Path coordinates and
making a paintbrush stroke mark at each of them.

Set the paintbrush for your desired "X" mark, yur image in the last (right most) tab in GIMP, and your desired layer as the top layer - them open the Python console with filters->python console And paste this in there:

img = gimp.image_list()[0]

for stroke in img.vectors[0].strokes: for i in range (0, len(stroke.points[0]), 6): coords = stroke.points[0][i:i + 2] pdb.gimp_paintbrush_default(img.layers[0], 2, coords)

And you are set. The "[0]" on the first line is the index of the rightmost image tab, the "[0]" on the "for i" line is for the topmost path, and the "[0]" on the last line for the topmost layer. CHange your idnexes according to the desired targets.

On 29 May 2015 at 10:41, Bob wrote:

Hi,
I have a situation where I need to draw some polylines with vertices. I thought the Path tool would be ideal for drawing the lines, and so it was. But I also need there to be a dot, or an X, or some such marker at each anchor point. So, is there a way to automatically place a glyph or something at each anchor location? Or, failing that, is there a way to make a mark at each desired anchor point location, then use those to create a path?

Thanks

-- Meddle not in the affairs of dragons, for thou art crunchy, and taste good with ketchup.
_______________________________________________ gimp-user-list mailing list
List address: gimp-user-list@gnome.org List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list List archives: https://mail.gnome.org/archives/gimp-user-list

Meddle not in the affairs of dragons, for thou art crunchy, and taste
good with ketchup.