Outils pour utilisateurs

Outils du site


issue121:inkscape

Ceci est une ancienne révision du document !


Prior to last month’s celebratory distraction, I was advocating that readers should install Inkscape 0.92 and begin posting files that use its SVG 2 features online, as a way to help show the browser vendors that there is a demand not only for SVG on the web in general, but for a format that lives and grows to encompass more capabilities than those that were baked into the specification over 15 years ago. The release of 0.92 also offers an option to turn off “spacebar panning”, which was my biggest complaint with 0.91. So, I have finally retired my old 0.48 system and move entirely to 0.92. Which gives me a prime opportunity to spend a few months introducing some of the new features of 0.91 and 0.92 that I haven’t covered in any real detail to date. Many of the changes from 0.48 aren’t things that are directly reflected in the user interface: the usual round of performance improvements, bug fixes and compatibility tweaks don’t always make for headline news, but are vital to the stability and capabilities of the program, nevertheless. But I’ll be concentrating more on the new UI features that, as a user, will most affect your day-to-day use of Inkscape. I’ll begin with a completely new tool that can be found on the main toolbar, just after the Zoom tool: the Measure tool (also referred to as the Measurement tool).

You can, of course, activate this tool by clicking on the button – or you can use the keyboard shortcut, which is “M” by default. This tool had limited utility in 0.91, but gained a lot of extra features in 0.92, so I’ll be describing the latter. In either version, at its simplest, the Measure tool does exactly what you would expect: it lets you measure the distances, and angles, between parts of your drawing. In its basic mode, the measurements are ephemeral – you can make only one measurement at a time, and as soon as you switch to a different tool, the measurement disappears. The new features in 0.92 include some slightly clunky workarounds for both of these issues, but it’s still not the same as the sort of dimensioning tool you would find in a fully fledged CAD application, as will become clear. With the tool active, start by clicking and dragging a line on your canvas. You’ll see that there’s a blue line that follows the mouse, and red lines marking out its angle from the horizontal. There doesn’t seem to be a way to measure the angle from the vertical, let alone any other arbitrary datum line. Your line will also be annotated with its overall length, which could appear on it twice, depending on your settings. The midway annotation shows the length of the line segment, whereas the annotation at the end shows the total length of the line. On a blank canvas, these will show the same value, as there’s only a single line segment to consider.

If you now click the mouse somewhere else, the starting point of your line will move to the location you click on. This can be useful for taking several measurements from the same datum point, but it does seem counter-intuitive to me that it’s the start that moves, not the end. If I wanted to take several measurements from the same point, I would naturally expect to click first on the common datum, and then click on each point I wish to measure. Instead, Inkscape requires you to drag from the first point back to the datum, and then click on each subsequent point. You can also drag the handle at either end of your line to move it to a different location, so if you’re happy to drag rather than click you can use that approach to work with the datum as the first point. As you might imagine, holding CTRL whilst dragging the initial measurement will constrain it to particular angles based on the rotation steps setting in the Inkscape preferences. This is particularly useful to limit your measurements to the horizontal or vertical direction. It doesn’t work so well when dragging the endpoints around, though, as it tries to constrain the angle of the measurement, not the direction of your mouse movement, which isn’t always what you need.

The labels themselves can be modified a little using the first few widgets on the tool control bar: Font Size and, at the other end, Units, are pretty self-explanatory. Precision dictates the number of decimal places that are shown. The Scale control adds a multiplication factor to all your lengths; setting this to 50% will halve the values shown, whereas 400% would quadruple them. It’s intended for use where your drawing isn’t a 1:1 representation of the original, although it would be useful to have a mode that lets you set this value by measuring a line and entering its real length. That would make it much easier to trace a bitmap diagram, where the actual scale is not known but one of the original lengths is. Instead you’ll have to place your measurement, then adjust this control iteratively to suit. For most uses, however, just leaving the scale at 100% will be fine.

I mentioned earlier that drawing a measurement on a blank canvas only shows a single length. What happens if we draw on a non-blank canvas instead? Here’s the result of drawing a horizontal line with arbitrary start and end points, over a couple of shapes: Notice how Inkscape, rather cleverly, marks the length of each segment of the measuring line between the points at which it crosses other shapes. It also shows the overall length of the line. But, in this case, my endpoints were arbitrarily chosen, so I’m probably not terribly interested in the fact that the line extends 13.90mm to the left and 28.64mm to the right. Back to the tool control bar once more…

These four buttons determine which points are considered when working out the measurements. The first has a tooltip of “Ignore first and last”, and toggling that on does exactly what it suggests: the first and last points on the measurement line are dropped from the main part of the display, making it clearer to see the overall length of the section I’m concerned with (though the overall length of the measurement line does still appear at the far right): The second button on the toolbar turns off the intermediate measurements, making for a much clearer display when you just need the overall length between a couple of points. The third button has a similar effect for any intersections that are hidden behind other objects. By making my topmost shape opaque you can see the difference when this option is toggled off:

In this particular case, the result is the same as if the second button was toggled off, but that won’t always be true. If you use the measurement tool on a complex drawing, with many overlapping objects, the output can become very hard to read if you don’t use this button, or the next one, to reduce the number of items that are included in the measurement process. As for that next button, it simply determines whether the measurement will be limited to objects in the currently selected layer, or in all layers. NOTE: If you turn this button off, Inkscape will, indeed, only show you measurements based on objects in the current layer, but the measurements don’t update live as you switch between layers: you need to either make a change to one of the tool controls (such as toggling a button on and off again), or adjust the position of one of the endpoints of the measurement. The last few widgets on the tool control bar offer some options for extra things you can do with the measurements:

The first button swaps the endpoints of the measurement line; in doing so it also switches the angle being measured from the inside to the outside angle (or vice versa). No, I don’t know why it has an icon that better represents reflection than reversal. The second button’s icon makes a bit more sense: the camera takes a “snapshot” of the current measurement, allowing it to hang around while you make a second measurement somewhere else. Despite the icon, however, Inkscape doesn’t use the word “snapshot”, preferring to refer to it as a “phantom measurement”. Whatever the terminology, it renders your first measurement in gray – both lines and labels – whilst your second measurement still uses the normal colors. This feature does make it easier to compare measurements, but you can still only have one phantom snapshot, and one live measurement: if you click the button again, the existing phantom vanishes, and the current live version is converted into a snapshot instead. In this example, you can see that my previous measurements have been converted, and I also have a live measurement going on at the bottom:

The next button on the bar will create guides that correspond to the key points of your measuring line. Be warned, this can easily create lots of guides – you’ll get one that follows the direction of the measurement path, and a guide for each labelled path intersection that is drawn perpendicular to the measurement line. In addition, there will be a horizontal and vertical path for the endpoints of your line, though not for the intersection points. It’s important to use the earlier tool control bar buttons to reduce the number of intersections being measured, especially if you’re working with a complex drawing, otherwise you can easily end up with way more guides than you wanted. You can, at least, immediately use Edit > Undo if you do make a mistake with the settings. If you want to remove just a few of the guides, remember that you only have to hover the mouse over a guide until it changes color, then press the Delete key to remove it – a quicker option than deleting via the guide’s dialog.

Should you need to see more than two measurements at once, the next button provides something of a solution. Clicking it will convert the current measurement layout to a group of real objects. You can then enter the group and manipulate them as you would any other shapes – including deleting unnecessary measurements or changing the text of the labels. Because they’re real objects, they’ll still be visible when you draw another measurement. But equally, as real objects, they can be included as crossing points in any measurements themselves, should your new line cross them, which can lead to a confusing collection of lines and labels on the screen. One possible solution to this is to put your converted measurements onto a separate layer and turn off the “Measure all layers” toggle. You might think that this button makes for a viable way to mark up the dimensions on a technical drawing, but there is a (slightly) better method. The penultimate control on the toolbar, “Mark Dimension”, will render a line with arrowheads at either end which runs the whole length of your measurement path, but with a slight offset, the amount of which is set by the last control. The length of the dimension will also be created as a text object alongside the new line; it’s larger than the normal measurement labels, but can still be adjusted by a relative amount using the first control on the toolbar.

At first this might seem like a more limited choice than the previous “Convert to item” button, but, because it doesn’t create a whole load of superfluous elements, it can be used more rapidly without requiring a lot of cleaning up afterwards. The secret is to use snapping when placing the start and end points of your measurement line, so that it stretches exactly over the dimension you wish to measure. The orientation of the text will depend on the direction of the measurement path, so, if it’s upside down, simply undo the operation, click the tool control button to swap the ends of the path, then “Mark Dimension” once again. You can quickly mark out a drawing in this way, but do note that, in the following example, I had to enlarge the arrowheads and draw the vertical projection lines myself (the latter was made easier with the Measurement Tool’s “Convert to guides” option):

Perhaps the biggest limitation of using this method to dimension a technical drawing is that the dimensions are just lines and text objects, with no relationship to the objects they measure. If you change the size of an object, the dimensions won’t update on their own: you’ll need to either modify or re-create them. This, combined with the additional steps needed to produce the dimensions in the first place, is the main reason why, for anything more than the most basic of diagrams, you’re much better off using a real CAD program for technical drawings. Handy, then, that FCM is running a tutorial series on FreeCAD – the program that I turn to myself when I need to draw something more technical than artistic.

issue121/inkscape.1496301124.txt.gz · Dernière modification : 2017/06/01 09:12 de d52fr