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


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 12:40 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 225
I'm wondering how hard it would be to implement a new tool. I assume this exceeds plugin's scope, but I am no expert.

Imagine a tool where you would at first define a point. It could be shown as dot, but it would not be visible in final image. Then you click once in another point. Now, Gimp would begin drawing a line so, that it draws "outward" or "inward" from second point towards or outwards the first point (follow the mouse...). When you have line lenght you want, you click. Now you have line which is concentric with first point but doesn't begin from the first point.

What's the use of this, you might ask. It's very useful in drawing in perspective. For example, click in vanishing point and with two more clicks you have line that "points" to vanishing point but doesn't extend there... Quick and easy.

Now, I know two applications which at least partially implement this (Manga Studio and AZDrawing). The real question is, how would you implement this in Gimp? Plugin? New tool? Something else?

I assume these neat new Cairo vector tools could be used. It could be very elegant solution in drawing phase, rendering would then be normal line drawing or path stroking operation.

Please advise, if this kind of tool is feasible. I can code in C or Python, but Gimp internals are where the real wizardry happens.


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: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 12:44 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Hrmmm... i see 3-D implementation being possible also. YAY!

_________________
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: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 12:50 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12516
G'MIC's Edges offset with a dot in the middle to start things off. :)


Attachments:
likethis.png
likethis.png [ 26.48 KiB | Viewed 5281 times ]

_________________
Lyle

Psalm 109:8

Image
Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 12:57 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Cool Lyle! :)

_________________
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: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 1:48 pm  (#5) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 225
Image

Quick mock-up for line drawing, numbers indicate the order of clicks.

Maybe setting first point should be separate so that several concentric lines could use same "vanishing point"?


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 3:00 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
kimppi wrote:
The real question is, how would you implement this in Gimp? Plugin? New tool? Something else?

My approach would be to introduce a new constraint mechanism to the existing paint tools which would employ a "topology" channel to restrict the motion of the brush. "Topology channels" would be managed using the existing Channels Dialog and edited as regular channels, though their thumbnail previews would ideally appear as a topological map of the contents of that channel.

For example, if we have the following channel:
Attachment:
channel.png
channel.png [ 19.93 KiB | Viewed 5218 times ]

It might be viewed as the following topological map:
Attachment:
topology.png
topology.png [ 15.09 KiB | Viewed 5218 times ]

If our paint tool had the option, we could specify the channel as a constraint and thus all paint strokes would be "coerced" to follow the direction of the topological lines. In other words, if the channel were considered a height map, painting would be constrained such that going either "uphill" or "downhill" with the brush would be more difficult than staying at the same altitude on the map. The amount of "coercion" should be configurable so that the artist is not forced to follow the lines exactly; in fact, this parameter should be associate-able with pen pressure, velocity, or other available input controls.

Once such a mechanism were in place, problems would be reduced to creating suitable constraint topologies. For example, your vanishing point problem would be represented by the following channel:
Attachment:
vp-topology.png
vp-topology.png [ 55.2 KiB | Viewed 5218 times ]

A new tool might be provided for facilitating the creation of various common topologies, though they can also be generated manually (the above channel was created using the "Conical" option of the Blend Tool).

I am not suggesting that implementing such an approach would be trivial*, however, I do think the user interface would be quite elegant, intuitive, and provide digital images with that artistic, human touch.


* I suspect that calculating the directional gradients around a given point might be computationally intensive and it may be necessary to create a "motion vector" array for the image after selecting a particular topology channel. This would require significant amounts of memory and might in itself take a lot of time (though it shouldn't interfere with the painting itself).

NOTE: The University of Waterloo has done some coding of a similar constraint mechanism for brushes, however, their approach relied upon mathematical formulas to specify the direction of the drawing constraint.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 3:29 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 225
Hey! VERY low cost workaround could be devised! saulgoode's word "constraint" is the key.

Guides! If we could have sloping or diagonal (not only horizontal or vertical) guides, they could be used for exact measuring or drawing! Are such beasts possible?


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 3:35 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
kimppi wrote:
Image

Quick mock-up for line drawing, numbers indicate the order of clicks.

Maybe setting first point should be separate so that several concentric lines could use same "vanishing point"?


May I suggest the following method:

  • Position guide for the vanishing points
  • Position guides for a few strategic lines (verticals...)
  • then, to draw several segments at once using the path editor:
    • Draw you segments by clicking on outer point, then close to the vanishing point, then drag that point to the vanishing point (clicking on the vanishing point directly won't work for the 2nd and next segments)
    • On each segment, Ctrl-click on inner point to add a path control point. Shift click on the handles to remove them. Shift-click on the segment between inner and vanishing points to remove it.
    • At that point you may want to add a few more guides, then reenter the Path editor on exiting path to suppress a few more segments.
    • Once done stroke the path.
Attachment:
Perspective.png
Perspective.png [ 13.07 KiB | Viewed 5197 times ]


See also attached XCF for implementation details


Attachments:
Perspective.xcf [31.57 KiB]
Downloaded 142 times

_________________
Image
Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 3:45 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 225
Holy... ofnuts, that combination of Ctrl-Shift-clicking, I did not even know it existed!

Wow! Only plain vanilla cross guides and normal paths needed for all the functionality I need!

It must be Christmas!

Thanks again all you wonderful gurus!


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 4:05 pm  (#10) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
Some more, with two vanishing points:
Attachment:
Perspective2.png
Perspective2.png [ 8.14 KiB | Viewed 5183 times ]


Attachments:
Perspective2.xcf [24.42 KiB]
Downloaded 130 times

_________________
Image
Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 4:06 pm  (#11) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
kimppi wrote:
Holy... ofnuts, that combination of Ctrl-Shift-clicking, I did not even know it existed!

Wow! Only plain vanilla cross guides and normal paths needed for all the functionality I need!

It must be Christmas!

Thanks again all you wonderful gurus!

Glad you like it... agreed, the path editor is a good exercise for your shift and ctrl keys. You have to get the hang of it...

_________________
Image


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 4:40 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
By golly Ofnuts is that another wedge of cheese! :)
Great implementation of the path tool keyboard shortcuts by the way.

You know i have asked for diagonal guides but it was never added to Gimp. :\ <-- sad face.

Perhaps a guide tool that adds diagonal guide lines?

_________________
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: Concentric line tool, is it at all possible?
PostPosted: Thu Jul 07, 2011 6:26 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Apr 30, 2010
Posts: 1937
Location: Missouri
Most CAD applications can do this so I would think it could be added to Gimp or inkscape pretty easily.

_________________
Image
The last time I kept an open mind,
my brain fell out and the dog grabbed it.
Now it's full of dirt, toothmarks, and dog slobber.
No more open minds or dogs for me.


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Fri Jul 08, 2011 1:20 am  (#14) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 225
Rod wrote:
You know i have asked for diagonal guides but it was never added to Gimp. :\ <-- sad face.

Perhaps a guide tool that adds diagonal guide lines?



Gms9810 wrote:
Most CAD applications can do this so I would think it could be added to Gimp or inkscape pretty easily.


In Inkscape you can make guides from paths, so you can have diagonal guides. If that is what you meant.

For my purposes, ofnuts's method is more than sufficient. I'm still astonished how neat solution he found. That method of editing also allows very cool things like curves in perspective which is... well, amazing.


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Fri Jul 08, 2011 7:10 am  (#15) 
Offline
GimpChat Member
User avatar

Joined: Apr 30, 2010
Posts: 1937
Location: Missouri
kimppi wrote:
Rod wrote:
You know i have asked for diagonal guides but it was never added to Gimp. :\ <-- sad face.

Perhaps a guide tool that adds diagonal guide lines?



Gms9810 wrote:
Most CAD applications can do this so I would think it could be added to Gimp or inkscape pretty easily.


In Inkscape you can make guides from paths, so you can have diagonal guides. If that is what you meant.

For my purposes, ofnuts's method is more than sufficient. I'm still astonished how neat solution he found. That method of editing also allows very cool things like curves in perspective which is... well, amazing.
Yes, Inkscape has excellent guide capabilties, you can as you pointed out make them from paths and make them at any angle you want, that's why i think it shouldn't be a big deal to put them into Gimp. It seems that I'm always wanting a guide at an angle other than 90 degrees. I found it interesting that you can make guides at any angle you want with Inkscape which is free but the fairly expensive Xara Xtreme won't do it.

_________________
Image
The last time I kept an open mind,
my brain fell out and the dog grabbed it.
Now it's full of dirt, toothmarks, and dog slobber.
No more open minds or dogs for me.


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Fri Jul 08, 2011 8:59 am  (#16) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
The problem with oblique guides in Gimp is that they lead to non-integer coordinates. It's no a problem with paths, but it gets hairy with the bitmap part of the software (how do you snap a layer to an oblique guide?). Its pixels wouldn't match the pixels below one-for-one.

_________________
Image


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Fri Jul 08, 2011 11:18 am  (#17) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 346
Location: Wisconsin
Gimp has the ability to snap to the active path (View menu), which lets you set up diagonal paths (or curved ones...) and snap to them while drawing. But I find that I want that feature the most when I'm making a new path. :(

_________________
Image


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Fri Jul 08, 2011 12:00 pm  (#18) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 225
bkh1914, I agree!

Also, if someone is planning new guide features, guides outside drawing area would be good idea. Vanishing points tend to creep out of the paper. :)

Now, I need to approximate or do trigonometry (*aagh*) if I need static points out of drawing area...


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Fri Jul 08, 2011 4:03 pm  (#19) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
kimppi wrote:
bkh1914, I agree!

Also, if someone is planning new guide features, guides outside drawing area would be good idea. Vanishing points tend to creep out of the paper. :)

Now, I need to approximate or do trigonometry (*aagh*) if I need static points out of drawing area...
The drawing area is the canvas, that can be bigger than the layer... actually there are some other cases where a large canvas is useful: if you move the selection too close to the border of the canvas, it gets clipped and the clipped part is lost forever.

_________________
Image


Top
 Post subject: Re: Concentric line tool, is it at all possible?
PostPosted: Fri Jul 08, 2011 4:10 pm  (#20) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
I believe that if a script could be made to create any diagonal line guide - the problem with snapping could be fixed by allowing any rectangular corner area to be snapped to the top or bottom of said guide.
Am i wrong?

_________________
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 new topic Reply to topic  [ 20 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) cannot move the crop tool to the line, why?

6

No new posts What is this line?

3

No new posts Line Art Detection

0

No new posts Attachment(s) Gradient from line

3

No new posts Attachment(s) Escape Line Script Ver-0.3

1



* Login  



Powered by phpBB3 © phpBB Group