It is currently Thu Apr 18, 2024 8:30 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Counting Path Anchors
PostPosted: Thu Oct 07, 2010 8:14 am  (#1) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
I have a script that counts the anchors in a path. It was written by fencepost.

Right-clicking the path layer shows Path Details and that is supposed to give me the info I want but clicking it just gives me a path details dialog that doesn't tell me what I want to know. Clicking OK gives me an error message and I expect that the script was written for gimp2.4 and needs to be updated for 2.6 :gaah

Image

Image

Image

I have attached what I believe is the correct script. I keep changing this post.


Attachments:
fp-script-fu-path-suite.scm.zip [13.29 KiB]
Downloaded 198 times

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein
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: Counting Path Anchors
PostPosted: Thu Oct 07, 2010 11:41 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
My script seems to work ok in 2.6.10.
Image

I do however get an error with my Fractalize the Path script. =(

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Counting Path Anchors
PostPosted: Thu Oct 07, 2010 12:13 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
I will try it out and see what I get.

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Post subject: Re: Counting Path Anchors
PostPosted: Thu Oct 07, 2010 1:02 pm  (#4) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Well I gave it another try. Tried it on the same path that failed the first time and this time it worked fine.

Computers! :gaah

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Counting Path Anchors
PostPosted: Thu Oct 07, 2010 1:11 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
yup puters are funny that way.
glad you got it running right. =)

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Counting Path Anchors
PostPosted: Thu Oct 07, 2010 3:42 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
I dont see the Fractalize the Path, but I like the Path animation!

This image is really lame, but it was just to test out the script, which works wonderfully!


Attachments:
Stupid Smile Ani.gif
Stupid Smile Ani.gif [ 66.93 KiB | Viewed 3986 times ]

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.
Top
 Post subject: Re: Counting Path Anchors
PostPosted: Fri Oct 08, 2010 5:06 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
download the script here..
http://registry.gimp.org/node/17717

Image example..
Image

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: Counting Path Anchors
PostPosted: Fri Oct 08, 2010 3:58 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
Fractalize works fine for me on 2.6.10 under windows!

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Counting Path Anchors
PostPosted: Fri Oct 08, 2010 6:47 pm  (#9) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Oregonian wrote:
I have a script that counts the anchors in a path. It was written by fencepost.

Right-clicking the path layer shows Path Details and that is supposed to give me the info I want but clicking it just gives me a path details dialog that doesn't tell me what I want to know. Clicking OK gives me an error message and I expect that the script was written for gimp2.4 and needs to be updated for 2.6 :gaah

The script is not outdated; it just makes some assumptions about paths that are not necessarily true.

For example, in the procedure 'fp-script-fu-vector-details' the following lines appear:
(if (> stroke-id (car (gimp-vectors-get-strokes vectors)))

  (gimp-message "That stroke does not exist in the selected path.")
  (begin



This assumes that all stroke-ids are sequential, starting from "1". Such may not be the case if any anchors or strokes have been deleted from the path.

A better test (if I understand the script correctly) would be:

(if (not (member stroke-id  (vector->list (cadr  (gimp-vectors-get-strokes vectors)))))
  (gimp-message "That stroke does not exist in the selected path.")
  (begin


_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Counting Path Anchors
PostPosted: Fri Oct 08, 2010 7:54 pm  (#10) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
So if I'm reading you correctly, saulgoode, a path that I constructed then went back and added or deleted some of the anchors would likely deliver an error message with the original script?

LATER NOTE: Experimenting shows that is not the case. The path was edited and the script worked ok.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Counting Path Anchors
PostPosted: Fri Oct 08, 2010 9:04 pm  (#11) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Oregonian wrote:
LATER NOTE: Experimenting shows that is not the case. The path was edited and the script worked ok.

It depends upon how you edit it.

The following steps should result in an error when you try to get the details for stroke #1:

  • Create a closed path consisting of at least four anchors.
  • Delete the two sides/legs adjacent to the first anchor.
  • Delete the anchor point (the first one) that has been isolated.

Note: if you save your file as an XCF then reload the file, all of the strokes will be renumbered such that the Art's script will work again (better would be to fix the script per my preceding post).

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Fri Oct 08, 2010 9:16 pm, edited 1 time in total.

Top
 Post subject: Re: Counting Path Anchors
PostPosted: Fri Oct 08, 2010 9:15 pm  (#12) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
saulgoode wrote:

Note: if you save your file as an XCF then reload the file, all of the strokes will be renumbered such that the Art's script will work again (better would be to fix the script per my preceding post).
Ah! That's probably why it worked on the second try then after I had said it delivered an error message. I had saved the file as an xcf file and closed it. I re-opened it to re-test it.

I'll make that change in the script that you put up. Thank you.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) i struggle with the option to copy the path - the path where a file i

3

No new posts Attachment(s) Path copy rotate shift plus + Path copy rotate shift walk Play

79

No new posts Attachment(s) Path

9

No new posts Attachment(s) Path animations

4

No new posts Attachment(s) Move all segments in a path

2



* Login  



Powered by phpBB3 © phpBB Group