As discussed before, I moved the thinning/thickening functionality into a tool of its own, added two more modes and some controls. For one thing, you don't need Alt anymore :)
Attention lib2geom hackers: please consider this a challenge! Can you switch this to using your new lib instead of livarot? Livarot sucks big time with regard to performance and memory leaking (see Known Problems below), and working with it involves way too much black magic which I don't like. What is needed is simple: convert a path to a polygon with a given tolerance, move the points of the polygon according to some simple algorithm, and convert the result back to path with some simplification. If someone switches this to lib2geom and it works good, I will consider adding more modes. Otherwise, I'm afraid I may have to remove the Roughen mode before the release because it's really not working reliably enough (often locks the path with the "directed eulerian" warning, caused by too small subpaths).
Now for the official announcement:
Tweak tool
The Tweak tool is an exciting new way to edit paths. Unlike the Node tool, you don't need to worry about where the nodes of a path are and how to manipulate them to obtain the shape you want. Instead, you just act on any part of a path using the tool's "brush" in order to bend, twist, or stretch that part, and the path will respond smoothly and naturally regardless of where its nodes lie. While not very useful for technical applications such as schemes or diagrams, this tool will be indispensable for artistic uses of Inkscape - cartoons, drawings, sketches, anime, etc. This new functionality is somewhat similar to the "Pucker", "Bloat", and other similar tools in the latest versions of Adobe Illustrator, except that in Inkscape it works softer and is easier to control.
The area of the tool's action (its "brush") is visualized as an orange-colored circular outline centered at your mouse pointer. However, that area actually has no sharp boundaries; the power of the tool's action falls off gradually, following a smooth bell-shaped profile. This makes the tool act softly and smoothly, and the paths respond as if they are made of soft jelly.
The tool will work on any number of selected objects; for example, you can select all (Ctrl+A) and "smear" your entire drawing by Push. If applied to a shape or text, the tool converts them to paths automatically. You can also apply it to groups of objects. If you're trying to use it without anything selected, it will remind you to select some objects by a statusbar message.
Width
The width of the tool's brush can be changed by the Width control in the tool's controls bar above the canvas (in the range from 1 to 100). You can also change width by Left and Right arrow keys (same as in the Calligraphy tool) at any time (including during action). Also like in Calligraphy tool, the visible width of the brush is independent of zoom; simply zooming in or out is often easier than adjusting the width if you want to cover a smaller or larger area of the drawing.
Force
The next control is Force which adjusts the power of the action (in the range from 1 to 100). You can also change width by Up and Down arrow keys at any time (including during action).
Think of it as the force of pressure you apply to the paths you tweak. If you have a pressure-sensitive tablet and the "Use pressure" button on the right-hand end of the controls bar is on, then the force will also depend on how hard you actually press your pen into your tablet, varying in the range from zero to whatever you set in the Force control. If all you have is a mouse, then the force will be constant but still settable by the Force control. The force of the effect also depends on zoom (or in other words, it stays the same when measured by screen pixels, same as when you move and object by Alt+arrow keys).
Fidelity
Any tweaking of a path slightly distorts the entire path, including even those parts that you didn't touch. These distortions are similar to those that a Simplify command produces. The Fidelity value (also in the range from 1 to 100, default is 50) allows you to control the amount of these distortions. With a higher fidelity, the distortions are less noticeable, but the path may end up having a lot of nodes which blows up the SVG size and slows down Inkscape.
The best value of Fidelity depends on the nature of your artwork. If you're sculpting an amorphous blob, you can do with low fidelity of about 20. If, however, you are pushing or blowing a text string (as a single path) and want the letters outside the distorted area to remain crisp and clean, you will need to raise fidelity to 80 or more.
Modes
There are currently four modes in the Tweak tool: Push, Melt, Blow, and Roughen.
* This default mode of the tool, Push, simply displaces the part of the path under the cursor in the direction of the drag. The path behaves like soft jelly, bending and bulging smoothly and naturally. It's an easy way to produce various irregular, lifelike, handmade-looking shapes starting from something as simple as an ellipse or a calligraphic stroke. For parallel-stroke hatching (engraving) done in the Calligraphy tool, pushing is an easy way to bend, pinch, or curve the entire hatching uniformly.
* The Melt and Blow are two opposite modes that move each point of a path in a direction perpendicular to the path's surface at the point, either inwards (Melt) or outwards (Blow). This is similar to the Inset and Outset commands, except that the Tweak tool can act on a part of a path instead of the whole path.
For example, the visible lightness/darkness of an engraving hatching may not exactly correspond to your artistic intention. Also, the ends of strokes are often far from ideal - they may be too blunt or have unsightly bends or blobs. This is where the Tweak tool may help. Select all the strokes in a hatching pattern and apply a light Melt action where you want the lines to become thinner (and the hatching to become lighter), up until total disappearance. If you press hard, melting works as an eraser, so you can easily clean the strokes' ends in a hatching to making them thin, sharp, and uniform. Conversely, applying Blow makes strokes wider (i.e. the hatching becomes darker).
Of course, melting and blowing are useful not only for calligraphic strokes. Same as with Push, with Melt and Blow you can sculpt any path, spawning smooth treacle-like appendages with Blowing and carving holes with Melting. Unlike the "node sculpting" mode in the Node tool, however, this does not require adding new nodes, selecting any nodes, or even being aware of nodes at all.
* The Roughen mode does exactly this: roughens the edge of the path without changing its overall shape. Slight roughening simply makes the edge crooked and uneven; strong roughening tears and explodes the edge into random blobs and splotches. Note that this operation, especially with high Fidelity, adds a lot of nodes which increases the size of your SVG document and may slow down Inkscape considerably. In particular, pushing/melting/blowing of a roughened path becomes much slower and more difficult, so it's recommended to finalize the overall shape of a path first and roughen it, if necessary, only as the final step.
Keyboard shortcuts
* W, Alt+F2: switch to the Tweak tool
* Shift+P: switch to the Push mode
* Shift+M: switch to the Melt mode
* Shift+B: switch to the Blow mode
* Shift+R: switch to the Roughen mode
* Left, Right: change width
* Up, Down: change force
* mouse drag: act on selected path in the current mode
* Ctrl+mouse drag: temporarily switch to Melt (while Ctrl is down)
* Shift+Ctrl+mouse drag: temporarily switch to Blow (while Shift+Ctrl is down)
Known problems
Known problems with the Tweak tool:
1. it is rather slow; 2. it quickly eats memory; and 3. it is sometimes buggy - thin calligraphic strokes may suddenly disappear or change their shape drastically as you're melting or blowing them.
For (3), it helps to increase Fidelity. Also, you can undo the bad change and try again with less pressure on the pen - if you do your thinning in several light touches instead of one heavy press, usually you will be able to get the desired result without the buggy behavior.
Also, sometimes after roughening, further tweaking of a path becomes impossible with this diagnostic:
WARNING **: Shape error in ConvertToShape: directedEulerian(a) == false
All these problems stem from the livarot library that we use for geometric manipulation of paths. Fortunately, livarot is scheduled for replacement by lib2geom, a new library now in development, so hopefully these issues will be addressed then.
On 2007-August-08 , at 17:12 , bulia byak wrote:
[...] Now for the official announcement:
Tweak tool [...]
Once again, a great enhancement! The "feeling" of it is just great and it behaves beautifully on simple drawings. For those interested I've made a new devel build for Mac OS X which includes the feature (I wanted to test it right after the third line of the tool's description!). Download it from there. as usual: http://inkscape.modevia.com/macosx-snap/?C=M;O=D I tried it a little http://jo.irisson.free.fr/dropbox/inkscape/morphing.png and with this new tool it is a breeze to turn a pointy noised woman into a greek goddess, a regular profiled one in Elizabeth Montgomery from "Bewitched" and even re-invent Pinocchio in vector and in full color (see the drawings above). Well mastered this tool could surely give some much more impressive morphing results.
Some minor quirks: - the cursor (orange circle) seems to leave some traces behind it sometimes. maybe this is related to my version of GTK (2.10.12) - the cursor does not disappear when it is moved outside the drawing area (typically to adjust some settings) - there seems to be some strange interactions when overing the cursor (without clicking) over some objects. I remarked this in the color trace of the picture in the above drawing (same url, just replace .png by .svg): when the cursor is over the face in the color traced bitmap, some polygons of a given color (some shade of orange) disappear.
Thanks again for this great tool.
JiHO --- http://jo.irisson.free.fr/
On 8/8/07, jiho <jo.irisson@...400...> wrote:
Some minor quirks:
- the cursor (orange circle) seems to leave some traces behind it
sometimes. maybe this is related to my version of GTK (2.10.12)
No, this is just our renderer. Hopefully a switch to cairo will fix this.
- the cursor does not disappear when it is moved outside the drawing
area (typically to adjust some settings)
Yes, I'll look into this
- there seems to be some strange interactions when overing the cursor
(without clicking) over some objects.
probably also a renderer problem...
On 2007-August-08 , at 23:42 , bulia byak wrote:
On 8/8/07, jiho <jo.irisson@...400...> wrote:
Some minor quirks:
- the cursor (orange circle) seems to leave some traces behind it
sometimes. maybe this is related to my version of GTK (2.10.12)
No, this is just our renderer. Hopefully a switch to cairo will fix this.
- the cursor does not disappear when it is moved outside the drawing
area (typically to adjust some settings)
Yes, I'll look into this
great!
another small possible quirk: I find it difficult to have the tool push things in diagonals. I noticed this when using a (regular, i.e. not optical) mouse with a medium-complex path (B&W traced bitmap). The difficulty in moving in diagonals comes from the mouse, in my opinion, but is made visible by the tool. Indeed it starts pushing things apparently immediately, in the direction of the first mouse movement (which is often horizontal due to the position of the hand on the mouse when I click and maybe also to the fact that the movements of the ball inside are better detected horizontally and vertically than diagonally). Then I instinctively correct the movement but, due to the computing time I imagine, there is a lag in before the change of direction is visible and, when it is visible (which is not the case in most situations), it is often abrupt because I corrected too much. With a stylus, things are usually quicker and more precise but the fact that inkscape starts pushing things quickly can also be a problem sometimes. Indeed I use a stylus like a regular pen (i.e. it draws only when I touch the tablet -- as opposed to: it is tracked when touching the tablet and draws when the button is pushed). In this case, when touching the tablet, the stylus usually moved a little bit in the direction opposed to the direction is it tilted toward (i.e. it moves left a bit because I am right handed and hence hold my stylus tilted to the right). This can result in some unwanted pushes.
Could there be some black magic introduced, such a delay before starting to push and a computation of the mean displacement vector during this delay. And then maybe a computation of the mean displacement vector using a moving average window to avoid sudden changes in direction. Maybe those things (initial delay and size of moving average window) could be made sensible to machine computing power for them to feel right (but I imagine this must be complicated...). Anyway, I thought I would report my impressions... and the tool is really great no mater what! Thanks again.
JiHO --- http://jo.irisson.free.fr/
On 8/9/07, jiho wrote:
(I wanted to test it right after the third line of the tool's description!). Download it from there. as usual: http://inkscape.modevia.com/macosx-snap/?C=M;O=D I tried it a little http://jo.irisson.free.fr/dropbox/inkscape/morphing.png and with this new tool it is a breeze to turn a pointy noised woman into a greek goddess, a regular profiled one in Elizabeth Montgomery from "Bewitched" and even re-invent Pinocchio in vector and in full color (see the drawings above). Well mastered this tool could surely give some much more impressive morphing results.
Something based on this could be a nice screenshot in 0.46 series. We will need one anyway. Any contributors?
Alexandre
participants (3)
-
Alexandre Prokoudine
-
bulia byak
-
jiho