Ceci est une ancienne révision du document !
This month we'll conclude our tour of the Live Path Effects that are available in both versions 0.48 and 0.91 of Inkscape, starting with perhaps one of the most useful.
Ce mois-ci, nous allons conclure notre visite des LPE (Effets de chemin dynamiques) qui sont disponibles dans les deux versions 0.48 et 0.91 d'Inkscape, en commençant par peut-être l'un des plus utile.
Pattern Along Path This effect is often referred to as “PAP” in forum posts and bug reports so, for brevity, I'll do the same here. Like the Spiro Spline effect, PAP can be applied automatically as part of the normal drawing process. To do so, you simply have to draw a shape for use as your “pattern”, copy it to the clipboard, and select the “Shape: From Clipboard” option when using the Pencil or Bézier tools. See part 17 of this series for more details on the technique, but suffice to say that the result is that your path will have the PAP effect applied to it – albeit with some default options selected. Whether you initially apply the LPE like this, or by explicitly adding it via the dialog, you'll find more controls available to you within the dialog's UI, in order to tweak the effect. “Pattern along path” is something of a misnomer; it should more correctly be called “path along path” as the effect is one of taking a source path (the “pattern”) and stretching or repeating it along the skeleton path. In part 17, for example, I drew a rounded bow-tie shape, copied it to the clipboard, then used it to provide the shape for the Bézier tool, resulting in strokes which appear thinner in the middle. It's a useful technique, but the same visual result could also be achieved by using the Bend LPE. There's a philosophical difference between the two approaches, though: the Bend LPE uses your “pattern” as the skeleton path, then lets you distort it with an on-canvas path; the PAP approach, however, lets you copy the “pattern” to the clipboard, then stretches it to match the shape of the skeleton path. On the surface, therefore, it all boils down to whether you want the skeleton path to be your pattern or your target, but there's more to the PAP effect than that. The difference really becomes apparent only when you start to change the settings.
Motif suivant un chemin
Cet effet est souvent écrit « PAP » (Pattern Along Path) dasn les messages des forums et dans les rapports d'erreurs, aussi, pour faire court, je ferai de même ici. Comme l'effet Spline Spiro, PAP peut être appliqué automatiquement par intégration au processus normal de dessin. Pour cela, vous devez simplement dessiner une forme à utiliser comme « motif », la copier dans le presse-papier et sélectionner l'option « Forme : À partir du presse-papier » quand vous utilisez le crayon ou l'outil de Bézier. Voyez la partie 17 de cette série pour plus de détails techniques, mais il suffit de dire que le résultat est que votre chemin aura l'effet PAP qui lui sera appliqué - nonobstant la sélection de quelques options par défaut. Que vous ayez initialement appliqué l'effet de cette façon, ou en l'ajoutant explicitement par le dialogue, vous trouverez beaucoup plus de contrôles disponibles dans l'interface utilisateur de la boîte de dialogue, de façon à affiner l'effet.
« Motif suivant un chemin » est un peu mal-nommé ; il devrait plutôt s'appeler « chemin le long d'un chemin » car l'effet provient de ce que un chemin source (le « motif») est choisi pour être étiré ou répété le long d'un chemin squelette. Dans la,partie 17, par exemple, j'avais dessiné une forme de nœud papillon arrondi, l'avais copié dans le presse-papier puis utilisé pour apporter la forme pour l'outil de Bézier, obtenant des traits qui paraissent amincis au milieu.
C'est une technique utile, mais le même résultat visuel peut aussi être obtenu en utilisant le LPE Courber. Cependant, il y a une différence de philosophie entre les deux approches : le LPE Courber utilise votre « motif » comme chemin squelette, puis le distord avec un chemin sur le canevas ; alors que l'approche PAP vous laisse copier le « motif » dans le presse-papier, puis l'étire pour correspondre à la forme du chemin squelette. Ainsi donc, en simplifiant, il s'agit de savoir si votre chemin squelette sera votre motif ou votre cible, mais l'effet PAP fait plus que ça. La différence ne devient réellement apparente que quand vous commencez à changer les réglages.
Perhaps the most important setting is the “Pattern Copies” pop-up. This defaults to “Single, stretched”, but there are three other options available, giving the following possibilities: • Single, stretched – puts a single copy of your pattern onto the skeleton path, stretching it to the length of the latter (or shrinking it, if the skeleton path is shorter than the length of your pattern). • Single – puts a single copy of the pattern onto the skeleton path. It's distorted to match the shape of the skeleton, but isn't stretched or compressed in length. • Repeated, stretched – puts multiple copies of the pattern onto the skeleton path, stretching each of them in order to fill the length of the latter. • Repeated – puts multiple copies of the pattern onto the skeleton path, but does not stretch them, usually resulting in a path that falls short of the skeleton's length. You can see these four possibilities shown in order in this example – the green bow-tie at the top is the pattern that's being used, whilst the red line is the skeleton path. The Pattern Source buttons are the usual quartet used to define the path that's used as the pattern – by editing an on-canvas path, using one from the clipboard, or linking to an existing path. In this case, it's usually easiest to draw your pattern separately, then copy it to the clipboard and use the third button to apply it to your skeleton path. The first button can then be used to display a copy of the pattern on the canvas, for fine-tuning the shape.
Le réglage peut-être le plus important est la liste déroulante « Copie de motif ». Par défaut, elle est sur « Unique, étiré », mais il y a trois autres options disponible, offrant les possibilités suivantes : • Unique, étirée - met une seule copie de votre motif sur tout le chemin squelette, étirée sur toute la longueur de celui-ci (ou comprimée si le chemin est plus court que la longueur de vote motif). • Unique - place une copie unique du motif sur le chemin squelette. Elle est déformée pour correspondre à la forme du squelette, mais sa longueur n'est ni étirée, ni comprimée. • Répétée, étirée - place de multiples copies du motif sur le chemin squelette, étirant chacune de façon à remplir toute la longueur de celui-ci. • Répétée - met de multiples copies du motif sur le chemin squelette, mais ne les étire pas, entraînant habituellement qu'il manque un motif pour finir la longueur du chemin squelette.
Vous pouvez voir ces quatre possibilités présentées dans l'ordre dans cet exemple - le nœud papillon vert en haut est le motif utilisé, alors que la ligne rouge est le chemin squelette.
Les boutons de Source du motif sont le quartet habituel définissant le chemin utilisé comme motif - en modifiant un chemin sur le canevas, en en utilisant un dans le presse-papier, ou en faisant un lien avec un motif existant. Dans ce cas, c'est souvent plus facile de dessiner votre motif séparément, puis de la copier dans le presse-papier et d'utiliser le troisième bouton pour l'appliquer au chemin squelette. Le premier bouton peut alors être utilisé pour afficher une copie de votre motif sur le canevas, pour affiner la forme.
The “thickness” of your pattern, perpendicular to the skeleton path, can be set with the Width parameter, with a checkbox to determine whether to use a fixed pixel width, or a multiple of the pattern's length. When using either of the “repeated” options, the gaps between shapes can be set using the Spacing field. Negative values are allowed, but only up to -90% of the pattern width. The Normal Offset can be used to push the pattern to one side or the other of your skeleton path, whilst Tangential Offset pushes it along the length of the path. The latter can be used to adjust the space at the end of the non-stretched options, but also works on the stretched modes to add some space at the start of the path, before the pattern begins. Once again, there's a checkbox to determine whether Spacing or Offsets are in fixed pixel values or proportional to the pattern length. The penultimate control indicates to Inkscape that the pattern has a vertical orientation rather than a horizontal one. This is particularly useful to apply a vertical pattern to a vertical skeleton path: Because it effectively rotates the pattern through 90° before applying it to the skeleton, it can also be used to produce a different effect, when used with a horizontal pattern and path.
L'« épaisseur » de votre motif, perpendiculaire au chemin squelette, peut être définie dans le paramètre Largeur, avec une case à cocher pour définir si une largeur fixe en pixels, ou un multiple de la longueur de motif, est utilisée. Si vous utilisez l'une des options « répété », les espaces entre les formes peuvent être définis grâce au champ Espacement. Les valeurs négatives sont autorisées, mais seulement jusqu'à 90% de la largeur du motif. Le Décalage normal peut être utilisé pour pousser le motif sur un côté ou l'autre du chemin squelette, alors que le Décalage tangentiel le pousse sur la longueur du chemin. Ce dernier peut être utilisé pour ajuster la zone vide du bout, dans les options sans étirement. À nouveau, il y a une case à cocher pour déterminer si Espacement et Décalage sont en valeurs fixes de pixels ou proportionnels à la longueur du motif.
L'avant-dernier contrôle indique à Inkscape que le motif a une orientation verticale plutôt qu'horizontale. C'est particulièrement utile pour appliquer un motif vertical à un chemin squelette vertical :
Parce qu'il tourne effectivement le motif de 90° avant de l'appliquer au squelette, il peut aussi être utilisé pour produire un effet différent, si motif et squelette sont horizontaux.
Of course, the same effect could be produced by simply rotating the pattern before it's used in the LPE. The final control is used when your pattern is not a closed shape, but has unconnected ends. By setting this to a positive number, any line ends that are separated by less than the specified amount will be fused together to produce a continuous line. In this example, I've lopped off the ends of my bow-tie and slightly shortened the top section to exaggerate the effect. The two PAP examples show the effect of using this pattern with Fuse Nearby Ends set to 0, then set to a suitable positive value. Ruler This LPE doesn't really require much explanation – it simply draws tick marks perpendicular to your skeleton path to give the appearance of the graduations on a ruler. You can define the distance between tick marks, the frequency of major marks, and the length of both the major and minor ticks. You can also determine which side of the skeleton the ticks will be drawn on, or have them centered to appear evenly on both sides. One use for this effect is, as the name suggests, to create a ruler. For this example I've used a combined pair of parallel lines for the skeleton path, and overlaid them onto a rounded rectangle and circle.
Bien sûr, le même effet pourrait être obtenu par une simple rotation du motif avant de l'utiliser dans le LPE.
Le dernier contrôle est utilisé si votre motif est une forme ouverte, avec les bouts non reliés. En réglant avec un nombre positif, toutes les extrémités de ligne qui sont séparées de moins que la valeur spécifiée seront fusionnées pour donner une ligne continue. Dans cet exemple, j'ai coupé les bouts de mon nœud papillon et raccourcit légèrement la partie haute pour exagérer l'effet. Les deux exemples de PAP montre l'effet d'utiliser ce motif avec Fusionner les extrémités proches, d'abord à 0, puis réglé avec une valeur positive adaptée.
Règle
Ce LPE ne nécessite pas beaucoup d'explications - il trace seulement des tirets perpendiculaires à votre chemin squelette pour donner l'apparence des graduations d'une règle. Vous pouvez définir la distance entre deux traits, la fréquence des traits principaux, et la longueur des grands et petits traits. Vous pouvez aussi déterminer de quel côté du squelette seront tirés les traits, ou les centrer pour qu'ils apparaissent uniformément des deux côtés.
Une utilisation de cet effet est, comme son nom le suggère, de créer une règle. Pour cet exemple, j'ai utilisé une paire combinée de lignes parallèles pour le chemin squelette, et superposés à un rectangle aux angles arrondis et un cercle.
It's also possible to use this LPE for more artistic effects, though. When combined with other shapes it's easy for your ruler to become a zipper, a simple pathway, or even a protractor. By copying the object and applying different settings and colors to the LPE, you can easily get the effect of coloured rays emanating from your shape. One frustrating omission from this LPE is the ability to suppress the original skeleton path in the output. This makes it more difficult to chain this effect with others. A workaround is to use Path > Object to Path to “fix” the LPE before manually removing the skeleton path, then applying other effects – but you do then lose the ability to do live edits to the parameters. For example, chaining the Ruler, then PAP effects on a circle, gives a result like the one on the left here, whereas the example on the right shows the “fixed” version with the skeleton removed before the PAP effect is added.
Cependant, c'est aussi possible d'utiliser ce LPE pour des effets plus artistiques. Combiné avec d'autres formes, c'est facile de transformer votre règle en fermeture éclair, en simple cheminement ou encore en rapporteur. En copiant l'objet et en appliquant différents réglages et couleurs au LPE, vous pouvez facilement obtenir l'effet de rayons colorés émanant de votre forme.
Un oubli frustrant dans ce LPE est la possibilité de supprimer le chemin squelette initial pour terminer. Ça le rend plus difficile à chaîner avec d'autres effets. Une solution de secours est d'utiliser Chemin > Objet vers chemin pour fixer le LPE avant d'enlever manuellement le chemin squelette, puis d'appliquer d'autres effets - mais vous perdez toute possibilité de modifier les paramètres en direct. Par exemple, à gauche ici, le résultat est obtenu en chaînant la Règle, puis l'effet PAP sur un cercle, alors que l'exemple de droite montre une version « fixée », avec suppression du squelette avant d'appliquer l'effet PAP.
Sketch This LPE does one simple thing, but, like the Hatches effect, the number of controls greatly exceeds any practical requirements for such a deliberately un-tamed result. In short, this effect simply replaces each part of your path with a number of smaller paths, overlapping and with their ends offset from the skeleton by a semi-random amount. It gives the effect of having sketched your path with repeated strokes of a pencil – and can even include construction lines for extra effect. At the top of the UI are the controls for setting the number of paths that will be used for approximating each section of the original, and for determining how long each can be and how much they can overlap. Usually it's sufficient to adjust only the top couple of controls to set the “density” of the sketch strokes – fewer, longer strokes for a light sketch effect, more short strokes for the appearance of a more heavily scribbled line. The Average Offset and Max Tremble controls are useful for determining the “thickness” of the sketched result. There's also a control for the number of construction lines – set it to zero if you don't want any. In this same area of the UI, the Max Length parameter is useful to sufficiently extend your construction lines from the original shape. As with the Hatches LPE, the dice buttons can be used to set a new random seed used for some of the parameters, which is only really of use for making otherwise identical copies look dissimilar. Note that this effect can easily produce lots of new nodes, so be careful when using it as anything other than the last LPE in a chain. Here's a small showcase of the kind of results it can produce.
Croquis
Ce LPE fait une chose simple, mais comme les l'effet Hachures, le nombre de contrôles dépasse largement les besoins pratiques pour un résultat délibérément peu soigné. En bref, cet effet remplace simplement chaque partie du chemin par un certain nombre de chemins plus petits, les uns sur les autres et dont les extrémités sont décalées du chemin squelette d'une certaine valeur semi-aléatoire. Le rendu de l'effet est une impression d'un chemin tracé au crayon avec des traits successifs - et il peut même y avoir des traits de construction pour un effet supplémentaire.
En haut de l'interface utilisateur, les contrôles règlent le nombre de chemins qui seront utilisés pour approximer chaque section du chemin original et pour déterminer leur longueur et le taux de recouvrement. Habituellement, l'ajustement de ces contrôles est suffisant pour régler la « densité » des traits du croquis - moins de traits plus longs pour un effet de croquis léger, des traits plus courts pour une apparence d'une ligne plus fortement griffonnée.
Les contrôles Décalage moyen et Fréquence de tremblement sont utiles pour déterminer l'épaisseur du résultat du croquis. Il y a aussi un contrôle pour le nombre de lignes de construction - mettez-le à 0 si vous n'en voulez pas. Dans la même zone de l'interface, le paramètre Longueur maximale est utile pour étendre suffisamment vos lignes de construction à partir de votre forme originale. Comme pour le LPE Hachures, les boutons en forme de dés peuvent être utilisés pour déterminer une nouvelle semence aléatoire utilisée par certains paramètres, ce qui n'a d'utilisation réelle que pour rendre dissemblables des copies identiques.
Notez que cet effet peut facilement générer beaucoup de nouveaux nœuds ; aussi soyez prudent quand vous l'utilisez autrement qu'en dernier dans une chaîne de LPE. Voici une petite démonstration du genre de résultats qu'il peut produire.
Stitch Sub-Paths This effect can be thought of as a perpendicular version of the Interpolate Sub-paths LPE that I described last month. Whereas that creates a connection between two sub-paths by introducing interstitial versions that gradually distort from the shape of one path to the other, the Stitch effect joins the two sub-paths directly with a series of new paths that link evenly spaced points on one path to evenly spaced points on the other. In other words, it draws some lines from one sub-path to another. Once again there are too many controls to be useful. You really only need the first parameter – for setting the number of new paths to draw – and the quartet of buttons for manipulating the “Stitch path”. Most of the other controls are there to let you add some randomness to your stitches, should you wish. In its simplest form, this effect just draws straight lines from one sub-path to another. It can work on shapes with more than two sub-paths, but, for anything other than simple shapes, it can be rather unpredictable as to what the result will be. By using the buttons to paste, link to, or modify a stitch path, you can replace the straight-line stitches with something more complex. It can be good for adding a little curvature to the lines, but once again it becomes difficult to control the result as things get more complex. In the example above, you can see, in the left hand column, some simple stitching between two basic shapes. The middle and bottom examples show the effect of altering the shape of the stitch path. The stars show a simple stitching, the application of some randomness via the UI, and the result of bending the stitch path (skeleton path omitted for clarity).
Relier les sous-chemins
Cet effet peut être imaginé comme une version perpendiculaire du LPE Interpoler les sous-chemins que j'ai décrit le mois dernier. Alors que celui-ci crée une connexion entre deux sous-chemins par l'introduction de versions interstitielles qui se distordent graduellement d'un chemin à l'autre, l'effet Relier joint les deux sous-chemins directement par une série de nouveaux chemins qui relient les points équitablement d'un chemin aux points régulièrement espacés de l'autre. En d'autres termes, il dessine des lignes d'un sous-chemin à un autre.
Une fois de plus, il y a beaucoup trop de contrôles utiles. Vraiment, Vous n'avez besoin que du premier paramètre - pour régler le nombre de nouveaux chemins à créer - et le quarteron de boutons pour manipuler le « chemin de liaison ». La plupart des autres contrôles sont là pour que vous puissiez ajouter un peu d'aléa à vos liaisons, si vous le souhaitez.
Dans sa forme la plus simple, cet effet trace seulement des lignes droites d'un sous-chemin à l'autre. Il peut travailler sur des formes comprenant plus de deux sous-chemins, mais, toute autre forme que simple, il peut s'avérer assez imprédictible sur le résultat. En utilisant les boutons de collage, de lien et de modification d'un chemin relié, vous pouvez remplacer les liaisons en ligne droite par quelque chose de plus complexe. Cela peut être bien pour ajouter une simple courbure aux lignes, mais, encore un fois, plus les choses deviennent complexe, plus la maîtrise du résultat devient difficile.
Dans l'exemple ci-dessus, vous pouvez voir, dans la colonne de gauche, quelques liaisons simples entre deux formes de base. Les exemples du milieu et du bas montre l'effet d'une altération de la forme du chemin de liaisons. Les étoiles présentent une liaison simple, avec application d'un peu d'aléa via l'interface utilisateur, puis le résultat de courber le chemin de liaison (le chemin squelette a été omis pour plus de clarté).
VonKoch Finally we have the VonKoch LPE. If the name sounds familiar, then perhaps you've come across the Koch Snowflake – a fractal shape created by recursively replacing the middle of each side of an equilateral triangle with a smaller equilateral triangle. It was derived from a paper by Swedish mathematician Helge von Koch, who described the process for one side of the snowflake shape, creating a “Koch curve”. This image shows the first four iterations of the curve: When you apply this LPE, you'll find that a pair of new copies of your path appear on the canvas. Within the UI you'll also find path buttons for a “Reference Segment” and a “Generating Path”. The two new paths you can see correspond to two sub-paths within the Generating Path. If you use the third button to paste a different path in, you'll see the number of copies change to reflect the number of sub-paths in the new Generating Path. Somewhat ironically, you have to paste in a new path to create a Koch curve, as this requires four copies, not two – so immediately the LPE makes it difficult for a layman to create its eponymous fractal! The Reference Path is used to position the copies on their Generating Path segments – essentially the skeleton is scaled and positioned such that the Reference Path lies on top of each Generating Path segment. If that makes it all sound rather confusing, that's because it is! To adequately explain the operation of this LPE would require an article of its own. If you do wish to explore this one further, I recommend reading Tavmjong Bah's description in the official Inkscape manual, which also includes step-by-step instructions for creating a Koch curve: http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Paths-LivePathEffects-VonKoch.html If you do persevere with this LPE, it can produce some impressive results – as well as a lot of frustration. I did manage to create a Koch Snoflake, the Sierpinski triangle (another stalwart of fractal geometry), and a Sierpinski arrowhead curve, but it is a far from intuitive process.
VonKoch
Enfin, nous avons le LPE VonKoch. Si le nom parait familier, c'est peut-être parce que nous avons croisé le flocon de neige de Koch - une forme fractale créée en replaçant récursivement le milieu de chaque côté d'un triangle équilatéral par un triangle équilatéral plus petit. Il est issu d'un article écrit par le mathématicien suédois Helge von Koch, qui décrivait le processus pour un côté de la forme de flocon de neige, créant un « courbe Koch ». Cette image montre les quatre premières itérations de la courbe :
Si vous appliquez ce LPE, vous verrez qu'une paire de copies de votre chemins apparaissent sur le canevas. Dans l'interface utilisateur, vous verrez aussi des boutons de chemin pour les « Segment de référence » et « Chemin générateur ». Les deux nouveaux chemins que vous pouvez voir correspondent à deux sous-chemins du chemin générateur. Si vous utilisez le troisième bouton pour coller un chemin différent, vous verrez que le nombre de copies diffère pour refléter le nombre de sous-chemins dans le nouveau chemin générateur.