issue127:inkscape
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue127:inkscape [2017/11/27 09:08] – créée d52fr | issue127:inkscape [2017/12/02 11:20] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | En cours par ailleurs | + | **In researching last month’s article, I found that Inkscape’s default behaviour when adding an LPE to a clone, or when using the Edit > Clone > Clone Original Path (LPE) option, has changed from adding the “Clone original path” effect, to using the “Fill between many” effect instead. On the surface, this brings an obvious regression: it’s no longer possible to move the clone independently of the original object. So why was this change made? In order to explain that, you have to understand what this LPE does in normal day-to-day use. |
+ | |||
+ | Something that is often misunderstood about LPEs (though hopefully not by readers of this column, as I’ve pointed it out previously) is that the output from an LPE is just a single path. It might be a complex path, containing sub-paths, but it’s still a single path from the perspective of styling. It can have only a single stroke color and style, and a single fill. When you use something like the Power Stroke LPE (see part 47), or the new Taper Stroke LPE (see below), it doesn’t somehow imbue Inkscape with the magical ability to create variable width strokes (a feature that the underlying SVG 1.x format doesn’t allow). Rather, it creates a filled shape that happens to follow your original path, and gives the appearance of being a variable width stroke. But in taking this approach, the ability to fill the original shape is lost – any fill you apply now applies to the stroke-like path that is output from the LPE.** | ||
+ | |||
+ | En faisant des recherches pour l' | ||
+ | |||
+ | Une chose, souvent mal comprise à propos des LPE (sauf pour les lecteurs de cette colonne, car j'y ai attiré votre attention précédemment), | ||
+ | |||
+ | **This is a particular problem for things like cartoons and comics, where an artistically varying stroke is a necessity, but you also want to fill areas with color. So the Clone Original Path LPE (also covered in part 47) was born, which at last allowed you to apply one LPE to your stroke, but then also clone the original shape via a sacrificial path with the LPE applied which could be independently filled. But it works with only one path at a time. And cartoon characters are often made of more than one – sometimes with artistically placed gaps in the outlines. Cue the return of “Frankie”, | ||
+ | |||
+ | Trying to fill a shape like this is a problem. It can be done manually by creating a separate object for the fill and adjusting its shape to suit. The Bucket Tool can help with this, but those gaps need careful plugging with temporary objects first. In either case, a tweak to the outline shape wouldn’t be automatically reflected in the fill. For that, we need a clone of some sort, but that interferes with our ability to add LPEs to vary the stroke width. The Clone Original Path LPE can’t help us either, as the shape we want to fill (just the face, for now) is clearly made up of more than one path. And this is precisely where the Fill Between Many effect comes to the fore.** | ||
+ | |||
+ | C'est particulièrement un problème pour des choses comme les bandes dessinées et les comics, où un contour variant artistiquement est une nécessité, | ||
+ | |||
+ | Remplir une telle forme est un problème. Cela peut être fait manuellement en créant un objet séparé pour le remplissage, | ||
+ | |||
+ | **Fill Between Many allows you to collect together several paths into a single LPE. The output is the result of creating a path that joins all of the constituent paths together into a single shape, by implicitly linking the end of each one to the next in the list, and the end of the last path to the start of the first. A trivial example should get the idea across: | ||
+ | |||
+ | On the left are three paths – straight in this case for clarity, though curved works just as well. On the right is the result of creating a sacrificial path, adding the LPE to it, then adding each of the three paths. The result of the LPE was filled with orange, and had its stroke removed. It also automatically updates to match any changes that are made to the shapes of the original paths. Hopefully it’s pretty clear that this new shape is the result of drawing a path that follows each of its component parts, and joins their ends together with straight lines. | ||
+ | |||
+ | Now that you understand the basic idea behind this effect, let’s go through a more detailed example by coloring Frankie. For clarity, I’ll start by changing the color and thickness of each path we’ll be adding to the LPE:** | ||
+ | |||
+ | Remplir dans les nuées vous permet de rassembler plusieurs chemins dans un seul LPE. La sortie est le résultat de la création d'un chemin qui relie tous les chemins constituants en une seule forme, par une liaison implicite de l' | ||
+ | |||
+ | Sur la gauche, nous voyons trois chemins - en ligne droite dans ce cas pour la clarté, bien que des lignes courbes fonctionneraient tout aussi bien. Sur la droite, le résultat de créer un chemin temporaire, de lui ajouter le LPE, puis d' | ||
+ | |||
+ | Maintenant que vous comprenez l' | ||
+ | |||
+ | **You may have noticed the purple scar on his face. Don’t worry, he hasn’t been in a fight. That line is the sacrificial path that the LPE will be added to, and it’ll disappear in just a moment. Selecting that path, and adding the Fill Between Many effect, results in this trivial UI: | ||
+ | |||
+ | Now the hard work begins. We have to copy each of the source paths to the clipboard in order to add a link to it in this dialog using the button at the bottom left. Common sense would suggest that you could select all the paths and add them as a single operation, but, unfortunately, | ||
+ | 1) Create a sacrificial path, if you haven’t already done so, and add the LPE to it. | ||
+ | 2) Select the first path to add and copy it to the clipboard. | ||
+ | 3) Re-select the sacrificial path. | ||
+ | 4) Click the button in the bottom left of the LPE dialog to add the link. | ||
+ | |||
+ | Do all that correctly and you’ll end up with something like this.** | ||
+ | |||
+ | Vous avez peut-être noté la balafre violette sur son visage. Ne vous inquiétez pas, il n'y a pas eu de bagarre. Cette ligne est le chemin temporaire auquel le LPE sera ajouté ; il disparaîtra dans un moment. Une sélection du chemin et l' | ||
+ | |||
+ | Maintenant, le plus dur commence. Nous devons copier chacun des chemins sources dans le presse-papier de façon à lui ajouter un lien dans ce dialogue en utilisant le bouton en bas à gauche. Le bon sens suggérerait que vous pouvez sélectionner tous les chemins et les ajouter d'un seul coup ; mais, malheureusement, | ||
+ | 1) Créez un chemin temporaire, si vous ne l'avez pas déjà fait, et ajoutez-lui le LPE. | ||
+ | 2) Sélectionnez le premier chemin à ajouter et copiez-le dans le presse-papier. | ||
+ | 3) Re-sélectionnez le chemin temporaire. | ||
+ | 4) Cliquez sur le bouton en bas à gauche du dialogue du LPE pour ajouter le lien. | ||
+ | |||
+ | Faites-le correctement et vous arriverez à quelque chose comme ceci. | ||
+ | |||
+ | **There are a few important things to note at this stage. First you can see that the sacrificial path has disappeared, | ||
+ | |||
+ | Il y a quelques points importants à noter à ce stade. D' | ||
+ | |||
+ | **Things were going quite well, with the new path taking on the outline of Frankie’s head, right up until the point where I added the ear. When this LPE connects between the ends of paths it doesn’t join to the closest end, but rather from the end of one path to the start of the next. In this case, the ear path had been created “in reverse”, with the start at the bottom and the end at the top, resulting in the twist in the output that you can see in the image. Fortunately, | ||
+ | |||
+ | Whilst we’re on the subject of editing the output path in this way, it’s worth noting that the dialog also has buttons for removing a selected path from the list (multi-selection is not allowed), and for moving the selected path up or down, thus changing the order in which the paths are joined to generate the output. Continuing to add the remaining paths, and reversing a few along the way, produces this result:** | ||
+ | |||
+ | Nos affaires avançaient plutôt bien, avec le nouveau chemin qui suit le tracé de la tête de Frankie, jusqu' | ||
+ | |||
+ | En parlant des modifications du chemin de sortie, il est bien de noter que le dialogue a aussi des boutons pour enlever de la liste un chemin sélectionné (pas de sélection multiple) et pour déplacer un chemin vers le haut ou le bas, changeant ainsi l' | ||
+ | |||
+ | **As you can see, the result isn’t perfect. The fact that the ends of the nose and mouth extend inside the outline results in a shape with crossed lines, and reversing these paths only makes things worse. Breaking the nose and mouth paths into smaller pieces would have allowed me to produce the desired result but, once filled, this shape only actually leaves a small gap at the end of the mouth that can be visually patched up with another path, which I consider to be an acceptable compromise. So now I can fill the resultant path, lose its outline, send it to the back, and add in a small patch to cover the hole. And revert the original paths back to thinner black lines as well. | ||
+ | |||
+ | It’s worth pausing at this point to really appreciate what we’ve just achieved. Although the end result appears to be similar to that produced by manually drawing an outline, or filling some gaps then using the Bucket Fill tool, there is one substantial difference: this shape is live. A change to Frankie’s nose, or the curve of his ear, is accompanied by an instant change in the fill shape. If we need to make more radical changes, it’s possible to add, remove and reverse paths accordingly. And ultimately that is the reason why this effect is now used by default when adding an LPE to a clone. Unlike the Clone Path effect, the Fill Between Many LPEs is more flexible, but still serves a similar purpose if it is used on a single path. Unfortunately, | ||
+ | |||
+ | Comme vous pouvez le voir, le résultat n'est pas parfait. Du fait que les terminaisons du nez et de la bouche dépassent à l' | ||
+ | |||
+ | Une pause à cette étape s' | ||
+ | |||
+ | **To finish Frankie in style, we can apply yet other LPEs to the original lines: Power Stroke is a classic option for cartoon-style pieces that lets us change the stroke width arbitrarily, | ||
+ | |||
+ | Rather than fiddling around with additional node types on the canvas (the approach taken by the Power Stroke effect), this LPE simply lets you set the stroke width for the non-tapered part of the line, and two offsets representing the distance from each end that the stroke reaches that width. Set an offset to zero and that end gets a normal square cap with no tapering; otherwise larger numbers generally mean longer tapers. | ||
+ | |||
+ | Now there are a couple of caveats here: firstly the taper can only progress as far as the first cusp node; secondly, I have no idea what sort of units are used for the offsets. In practice I tend to just roll my mouse wheel over each field and watch the path on the canvas to set a value that gives the artistic result I’m looking for. These values can also be set by switching to the Node tool, and moving the on-canvas handles, if you prefer to work that way.** | ||
+ | |||
+ | Pour terminer Frankie en beauté, nous pouvons encore appliquer d' | ||
+ | |||
+ | Plutôt que de manipuler des types de nœuds supplémentaires sur le canevas (l' | ||
+ | |||
+ | Maintenant, il y a quelques avertissements : d' | ||
+ | |||
+ | **The Taper Smoothing control effectively sets the shape of both tapers, but can give some odd results at extreme values. I tend to stick to about 0.5, which gives a reasonably linear taper that suits the comic style I’m working with. The Join Type and Mitre Limit controls have the same effect as those in the Fill and Stroke dialog, except that the LPE also offers an “Extrapolated” join type which can be better for some particularly tight angles. | ||
+ | |||
+ | I’ll be honest, some of these new LPEs are still a little buggy at times. I found that to be the case particularly when trying to combine the Fill Between Many and Taper Stroke effects in order to complete my Frankie trace. In the end, I had to resort to some manually drawn paths, or “fixing” some of the LPEs by using Path > Object to Path, in order to get the results I expected. Still, even with those compromises, | ||
+ | |||
+ | Le contrôle Lissage de l' | ||
+ | |||
+ | Pour être honnête, certains de ces nouveaux LPE ont encore des problèmes par moment. J'ai trouvé que ce peut être le cas particulièrement en essayant de combiner les effets Remplir dans les nuées et Contour fuselé pour finaliser le visage de Frankie. Finalement, j'ai dû avoir recours à quelques chemins dessinés manuellement ou en « fixant » certains LPE en utilisant Chemin > Objet en chemin, de façon à obtenir les résultats que j' |
issue127/inkscape.1511770110.txt.gz · Dernière modification : 2017/11/27 09:08 de d52fr