Ceci est une ancienne révision du document !
This month, we’ll be continuing to look at the changes in Inkscape’s drawing tools that arrived with version 1.0.
Pencil Tool
Last time, I covered changes to the Bézier and Calligraphy tools, so let’s start this article with the third of the line-drawing tools, the Pencil or Freehand tool. The release notes mention only one change to this tool (albeit one that comes with controls for several parameters), so I’ll begin with that. In Inkscape 1.0, the tool control bar has gained an additional button in the “Mode” section, outlined in red in this screenshot:
Whereas the first three entries in this section act as radio buttons, the new addition acts as a toggle. This seems a little odd to me, because toggling it ‘on’ immediately disables the other three buttons. It’s still only possible to have one option exclusively selected (the hallmark of radio buttons), so I don’t really understand why this wasn’t just included as an extra radio button, rather than implemented as a toggle. What it does mean, though, is that switching to a different mode requires the additional step of turning off this toggle to re-enable the older buttons.
Minor UI gripes aside, what does this button actually do? It enables pressure sensitivity for the tool, which is of no practical use to mouse users, but may be beneficial to tablet users. Time to dig out my ‘cheap-but-does-the-job’ Monoprice branded tablet; it’s no Wacom, but it works out-of-the-box on my Ubuntu Mate system and supports pressure sensitivity.
With the toggle enabled, the tool control bar changes to look like the image below, providing additional controls labelled “Min”, “Max” and “Caps”:
Before describing what those controls do, a brief recap of the way that the Pencil tool works is probably useful. Historically, it was just a tool for freehand drawing that would create simple paths. Starting and ending at the same point would create a closed path, whereas a different ending point would result in an open path. The thickness and style of the resultant path was trivially based on the fill and stroke options, as you might expect.
More recent releases added a “Shape” pop-up menu. With that set to “None”, the behaviour remained as described above, but by selecting a different option in that menu, the behaviour of the Pencil tool changes dramatically. The shape you draw is no longer the stroke of a path, but rather it is a filled path in its own right. In 1.0, the shape is the result of applying a Live Path Effect onto the skeleton path you’ve drawn. The triangle-in and triangle-out shapes are created using the Power Stroke LPE, whereas the ellipse and clipboard-based shapes are produced using the Pattern Along Path LPE. As you can see, this tool relies heavily on LPEs for its more advanced features.
This brings us back to the new pressure-sensitive mode. This is also implemented using the Power Stroke LPE, but whereas triangle-in and -out just have a single control point for setting the thickness of the triangle’s base, in pressure-sensitive mode, Inkscape creates multiple control points along the length of the drawn line – whenever there’s a significant change in pressure. The result is a line that moves from thin to thick and back, based on the pressure you apply, but with the ability to tweak the thickness of each part of the stroke by switching to the Node tool and manipulating the purple control points.
You can see the effect in the image below. The top line was created with the shape control set to “None”: it’s a simple path with nodes at the ends, but no way to adjust the stroke thickness along its length. The second line used “Triangle-out”, and you can see that there’s a single purple handle at the left that is used to adjust the stroke thickness set by the Power Stroke LPE. The third line was the result of some random pressure adjustments using a graphics tablet: this one has even more handles for adjusting the skeleton path, plus additional purple LPE handles at each pressure change. This makes it easy to compensate for poor pressure control by adjusting the line thickness after drawing. Knowing that this mode enables the Power Stroke LPE makes it easier to understand what the various controls on the tool control bar do. Min and Max set the minimum and maximum values for the purple control points. The Caps control sets the shape of the end caps, and mirrors the corresponding control within the LPE itself.
For my tablet, setting a Min of 0 and a Max of 20, with round end caps and a small amount of smoothing (around 10 on this scale), gives a nice “marker-pen” effect that responds quite nicely to the pressure I tend to apply to the stylus. Potentially, this can provide a much more naturalistic feel to cartoons and sketches – though it still requires a more artistic hand than my own to produce something impressive.
Eraser Tool
I make no secret of the fact that the Eraser is one of my least favourite tools in Inkscape. Not because it has any inherent problems or limitations, but because it’s deceptively familiar for users coming from bitmap editors. Too many words have been expended on forum threads in which new Inkscape users bring their bitmap preconceptions to the vector world, and the presence of an eraser that goes some way towards mimicking its raster equivalent makes it even harder to explain why Boolean operations or clipping paths are a usually a better solution to their task.
Nevertheless it does exist, and it does have its uses, so it’s nice to see it gaining some additional features in 1.0. The bulk of the additions are to make it operate in a similar way to the Calligraphy Tool: there’s a toggle for pressure-sensitivity, which causes the “Width” field to become a maximum value, but with the actual value used depending on the pressure applied to the stylus. It also gains controls for Thinning, Caps, and Tremor, mirroring those in the Calligraphy tool.
I won’t spend any more time discussing these: you can read my description of the Calligraphy tool in part 78 if you wish. I still believe a more useful approach would actually be to draw the erasing line you want using the Calligraphy tool (or some other tool, if you prefer), then either perform a Boolean operation or use it as the basis of a clip or mask.
In that vein, however, the second addition to the Eraser is more welcome: a clipping mode. Previously this tool could either erase objects entirely, or cut away parts of the shapes by effectively performing an immediate Boolean operation with the drawn line. The clipping option adds a third button to the Mode section of the tool control bar:
With this enabled, the “erasing” is actually performed by creating a clipping path that is immediately applied to the object. Where more than one object is affected, each one gets its own clipping path, independent of the others, even if the original objects overlapped.
A very nice touch is that only a single clipping path is created for a given object, even if you erase using several separate strokes. This makes it easier to remove large parts of an object with a thick eraser, then reduce the tool’s width for subsequent passes to refine the shape being removed, without ending up with multiple clip paths to manage.
It’s important to note, however, that the results produced by clipping will not always be the same as those created using Boolean erasing, particularly if the target object has a visible stroke applied. Consider the image below, with a deliberately thick stroke to make the point. On the left is the original shape, whilst the middle and right-hand images show the results of the Boolean eraser and the clipping eraser, respectively. Notice that the Boolean eraser results in separate path objects, each with a complete stroke around them. The clipped shape, on the other hand, is still a single object, so the cut faces are not “closed” by the path.
The clipping mode is a great addition to the Eraser tool, creating a non-destructive edit that can later be refined, or reverted entirely, with ease. When creating my comic strips, I often have to apply clipping paths around very precise shapes. Usually I block them out with straight-line paths, then use the Node tool to fine-tune the corners and curves. But this new feature promises to get me 90% of the way to a finished clipping path in a fraction of the time. In fact, this addition alone may have just promoted the Eraser tool from being one of my least used tools, to being a clear favourite.
Measurement Tool
The Measurement tool is another that I rarely use, but which has also seen some small but significant additions in Inkscape v1. This month, I’ll talk about the first of these: an extended “tooltip” that appears when hovering over a path (or an object that can be trivially converted to a path, such as a rectangle, ellipse or star). The tooltip shows the length of the path, as well as the X and Y coordinates, width and height of the object’s bounding box. In theory, this could provide some useful at-a-glance information about a path… if it wasn’t for the fact that the data displayed aren’t always correct. Let me prove this assertion with an example. Here’s a square, drawn so that its top-left corner is at (0, 0), with sides of 10mm. The document properties are set with mm as the display units, and I’m using the geometric bounding box so that the stroke width doesn’t factor into the dimensions.
Switching to the measurement tool and hovering over the square produces this tooltip:
The first problem here is that the values displayed are in pixels, even though I specified mm as my display units. That’s easily explained: the Measurement tool has its own toolbar, with a pop-up menu to select the units it displays. Changing that pop-up to “mm” results in this tooltip instead:
A quick comparison with the previous screenshot shows that although the units are now correct, the actual numbers are still the pixel values! According to this tool, my 10mm square now has sides that are nearly four times as long.
And what of that Y value? I drew the rectangle from top-left to bottom-right, the selector tool shows the Y value as zero, and even the XML editor agrees. Yet, for some reason, the measurement tool wants to take its Y value from the bottom of the shape, not the top.
Now let’s give it a more complex path to work on, by duplicating the square, moving the copy, then using Path > Union to convert the two squares into a single path comprising two sub-paths. Since each sub-path’s perimeter is 151.18px, surely the Length in the tooltip for both paths must simply be double that value, right? Wrong.
The Length displayed for two identical paths combined is over 7.5 times the value shown for a single path! The Height and Width values also have me scratching my head: they might make sense if the squares were arranged along a diagonal, but they’re side-by-side. Here’s what they look like when using the Select tool, together with the tool control bar’s interpretation of these values (in px):
Having the Select tool declaring a width of 83.795px and height of 37.795, while the Measurement tool claims values of 316.71px and 142.85px, leaves me thoroughly confused as to how the values in the tooltip are actually calculated. This situation leaves me uneasy about the measurement tool in general; I wonder what it has to say when used in the traditional click-and-drag mode?
For clarity, I’ve copied and enlarged the top and right values, and put them inside the boxes. The width and height are reported as the expected values of 83.79px and 37.79px.
The tooltip mode has another feature which I’ll mention for completeness: when used on a group of paths, it will show values for the width, height and position of the whole group, but you can hold Ctrl (incorrectly described as Shift in the release notes) to see the data for an individual path. But given that the values in the tooltip clearly can’t be trusted, this capability is somewhat moot.