It is currently Sat Aug 15, 2026 10:54 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 53 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Parallel path
PostPosted: Sun Mar 20, 2011 1:12 pm  (#1) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
A bit harder than expected (for closed strokes, the parallel stroke should be going in the other direction if we want a selection between the two).

- Create ROD with Kozuka
- Path from text
- One call to script to add parallel strokes to all strokes at .5 pixel distance
- Selection from path
- Drag gradient across

Attachment:
ParallelRod.png
ParallelRod.png [ 10.8 KiB | Viewed 4518 times ]


Now back to tackle the open strokes (they have to be transformed in ribbons)

Nice sunny afternoon here... took the time too shoot a couple of photos

_________________
Image


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: Parallel path
PostPosted: Sun Mar 20, 2011 1:39 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Mar 02, 2011
Posts: 1850
Location: Michigan
Ofnuts you know how there is that smell before rain? I do believe it is coming your way :D

_________________
Image
I'm back I think


Top
 Post subject: Re: Parallel path
PostPosted: Sun Mar 20, 2011 1:40 pm  (#3) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6946
Location: Somewhere in GIMP
It's possible to fill the selection with color and have it only 0.5px wide?

Is stroking the text to path with a 1 pixel brush wider, or when your selection is filled, does it end up being 1.0px wide? :paint2

This is the path stroked with a 1.0px paintbrush and using a gradient.
Image

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


Top
 Post subject: Re: Parallel path
PostPosted: Sun Mar 20, 2011 2:31 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Oct 29, 2010
Posts: 711
Location: Netherlands
Oregonian,
Pixels are dots on your display.
They cannot be cut in half.
So the number of pixels must always be whole numbers.
Gerard.

_________________
Gentoo Linux always up-to-date.
Kernel-3.17.4 Python-2.7.8/3.3.5
Gimp-2.8.14

I use Linux only.
And Virtualbox with Win 7


Top
 Post subject: Re: Parallel path
PostPosted: Sun Mar 20, 2011 2:32 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Oct 06, 2010
Posts: 4050
I was wondering about that open stroke for paths, because from my understanding, any consecutive selection in or outside of the original selection (from a path) would remain "underneath" the original, unless it intersected inversely.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Parallel path
PostPosted: Sun Mar 20, 2011 3:02 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Oregonian wrote:
It's possible to fill the selection with color and have it only 0.5px wide?

Is stroking the text to path with a 1 pixel brush wider, or when your selection is filled, does it end up being 1.0px wide? :paint2

This is the path stroked with a 1.0px paintbrush and using a gradient.
Image
Painting is always applied to complete pixels, but I think this actually leads to faint colors (I have not checked but the selection channel must be less than 255)

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Sun Mar 20, 2011 4:16 pm  (#7) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Quote:
- One call to script to add parallel strokes to all strokes at .5 pixel distance

Where might one find this script?

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Parallel path
PostPosted: Sun Mar 20, 2011 4:41 pm  (#8) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16158
Thanks ofnuts :)
I will be donning rain-dance gear for the next few days ... just a heads up. ;)
Meanwhile . .. enjoy the sunshine.

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Sun Mar 20, 2011 5:31 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Oct 06, 2010
Posts: 4050
Saulgoode:

I think he is currently working on it and hasn't submitted it yet.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Parallel path
PostPosted: Sun Mar 20, 2011 5:58 pm  (#10) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
mahvin wrote:
Saulgoode:

I think he is currently working on it and hasn't submitted it yet.
Yes, having a real hard time with the open paths; looks like there is bug in in Gimp.

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Sun Mar 20, 2011 6:15 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: Mar 02, 2011
Posts: 1850
Location: Michigan
So that means Raindance gear correct? Start broadcasting flood warnings now, and get the Ark plans from O, that I do believe she was either planning on ordering or ordered somewhere due to Oregon floods

_________________
Image
I'm back I think


Top
 Post subject: Re: Parallel path
PostPosted: Sun Mar 20, 2011 8:44 pm  (#12) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
ofnuts wrote:
mahvin wrote:
Saulgoode:

I think he is currently working on it and hasn't submitted it yet.
Yes, having a real hard time with the open paths; looks like there is bug in in Gimp.

If you are using 'gimp-vectors-bezier-stroke-lineto', be aware that it adds the line to the beginning of the stroke.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Parallel path
PostPosted: Mon Mar 21, 2011 5:48 am  (#13) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
saulgoode wrote:
ofnuts wrote:
Yes, having a real hard time with the open paths; looks like there is bug in in Gimp.

If you are using 'gimp-vectors-bezier-stroke-lineto', be aware that it adds the line to the beginning of the stroke.
Exactly... this is something I don't understand... why is it working that way? Should I add the points directly?

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Mon Mar 21, 2011 2:22 pm  (#14) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
ofnuts wrote:
saulgoode wrote:
ofnuts wrote:
Yes, having a real hard time with the open paths; looks like there is bug in in Gimp.

If you are using 'gimp-vectors-bezier-stroke-lineto', be aware that it adds the line to the beginning of the stroke.
Exactly... this is something I don't understand... why is it working that way?


The reason it works that way is because the path is stored in a "linked list". This means that for each point in the path, there is a data object which contains not just the point's information (for example, its control handles and anchor coordinates) but also a pointer to the next point in the path. This way, the computer only has to remember the memory location of the most recently added point (for example, in a variable named "listhead"); it can retrieve other points by following the links from one point to the next.

Now when you add a new entry to linked list, you can either add it to the beginning of the list or to its end (well, you could insert it to some arbitrary location in the list, but let's ignore that). To add an entry to beginning of a list, you just have to create a new object (by allocating some memory), set its pointer field to point to the original beginning of the list (the contents of "listhead"), and then update "listhead" to point to the new object.

However, to add a new entry to the end of a list, you must first walk along the entire length of the list, following the link from the first point ("listhead") to the second, from the second to third,... until you reach the end of the list. You then can allocate some memory for a new object, set its pointer field to indicate "end of the list", and change the pointer field of the list's last object (the one you "walked" to) to point to the new object.

There are three main reasons that placing new entries at the beginning of a list is advantageous. First, it operates in fixed amount of time because regardless how long the list, it will always take the same number of steps to execute. Second, it takes less time since there is no need to visit every item in the list in order to reach the last one. And third, adding a new entry doesn't modify the existing list at all (this if often a useful feature, but doesn't really matter for GIMP paths).

One could overcome the first two limitations of appending to the end of a list by maintaining a second variable (for example, "listtail") which always points to the end of the list. But I'm guessing the GIMP developers just didn't feel it was worth implementing this functionality. The net result though, is that the most recently added point is always the "first" point in the path (the first point you added is the last point in the path).

ofnuts wrote:
Should I add the points directly?

I'm not quite sure what you mean, but if you are referring to using 'gimp-vectors-stroke-new-from-points' to create your new path all at once as opposed to iteratively (using "gimp-vectors-bezier-*" functions), the choice is yours. In my Platonic calendar Script-fu, I chose to write a function that reverses the order of a path after it was created, but that was mainly because I had already implemented creating my paths before finding out some of them went in the wrong direction.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Mon Mar 21, 2011 5:08 pm, edited 1 time in total.

Top
 Post subject: Re: Parallel path
PostPosted: Mon Mar 21, 2011 5:08 pm  (#15) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
I got the same explanation from Simon Bundig on gimp-developer. Given my MS in CompSci and 30 years writing code, I understand the impact of adding things at the end of a list if one doesn't keep tabs on where that end of list is. But I would have though that the designers would have taken in consideration the havoc this creates elsewhere (for instance, you can't iterate the stroke pixel by pixel if you modify it in front of your path) and so would have used a slightly more efficient list type and kept everything in order.

Simon also says that I can read/write the points directly so there.

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Mon Mar 21, 2011 5:14 pm  (#16) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
ofnuts wrote:
Given my MS in CompSci and 30 years writing code, ...

Oops. I apologize if my response seemed overly gradeschool; I didn't quite know the experience level to target.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Parallel path
PostPosted: Mon Mar 21, 2011 5:29 pm  (#17) 
Offline
GimpChat Member
User avatar

Joined: Oct 06, 2010
Posts: 4050
Well, all things considered, this is one reason I love wrapmap. It's like making GIMP do something against it's wishes (yes it does suck up resources like a black hole) but it still has those electrons that escape being pulled in and vacuumed into zillions of bits (i.e. it "works" for me).

My only success with paths in this capacity has been with inverse/intersecting paths, so I am naturally curious to see the result of this endeavor.

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Parallel path
PostPosted: Mon Mar 21, 2011 7:26 pm  (#18) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
mahvin wrote:
My only success with paths in this capacity has been with inverse/intersecting paths, so I am naturally curious to see the result of this endeavor.
Endeavour is making progress, now I got the open path almost sorted out, here is a .3pix ribbon from an open path. Still have a little problem with the extremities (have to shave off these splines), and I'm not sure I'm producing the ribbon on the side requested in the dialog, but yesterdays woes are history.

Attachment:
OpenPath-0.3px.xcf [48.3 KiB]
Downloaded 116 times


Question to future users: what would be the right place in the menus for this? Filters? or with other path stuff in Select? Unless there is a way to add it in the Path dialog?

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Mon Mar 21, 2011 7:27 pm  (#19) 
Offline
GimpChat Member
User avatar

Joined: Oct 06, 2010
Posts: 4050
Render - Patterns?

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: Parallel path
PostPosted: Mon Mar 21, 2011 7:49 pm  (#20) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
ofnuts wrote:
Question to future users: what would be the right place in the menus for this? Filters? or with other path stuff in Select? Unless there is a way to add it in the Path dialog?

If you register your command in the <Vectors> menu, it will be available when you right-click on a path (with that path provided as an argument). It is also permissible to register your command in more than one location:

(script-fu-menu-register "script-fu-procname" "<Vectors>/Parallel path...")
(script-fu-menu-register "script-fu-procname" "<Image>/Filters/Misc/Parallel path...")

The trailing ellipses (...) are customary if your menu command is going to open a dialog. They should not be included if your command executes immediately with no user settings.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Mon Mar 21, 2011 9:13 pm, edited 1 time in total.

Top
Post new topic Reply to topic  [ 53 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group