issue119:inkscape
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
issue119:inkscape [2017/04/05 08:32] – d52fr | issue119:inkscape [2017/04/09 17:09] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 7: | Ligne 7: | ||
This will display the Mesh Gradients tool control bar (shown below).** | This will display the Mesh Gradients tool control bar (shown below).** | ||
- | Dans l' | + | Dans l' |
- | La dernière fois, j'ai regardé l' | + | La dernière fois, j'ai regardé l' |
- | Il n'y a pas de doute que les simples dégradés linéaires disponibles dans SVG 1.x sont extrêmement limitants. Plutôt que d' | + | Il n'y a pas de doute que les simples dégradés linéaires |
- | Ceci affichera la barre de contrôle de l' | + | Ceci affichera la barre de contrôle de l' |
**To create a new mesh on your object, you first have to set up a few simple parameters. The first two icons (labelled “New:”) let you select between a Mesh Gradient and a Conical Gradient. In practice there isn’t a genuine conical gradient in SVG – the button just creates the convenient illusion of one using a mesh gradient. For now, ensure that the first button is selected. The next pair of buttons (“on:”) define whether to create the mesh on the fill or the stroke of your object – I’ll use Fill for these examples. Finally you need to decide how many rows and columns should be present in your mesh. Higher values will slow down rendering, but grant you finer control over the gradient. I’ll start with a simple 2×2 mesh, as that’s sufficient to explain the basics. | **To create a new mesh on your object, you first have to set up a few simple parameters. The first two icons (labelled “New:”) let you select between a Mesh Gradient and a Conical Gradient. In practice there isn’t a genuine conical gradient in SVG – the button just creates the convenient illusion of one using a mesh gradient. For now, ensure that the first button is selected. The next pair of buttons (“on:”) define whether to create the mesh on the fill or the stroke of your object – I’ll use Fill for these examples. Finally you need to decide how many rows and columns should be present in your mesh. Higher values will slow down rendering, but grant you finer control over the gradient. I’ll start with a simple 2×2 mesh, as that’s sufficient to explain the basics. | ||
As you move your cursor back over the canvas, the status bar informs you that you can “Drag or double click to create a mesh”. With a single object selected, both approaches give the same result, so I usually just double-click on the object. With more than one object selected, however, a double-click will apply the mesh to only one of them, with the others becoming de-selected. Click-dragging the mouse, on the other hand, applies separate meshes to each object. You don’t even have to drag over the objects themselves, so, if you’ve got a particularly busy drawing, you can simply drag over a blank bit of canvas around the periphery to have the same effect without any risk of accidentally affecting other elements.** | As you move your cursor back over the canvas, the status bar informs you that you can “Drag or double click to create a mesh”. With a single object selected, both approaches give the same result, so I usually just double-click on the object. With more than one object selected, however, a double-click will apply the mesh to only one of them, with the others becoming de-selected. Click-dragging the mouse, on the other hand, applies separate meshes to each object. You don’t even have to drag over the objects themselves, so, if you’ve got a particularly busy drawing, you can simply drag over a blank bit of canvas around the periphery to have the same effect without any risk of accidentally affecting other elements.** | ||
+ | |||
+ | Pour créer un nouveau filet sur votre objet, vous devez d' | ||
+ | |||
+ | Quand vous ramenez votre curseur sur le canevas, la barre d' | ||
**Whichever approach you take, your object will now be filled with a grid of nodes and connecting lines, dividing the area into the number of rows and columns you selected in the tool control bar. Each node is given a color, alternating between the fill color and white, to give a result something like this: | **Whichever approach you take, your object will now be filled with a grid of nodes and connecting lines, dividing the area into the number of rows and columns you selected in the tool control bar. Each node is given a color, alternating between the fill color and white, to give a result something like this: | ||
Ligne 24: | Ligne 28: | ||
As well as giving each node a different color, it’s also possible to move them around by dragging with the mouse, allowing you to set the color at any point on your object, not just the regularly spaced ones that you’re initially provided with. Dragging the edge nodes inside the object leaves empty gaps around the edge; there’s no notion of repeating gradients here. Dragging those nodes outside simply cuts off the fill at the edges.** | As well as giving each node a different color, it’s also possible to move them around by dragging with the mouse, allowing you to set the color at any point on your object, not just the regularly spaced ones that you’re initially provided with. Dragging the edge nodes inside the object leaves empty gaps around the edge; there’s no notion of repeating gradients here. Dragging those nodes outside simply cuts off the fill at the edges.** | ||
+ | |||
+ | Quelle que soit l' | ||
+ | |||
+ | Dans ce cas-ci, il y a neuf nœuds. L' | ||
+ | |||
+ | Tout comme vous pouvez donner une couleur différente à chaque nœud, il est possible de les déplacer en les tirant avec la souris, vous permettant de définir la couleur en tout endroit de votre objet, et pas seulement sur ceux régulièrement espacés qui ont été fournis initialement. En tirant les nœuds des côtés à l' | ||
**Halfway along the tool control bar you’ll find a toggle button for showing and hiding the nodes’ handles. With this active, you can use the handles to control the shape of the paths that join the nodes, and therefore fine-tune the precise shape of the gradients within the mesh. Long-time readers of these articles may remember that early instalments presented a variety of different ways to create a circle in Inkscape. Mesh Gradients add another to the armoury, although you’re more likely to end up with something circle-ish than a mathematically correct shape. | **Halfway along the tool control bar you’ll find a toggle button for showing and hiding the nodes’ handles. With this active, you can use the handles to control the shape of the paths that join the nodes, and therefore fine-tune the precise shape of the gradients within the mesh. Long-time readers of these articles may remember that early instalments presented a variety of different ways to create a circle in Inkscape. Mesh Gradients add another to the armoury, although you’re more likely to end up with something circle-ish than a mathematically correct shape. | ||
While we’re in the vicinity of the Show/Hide Handles button, it’s worth mentioning the buttons to the right of it. First are a pair of buttons to show and hide the editing nodes for fill and stroke gradients respectively. Depending on your preferences, | While we’re in the vicinity of the Show/Hide Handles button, it’s worth mentioning the buttons to the right of it. First are a pair of buttons to show and hide the editing nodes for fill and stroke gradients respectively. Depending on your preferences, | ||
+ | |||
+ | Au milieu de la barre de contrôle de l' | ||
+ | |||
+ | Pendant que nous en sommes au bouton Afficher/ | ||
**Moving on from those buttons there’s one with a warning symbol, intended to make it absolutely clear that the Mesh Gradient tool is still slightly experimental. Click on it and you’ll be presented with a dialog that tells you the SVG syntax could still change, and that “Web browser implementation is not guaranteed”. That’s quite the understatement! | **Moving on from those buttons there’s one with a warning symbol, intended to make it absolutely clear that the Mesh Gradient tool is still slightly experimental. Click on it and you’ll be presented with a dialog that tells you the SVG syntax could still change, and that “Web browser implementation is not guaranteed”. That’s quite the understatement! | ||
Ligne 35: | Ligne 49: | ||
Now use the node handles to curve the outer edges, whilst also moving the inner nodes towards each other until they’re all co-located at the center of your shape. You’ve just turned your mesh into a conical gradient – something hitherto impossible to create with SVG.** | Now use the node handles to curve the outer edges, whilst also moving the inner nodes towards each other until they’re all co-located at the center of your shape. You’ve just turned your mesh into a conical gradient – something hitherto impossible to create with SVG.** | ||
+ | |||
+ | En partant de ces boutons, vous tombez sur un symbole d' | ||
+ | |||
+ | Enfin, sur la barre d' | ||
+ | |||
+ | Maintenant, utilisez les poignées des nœuds pour arrondir les bords extérieurs, | ||
**It’s not a “true” conical gradient, of course. The XML markup is way more complex than would be necessary if SVG had native support. For a start, the center of the cone is defined not by a single node, but by eight of them stacked upon each other. If you want to move the point – or the bottom middle “node” (which is actually two co-located nodes) – you need to rubber-band select in order to ensure that all the nodes are moved at once. Otherwise your cone will quickly deconstruct and reveal the secret sauce behind it. | **It’s not a “true” conical gradient, of course. The XML markup is way more complex than would be necessary if SVG had native support. For a start, the center of the cone is defined not by a single node, but by eight of them stacked upon each other. If you want to move the point – or the bottom middle “node” (which is actually two co-located nodes) – you need to rubber-band select in order to ensure that all the nodes are moved at once. Otherwise your cone will quickly deconstruct and reveal the secret sauce behind it. | ||
Ligne 41: | Ligne 61: | ||
There’s a block of four icons on the tool control bar that I haven’t covered yet – although don’t let that grouping fool you into thinking that they share related functionality. This is really just the “miscellaneous” bin of the toolbar, where odd buttons that don’t have any friends are bundled together.** | There’s a block of four icons on the tool control bar that I haven’t covered yet – although don’t let that grouping fool you into thinking that they share related functionality. This is really just the “miscellaneous” bin of the toolbar, where odd buttons that don’t have any friends are bundled together.** | ||
+ | |||
+ | Ce n'est pas un vrai dégradé conique, bien sûr. Le balisage XML est beaucoup plus complexe que ce qui serait nécessaire si SVG avait un support natif. Premièrement, | ||
+ | |||
+ | La raison pour laquelle je vous montre ça est que ça aide à expliquer ce qui arrive quand vous utilisez le second bouton de la barre d' | ||
+ | |||
+ | Il y a un bloc de quatre icônes sur la barre de contrôle de l' | ||
**The first of these icons lets you switch selected lines between straight and curved modes. Straight lines have no Bézier handles, but behave a little more predictably when you drag them around, so sometimes it’s easier to convert to a straight line, move the nodes, then convert back to Béziers for final tweaking. It’s how I produced the manual version of the conical gradient above. Note that you use the same button to switch back to Béziers – the second icon might look like it’s the right one for the task, but it’s not. | **The first of these icons lets you switch selected lines between straight and curved modes. Straight lines have no Bézier handles, but behave a little more predictably when you drag them around, so sometimes it’s easier to convert to a straight line, move the nodes, then convert back to Béziers for final tweaking. It’s how I produced the manual version of the conical gradient above. Note that you use the same button to switch back to Béziers – the second icon might look like it’s the right one for the task, but it’s not. | ||
Ligne 49: | Ligne 75: | ||
The mesh in this case was 10×10, but even then there aren’t enough nodes in some areas to capture the details – the green stalk at the top is perhaps the most obvious example. This is an unfortunate limitation of mesh gradients: there’s no way to subdivide individual patches in the mesh, to allow for fine detail where it’s needed, while retaining broad swashes of color elsewhere. The workaround is to stack several meshes on top of each other, but this then becomes harder to manage.** | The mesh in this case was 10×10, but even then there aren’t enough nodes in some areas to capture the details – the green stalk at the top is perhaps the most obvious example. This is an unfortunate limitation of mesh gradients: there’s no way to subdivide individual patches in the mesh, to allow for fine detail where it’s needed, while retaining broad swashes of color elsewhere. The workaround is to stack several meshes on top of each other, but this then becomes harder to manage.** | ||
+ | |||
+ | La première de ces icônes vous permet de passer les lignes sélectionnées de droites à courbes. Les lignes droites n'ont pas de poignées de Bézier, mais se comportent de façon un peu plus prévisible quand vous les bougez ; aussi, il est parfois plus facile de passer en lignes droites, de déplacer les nœuds, puis de revenir à des courbes de Bézier pour l' | ||
+ | |||
+ | Au lieu de ça, le second bouton changera la longueur (mais pas l' | ||
+ | |||
+ | Le troisième bouton vous permet d' | ||
+ | |||
+ | Dans ce cas, le filet était de 10x10, mais, même ainsi, il n'y a pas assez de noeuds dans certains coins pour capturer les détails - la queue verte au sommet en est l' | ||
**If you do need more detail it is possible to split a row or column in two, creating more patches to work with. With the Mesh Gradient tool active, double-click on the line connecting two nodes and an extra set of nodes and lines will be inserted. Remember, though, that the operation affects the entire row or column, not just a single patch, so potentially adds many more nodes than you actually need. Currently there is no way to delete a row or column, so it’s usually better to start with a slightly coarser mesh than you need and then split to add more nodes where you need to, rather than be stuck with an unnecessarily fine mesh that you can’t simplify. | **If you do need more detail it is possible to split a row or column in two, creating more patches to work with. With the Mesh Gradient tool active, double-click on the line connecting two nodes and an extra set of nodes and lines will be inserted. Remember, though, that the operation affects the entire row or column, not just a single patch, so potentially adds many more nodes than you actually need. Currently there is no way to delete a row or column, so it’s usually better to start with a slightly coarser mesh than you need and then split to add more nodes where you need to, rather than be stuck with an unnecessarily fine mesh that you can’t simplify. | ||
Ligne 55: | Ligne 89: | ||
With the newly rectangularised (that’s a word, right?) object selected, switch to the Mesh Gradient tool and click on the final button in the miscellaneous bin. Lo and behold, the mesh is stretched to suit the new bounding box of the object.** | With the newly rectangularised (that’s a word, right?) object selected, switch to the Mesh Gradient tool and click on the final button in the miscellaneous bin. Lo and behold, the mesh is stretched to suit the new bounding box of the object.** | ||
+ | |||
+ | Si vous avez besoin de plus de détail, il est possible de diviser une ligne ou une colonne, créant ainsi plus d' | ||
+ | |||
+ | Le dernier bouton solitaire de la barre d' | ||
+ | |||
+ | Sélectionnez le nouvel objet rectangularisé (quel mot, n' | ||
**That’s the new Mesh Gradient tool in a nutshell. Now go ahead and create SVG files filled with meshes, and put them online for Google to index! Of course you’ll face the catch-22 issue that browsers won’t know what to do with the new content in your files, so you might also want to post an exported bitmap image until such time as the browsers (hopefully) catch up. Alternatively you could try using the JavaScript polyfill written by Tavmjong Bah (the author of the mesh gradient code in Inkscape): http:// | **That’s the new Mesh Gradient tool in a nutshell. Now go ahead and create SVG files filled with meshes, and put them online for Google to index! Of course you’ll face the catch-22 issue that browsers won’t know what to do with the new content in your files, so you might also want to post an exported bitmap image until such time as the browsers (hopefully) catch up. Alternatively you could try using the JavaScript polyfill written by Tavmjong Bah (the author of the mesh gradient code in Inkscape): http:// | ||
Ligne 62: | Ligne 102: | ||
Image Credits | Image Credits | ||
https:// | https:// | ||
+ | |||
+ | C'est tout pour le nouvel outil Filet de dégradé, en bref. Maintenant, allez-y et créez des fichiers SVG pleins de filets et mettez-les en ligne pour que Google les indexe ! Bien sûr, vous aurez droit au problème « catch-22 » dû au fait que les navigateurs ne savent pas quoi faire du nouveau contenu de vos fichiers ; aussi, vous pourriez aussi poster une image exportée en bitmap jusqu' | ||
+ | |||
+ | Les filets de dégradé ne sont qu'une fonctionnalité de SVG 2 qui est en danger si les fournisseurs de navigateurs ne sont pas persuadés de la prendre en charge. La seule façon pour SVG d' | ||
+ | |||
+ | Crédits image | ||
+ | https:// |
issue119/inkscape.1491373960.txt.gz · Dernière modification : 2017/04/05 08:32 de d52fr