It is currently Mon Sep 21, 2026 12:39 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Stroke-id help needed
PostPosted: Sun Feb 17, 2013 5:36 pm  (#1) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
GIMP Version: 2.6.11
Operating System: Windows
OS Version: XP - SP3
GIMP Experience: Beginner Level



I have been trying to use the vector scale procedure

(gimp-vectors-stroke-scale vectors stroke-id scale-x scale-y)

vectors I received from (car (gimp-image-get-active-vectors image))

But I do not know how to get the stroke-id, can anyone help :gaah

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Stroke-id help needed
PostPosted: Sun Feb 17, 2013 7:03 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
AFAIK the stroke has only 3 items: an ID, a "closed" flag, and a list of points coordinates, so it shouldn't be hard to find the relevant c{d|a}*r instruction to fetch it.

Of course, those who have sold their soul to the Evil Snake merely use

stroke.ID

but that's deemed Too Easy by the Keepers of the Parentheses.

_________________
Image


Top
 Post subject: Re: Stroke-id help needed
PostPosted: Sun Feb 17, 2013 7:19 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Nov 16, 2011
Posts: 5127
Location: Metro Vancouver, BC
Graechan wrote:
But I do not know how to get the stroke-id, can anyone help :gaah

I can't help you because I'm still learning the language but I do have a suggestion; have a look at the, Identify Image Objects code.

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Stroke-id help needed
PostPosted: Sun Feb 17, 2013 8:55 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
ofnuts I have not as yet sold my soul but it,s tempting
Odinbc thanks for the script lead

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Stroke-id help needed
PostPosted: Sun Feb 17, 2013 11:24 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
(let* ((path (car (gimp-image-get-active-vectors image)))
       (strokes (vector->list (cadr (gimp-vectors-get-strokes path)))) )
  ;
  ; do stuff with your list of strokes
  ;
  )


Graechan wrote:
I have been trying to use the vector scale procedure

To be precise, from a GIMP PDB standpoint there is no such concept as a "vector"; there is only the "vectors" object. It always has an "s", even though it is (usually) referencing a single object. In other words, what you are trying to use is the vectors scale procedure.

I go into more detail about this anomaly in terminology here.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Stroke-id help needed
PostPosted: Mon Feb 18, 2013 12:27 am  (#6) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
ofnuts wrote:
Of course, those who have sold their soul to the Evil Snake merely use

stroke.ID

but that's deemed Too Easy by the Keepers of the Parentheses.

It's not so much that it is Too Easy, but that the information is basically useless in Python plug-ins, unless you plan on searching through all the image's paths for the one with a particular ID.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Stroke-id help needed
PostPosted: Mon Feb 18, 2013 2:27 am  (#7) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
thanks Saulgoode paths are something I want to get a grasp of even though it's confusing this old noggin of mine

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Stroke-id help needed
PostPosted: Mon Feb 18, 2013 2:58 am  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Graechan wrote:
thanks Saulgoode paths are something I want to get a grasp of even though it's confusing this old noggin of mine

My own little write-up on the subject:

http://gimp-path-tools.sourceforge.net/paths-faq.shtml

_________________
Image


Top
 Post subject: Re: Stroke-id help needed
PostPosted: Mon Feb 18, 2013 3:09 am  (#9) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
saulgoode wrote:
ofnuts wrote:
Of course, those who have sold their soul to the Evil Snake merely use

stroke.ID

but that's deemed Too Easy by the Keepers of the Parentheses.

It's not so much that it is Too Easy, but that the information is basically useless in Python plug-ins, unless you plan on searching through all the image's paths for the one with a particular ID.

Yes, and that's yet another benefit of Python-fu. But what I'm hinting at is that when you need some piece of information, you can access it using some mnemonic name, and not some c{a|d}+r incantation; and vice-versa, when reading someone else's code, mnemonics are a tad more readable than c{a|d}+r as well.

_________________
Image


Top
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group