Outils pour utilisateurs

Outils du site


issue86:inkscape

Ceci est une ancienne révision du document !


Inkscape's Spray tool is the vector graphics equivalent of similar tools from the bitmap world. It's used to create semi-random arrangements of objects but unlike the bitmap version, each object can then be manipulated individually like any other vector element. This makes it particularly good for quickly filling large areas with similar items – think of a snow flurry, or a path covered in autumn leaves – but it can also be invaluable on a smaller scale for textured outlines and shapes. The Spray tool is activated by clicking on the toolbox icon or by pressing either the “A” key or SHIFT-F3. As usual, the tool control bar lets you modify the behaviour of the tool using buttons and sliders, the latter with right-click context menus that expose a sensible range of values and, perhaps more importantly, label the default values so you can quickly get back to something sensible.

L'outil Pulvériser de Inkscape est pour le dessin vectoriel l'équivalent des outils similaires du dessin bitmap. Il est utilisé pour créer des arrangements semi-aléatoires d'objets mais contrairement à la version bitmap, chaque objet peut être manipulé individuellement comme tout autre élément vectoriel. Ceci le rend particulièrement adapté pour remplir rapidement de larges zones avec des objets similaires - pensez à une chute de neige ou à un chemin d'automne couvert de feuilles - mais il peut aussi être très utile à petite échelle pour des formes ou des enveloppes texturées. L'outil Pulvériser est activé en cliquant sur l'icône de la boîte à outils ou en pressant la touche A ou Maj-F3. Comme d'habitude, la barre de contrôle de l'outil vous permet de modifier le comportement de l'outil grâce à des boutons et des réglettes ; c'est l'outil le plus récent, avec un menu contextuel par clic droit qui propose une importante quantité de valeurs et, peut être plus important encore, signale les valeurs par défaut de façon à revenir rapidement à un choix raisonnable.

To use the spray tool you first need an object to spray. I've used a simple leaf design for this example, made up of some paths grouped together. Next, you need to select your object using the select tool before switching to the Spray tool. With the first “Mode” button selected, and all the sliders at their default values, move the cursor into the canvas area, press and hold the left mouse button, and move the mouse around. Copies of your object should be sprayed onto the screen with random scale and rotation, which in my case produces a pile of leaves (with the original leaf on the left). The important thing to note is that each leaf created by the Spray tool is an independent object that can be further manipulated. Don't like the position of one of the leaves? Move or delete it. If the size is wrong, scale it using the Select tool. Rotate it, change the fill and stroke colors, move it up or down in the Z-index, or group it with a few neighbours. All the Spray tool has done is the same job you could have completed by copying the original object then pasting it multiple times, with some simple adjustments to each one.

Pour utiliser l'outil de pulvérisation, nous avons en premier lieu besoin d'un objet à reproduire. J'ai utilisé un simple dessin de feuille pour cet exemple, fait de plusieurs exemplaires regroupés. Ensuite, vous avez besoin de sélectionner votre objet en utilisant l'outil de sélection avant de basculer vers l'outil Pulvériser. Avec le premier bouton Mode sélectionné et toutes les réglettes à leur valeur par défaut, déplacez le curseur à l'intérieur du canevas, pressez et maintenez le bouton gauche de la souris et déplacez la souris sur la surface. Des copies de votre objet devraient être pulvérisées sur l'écran avec une échelle et un angle aléatoires, ce qui, dans mon cas, a produit un tas de feuilles (avec la feuille originale à gauche). La chose la plus importante à noter est que chaque feuille créée par l'outil Pulvériser est un objet indépendant qui pourra ensuite être manipulé. Vous n'aimez pas la position d'une des feuilles ? Déplacez-la ou supprimez-la. Si la taille est incorrecte, mettez-la à la bonne échelle en utilisant l'outil de sélection. Tournez-la, changez les couleurs de remplissage et du trait, mettez-la plus en avant-plan ou en arrière-plan ou groupez-la avec quelques voisines. Tout ce qu'a fait l'outil Pulvériser vous auriez pu le faire vous même en copiant l'objet original puis en le collant plusieurs fois avec quelques ajustements faciles pour chaque copie.

If the Spray tool is just a fancy way of doing a quick copy and paste job, what happens when you have more than one object selected? In this example I've manually made two copies of the leaf design and changed the colors. Then I've selected all three and switched to the Spray tool, using the same parameters as before. You could probably have guessed that I would get all three leaves sprayed onto the canvas, but look at their relative positions and rotations: each of them is sprayed independently of the others. The original trilogy forms a line with all the stalks pointing in the same direction, but the sprayed result doesn't preserve that relationship between the items. In this case that's exactly what I want – my leafy background wouldn't look quite the same if it was made up entirely of regimented triplets – but if you do want that effect you have only to group your original objects first. That way the Spray tool is dealing with only a single (compound) object, rather than three separate ones.

Si l'outil Pulvériser n'est simplement qu'une façon rapide de faire un copier-coller, que se passe-t-il quand vous avez plus d'un objet sélectionné ? Dans cet exemple j'ai fait manuellement 2 copies du dessin de feuille et j'ai changé les couleurs. Ensuite je les ai sélectionné toutes les trois et je suis passé à l'outil Pulvériser, en utilisant les mêmes paramètres que précédemment. Sans doute aviez-vous déjà deviné que les trois feuilles auraient été diffusées sur le canevas, mais regardez leurs positions et rotations relatives : chacune d'elles est diffusée indépendamment des autres. La trilogie originale forme une ligne avec les pédoncules pointant dans la même direction, mais la pulvérisation n'a pas conservé cette relation entre les éléments. Dans ce cas-ci, c'est exactement ce que je veux - mon fond de feuilles ne ressemblerait pas à la même chose s'il était fait de triplets rigides et uniformes - mais si vous voulez vraiment cet effet, vous devez simplement faire un groupe d'abord. De cette manière, l'outil Pulvériser ne traite qu'un seul objet au lieu de trois séparés.

Now that you've got the basics of the tool, let's look at the controls that are available and the effect that each of them has. Starting at the left, the Mode buttons are arguably the most important as they dictate the way in which your final result is actually structured – whether you'll end up with real objects, clones, or a single complex path. One of those words, “Clones”, is a new one in this series, and it's a subject that I'll be covering in a lot more depth in future articles. For now it's sufficient to know that a clone is like a duplicate of an object that retains a live link to the original: any changes made to the original are immediately reflected in the clones. Consider trying to change the colors of the leaves in our pile. With each sprayed leaf as a copy of the original you would need to dissect the pile and re-color each leaf individually. If, however, you select the second Mode button in order to create clones instead, then changing the color requires you to modify only the original. Any changes to the original are propagated, so you can even enter the group and tweak the paths to change the leaf shape, with all your modifications immediately reflected in the sprayed versions.

Maintenant que vous connaissez les bases du maniement de l'outil, regardons les contrôles disponibles et l'effet que chacun produit. A partir de la gauche, les boutons Mode sont sans doute les plus importants car ils déterminent la façon dont votre résultat final va être structuré - si vous allez terminer avec des objets indépendants, avec des clones ou avec une seule trajectoire complexe. Un de ces mots, « Clones », est nouveau dans cette série et c'est un sujet que j'aborderai beaucoup plus en détail dans de futurs articles. Pour l'instant, il est suffisant de savoir qu'un clone comme une copie d'un objet qui garde un lien avec l'original : chaque changement sur l'original est immédiatement reproduit sur les clones. Prenez comme exemple un changement des couleurs des feuilles du tas. Si chaque feuille pulvérisée est une copie de l'orignal, vous devez défaire le tas et modifier la couleur de chaque feuille individuellement. Si, par contre, vous avez sélectionné le second mode pour créer des clones, alors vous ferez le changement de couleur uniquement sur l'original. Tout changement sur l'original se répercutera , si bien que vous pouvez même entrer dans le groupe, ajuster les lignes pour modifier la forme de la feuille, et tout se répercutera sur immédiatement sur les versions pulvérisées.

When to create clones and when to create copies is sometimes hard to judge. As a general rule of thumb, though, it's usually safer to create clones as they can subsequently be converted into real copies by selecting them and then using the Edit > Clone > Unlink Clone menu entry, whereas you can't convert in the opposite direction. In that same menu, the Select Original item will select the original “parent” object for the currently active clone – a trick that can be invaluable when your pile of leaves grows large enough to obscure the originals. The third Mode button works only when the object you're spraying is a single path. Instead of creating separate objects or clones, it adds each sprayed item as part of a single complex path. In this image, the red stars have been created as clones of the original, whereas the green stars have been created using this “Path” mode. As you can see, the areas where sprayed objects overlap differs considerably, and in Path mode the end result is a single path which includes even those stars that appear to be separate.

Quand créer des clones et quand créer des copies, c'est parfois difficile à déterminer. En règle générale, toutefois, c'est plus sûr de créer des clones parce qu'il peuvent être par la suite convertis en copies indépendantes en les sélectionnant et en utilisant le menu Editer > Cloner > Délier le clone, alors que c'est impossible de faire l'opération inverse. Dans le même menu, la ligne Sélectionner l'original permet de de sélectionner le parent du clone actif - un astuce qui est très estimable quand votre tas de feuille est assez gros pour cacher les originaux. Le troisième bouton sert seulement si l'objet que vous avez pulvérisé est un simple trait. Au lieu de créer des objets indépendants ou des clones, il ajoute chaque élément pulvérisé pour obtenir un unique tracé complexe.

Having discussed the Mode buttons, it's time to move on to the remaining controls on the tool control bar. With the exception of one misplaced button, these are all sliders which run up to 100 and down to 1 or 0, depending on the control. The first slider, Width, simply alters the size of the spray area. This value is reflected in the size of the orange circle that surrounds the cursor when it's in the canvas area. You can think of this circle as containing all the possible locations that could be used to place the center of the sprayed shape. Keeping it small lets you constrain the spray close to the cursor, whereas a large value places the objects over a wider area that is just centered on the cursor.

The next slider, Amount, is used to adjust the “speed” of your spray can, or the number of objects that are created over a particular period. The button to the left can be used to set whether or not the Amount value is affected by the pressure of the stylus on a pressure-sensitive graphics tablet. You may recall similar buttons from the Calligraphy tool (see Part 18 of this series) and Tweak tool (Part 23), but in both those cases the button is positioned to the right of the slider it controls, rather than the left. This inconsistency in UI is likely just an oversight, but if you do use a graphics tablet, it's worth checking the tooltips for these buttons to confirm exactly which controls they affect. The Rotation and Scale controls are pretty obvious. Just be aware that the values of the sliders use an arbitrary scale running from 0 to 100, rather than just showing the real numbers they represent: for Rotation, the slider sets the maximum amount that each copy can be rotated from the original, with 100 meaning plus or minus 180°; for Scale, a value of 100 means that the sprayed copies can be up to twice the size of the original. By setting both these to zero your copies will all be identical to one another – and to the original object, too. It's a quick and easy way to turn our simple leaves into a cartoon forest.

The final two sliders affect how the sprayed objects are distributed over the available area. Their effects are most visible when the Width slider is quite large. Think of the Spray tool as placing copies of your object onto a circle: the Focus slider determines the size of the circle, and the Scatter slider determines how close to the circle each copy is placed. Keeping the Scatter value low, it's easy to see the effect of the Focus slider. Setting it to 0 will keep all the copies in a tight circle under the cursor, regardless of the Width value. Putting it all the way to 100 will draw the objects around the periphery of the spray area, creating a ring of copies whose size is determined by the Width parameter. In this example, I've sprayed the same spot, with Scatter=0 but with different Focus values: the blue stars with Focus=0, green with Focus=20 and red with Focus=100.

With the Scatter control set to zero, the copies are placed very near to the circle that the Width and Focus controls define. Increasing the Scatter allows the copies to be placed further away from that ring – although they're still randomly positioned, so some will inevitably fall close to it. Putting it all the way to 100 gives Inkscape free rein to place objects anywhere within the spray area, at which point the Focus value ceases to have any real effect. The Spray tool can be very useful for creating a random distribution of objects or, by constraining some of the values, a decorative path or outline. It's a shame that it's not possible to control more of the parameters using pressure or tilt on a graphics tablet. It's also unfortunate that the tool doesn't care about the direction of movement – it would be great to easily draw a line of footprints or arrows that twist and turn to follow your path as you move the mouse around. Despite those shortcomings, for certain effects the Spray tool is invaluable, and if you want to introduce some randomness into your drawings it's well worth exploring further.

issue86/inkscape.1419018928.txt.gz · Dernière modification : 2014/12/19 20:55 de d52fr