It is currently Thu Sep 24, 2026 8:34 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Parallel path
PostPosted: Mon Mar 21, 2011 7:51 pm  (#21) 
Offline
GimpChat Member
User avatar

Joined: Mar 02, 2011
Posts: 1850
Location: Michigan
It would be very cool to have this under the right click and then somewhere in Filters list where you could affect more than one Path at once :D

_________________
Image
I'm back I think


Top
 Post subject: Re: Parallel path
PostPosted: Mon Mar 21, 2011 8:05 pm  (#22) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16174
Well what it does is create an inside or outside selection along with the original correct?Then you are able to fill it or stroke it?

If you stroke it will it stroke two lines (one on each side of the selection value you enter)?

<Vectors>/Parallel path - i suppose would be appropriate as you would be working with Paths at the time.

Am i correct in assuming what the script does?


Top
 Post subject: Re: Parallel path
PostPosted: Tue Mar 22, 2011 6:09 am  (#23) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Rod wrote:
Well what it does is create an inside or outside selection along with the original correct?Then you are able to fill it or stroke it?

If you stroke it will it stroke two lines (one on each side of the selection value you enter)?

<Vectors>/Parallel path - i suppose would be appropriate as you would be working with Paths at the time.

Am i correct in assuming what the script does?
A picture is worth a thousands words...

Attachment:
Ribbon explained.png
Ribbon explained.png [ 19.88 KiB | Viewed 1864 times ]

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Tue Mar 22, 2011 2:29 pm  (#24) 
Offline
GimpChat Member
User avatar

Joined: Mar 02, 2011
Posts: 1850
Location: Michigan
Very cool, the picture explains it perfectly, although I am not sure, you mean the gray was original? And assuming from the fact I see the Open path picture there, is the script done?

_________________
Image
I'm back I think


Top
 Post subject: Re: Parallel path
PostPosted: Tue Mar 22, 2011 4:21 pm  (#25) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
ofnuts wrote:
A picture is worth a thousands words...

Attachment:
Ribbon explained.png

I look forward to seeing your code (he said in understated tones). Are you implementing Thomas Hein's "Flattening of Cubic Bézier Offset Curves"?

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Parallel path
PostPosted: Tue Mar 22, 2011 4:49 pm  (#26) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
saulgoode wrote:
ofnuts wrote:
A picture is worth a thousands words...

Attachment:
Ribbon explained.png

I look forward to seeing your code (he said in understated tones). Are you implementing Thomas Hein's "Flattening of Cubic Bézier Offset Curves"?
No, I'm using a brute force approach, iterating the strokes, finding the coordinates of the point at requested distance on the perpendicular, and so generating a huge number of lineto() that Gimp seems to handle very well (my code for this is a derivative of my Slinky plugin, for which I doubt there is a nice mathematical solution).

For the simple case we have here, I thought there could be a more subtle solution and your pointer is good news. However the text of the article on various sites is protected by a 30$+ fee and since I'm not expecting any financial compensation on the script I won't bother.

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Tue Mar 22, 2011 5:08 pm  (#27) 
Offline
GimpChat Member
User avatar

Joined: Oct 06, 2010
Posts: 4050
The paper in question, if anyone is interested, below:


Attachments:
File comment: Thomas Hain Bezier Flattening in PDF format.
BezierFlattening.pdf [471.72 KiB]
Downloaded 130 times

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes
Top
 Post subject: Re: Parallel path
PostPosted: Tue Mar 22, 2011 5:45 pm  (#28) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
mahvin wrote:
The paper in question, if anyone is interested, below:
Cool. Now grabbing the aspirin...

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 1:52 am  (#29) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16174
Looks exactly how i pictured it. :)
I shall now do double duty rain dancing -
Image


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 2:40 am  (#30) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Rod wrote:
Looks exactly how i pictured it. :)
I shall now do double duty rain dancing -
Image
It's basically finished, just needs a bit more testing, and then creation of a SourceForge project. This could happen tonight. On the other hand, on weekdays, available time for pythonic Gimp isn't very weather-dependent (in fact if it rains my motorcycle commuting takes longer). It would be more appropriate to pray Vishnu, Shiva and other gods for painless integration of the code provided by my offshore correspondents, so I can come home early.

(fortunately you have lost your powers, it's very sunny this morning).

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 3:42 am  (#31) 
Offline
GimpChat Member
User avatar

Joined: Oct 06, 2010
Posts: 4050
Some days a guy just can't get a break...

Image

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


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 4:45 am  (#32) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
mahvin wrote:
Some days a guy just can't get a break...

I do have a version of my avatar in case of nasty bugs:
Attachment:
Avatar-parti.png
Avatar-parti.png [ 7.98 KiB | Viewed 2094 times ]

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 10:36 am  (#33) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Attachment:
Ribbon.png
Ribbon.png [ 37.95 KiB | Viewed 2086 times ]


I took the opportunity to set up a new SF project to gather my various scripts, so you're all welcome to http://gimp-path-tools.sf.net/

ribbon-path-0.0.py is somewhere there, with its slinky brother (no updates to that one yet).

Unlike its predecessor, this one creates the menu entry in the right click menu in the Paths dialog (it won't work without a path anyway, and doesn't require any drawable). For the rest I'll let you figure out how it works :)

Have fun.

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 2:43 pm  (#34) 
Offline
GimpChat Member
User avatar

Joined: Mar 02, 2011
Posts: 1850
Location: Michigan
Source forge looks good man :D
Testing it out now

_________________
Image
I'm back I think


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 3:10 pm  (#35) 
Offline
GimpChat Member
User avatar

Joined: Oct 06, 2010
Posts: 4050
Awesomeness! Thank you, ofnuts!
Image

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


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 3:10 pm  (#36) 
Offline
GimpChat Member
User avatar

Joined: Mar 02, 2011
Posts: 1850
Location: Michigan
I couldn't get mine to work... it is in the Same Place as Slinky and saved as a Python file... help

_________________
Image
I'm back I think


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 3:15 pm  (#37) 
Offline
GimpChat Member
User avatar

Joined: Oct 06, 2010
Posts: 4050
Right click in Path dialog on a Path, Willy. Same place you "stroke a path"

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


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 3:20 pm  (#38) 
Offline
GimpChat Member
User avatar

Joined: Mar 02, 2011
Posts: 1850
Location: Michigan
Found your first Problem mate :D
Although I like the effect it gave


Attachments:
Problem.png
Problem.png [ 23.57 KiB | Viewed 2076 times ]

_________________
Image
I'm back I think
Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 3:47 pm  (#39) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Willy wrote:
Found your first Problem mate :D
Although I like the effect it gave
Might not be a problem, but sorta expected behavior. Can you post an XCF with the original path, as well as the parms you used?

_________________
Image


Top
 Post subject: Re: Parallel path
PostPosted: Wed Mar 23, 2011 3:57 pm  (#40) 
Offline
GimpChat Member
User avatar

Joined: Mar 02, 2011
Posts: 1850
Location: Michigan
Had to remake, Parms
5
Right

Enjoy


Attachments:
Test.xcf [393.08 KiB]
Downloaded 97 times

_________________
Image
I'm back I think
Top
Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group