issue155: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 | ||
issue155:inkscape [2020/04/09 07:34] – d52fr | issue155:inkscape [2020/04/09 18:43] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 11: | Ligne 11: | ||
Consider the paths below. The one on the left is just a simple U-shaped filled path. Nothing special, no sneaky tricks. Just 10 nodes forming a shape with a couple of arms. The shape on the right is just a duplicate of the first one, with the end of the left arm moved to the right, and the end of the right arm moved to the left, so the arms cross each other. No nodes were added or removed, they were just moved around a little.** | Consider the paths below. The one on the left is just a simple U-shaped filled path. Nothing special, no sneaky tricks. Just 10 nodes forming a shape with a couple of arms. The shape on the right is just a duplicate of the first one, with the end of the left arm moved to the right, and the end of the right arm moved to the left, so the arms cross each other. No nodes were added or removed, they were just moved around a little.** | ||
- | Pour comprendre | + | Pour comprendre |
- | Prenez les chemins ci-dessous. Celui de gauche est un simple chemin rempli en forme de U. Rien de spécial, pas de truc insidieux. Juste 10 nœuds donnant une forme avec deux bras. La forme de droite n'est que la copie de la première, avec la terminaison gauche déplacée sur la droite et la fin du bras droit déplacé à gauche, de sorte que les bras se croisent. | + | Prenez les chemins ci-dessous. Celui de gauche est un simple chemin rempli en forme de U. Rien de spécial, pas de truc insidieux. Juste 10 nœuds donnant une forme avec deux bras. La forme de droite n'est que la copie de la première, avec la terminaison gauche déplacée sur la droite et la fin du bras droit déplacé à gauche, de sorte que les bras se croisent. |
**The second shape is a self-intersecting path. It’s a closed path that is drawn such that it crosses itself, although the word ‘crosses’ carries a misleading implication in this case. Remember that Inkscape is a 2D drawing program, with no notion of the third dimension. So when making this shape I didn’t really move one arm ‘over’ the other, as you would do when making the same shape with a piece of string. Rather I moved it ‘through’ the other, in the same 2D plane. Neither arm is on top of the other. Neither arm ‘crosses’ the other. Instead the resultant shape simply intersects with itself. | **The second shape is a self-intersecting path. It’s a closed path that is drawn such that it crosses itself, although the word ‘crosses’ carries a misleading implication in this case. Remember that Inkscape is a 2D drawing program, with no notion of the third dimension. So when making this shape I didn’t really move one arm ‘over’ the other, as you would do when making the same shape with a piece of string. Rather I moved it ‘through’ the other, in the same 2D plane. Neither arm is on top of the other. Neither arm ‘crosses’ the other. Instead the resultant shape simply intersects with itself. | ||
Ligne 19: | Ligne 19: | ||
Turning on the stroke and reducing the fill opacity makes this a little clearer:** | Turning on the stroke and reducing the fill opacity makes this a little clearer:** | ||
- | La seconde forme est un chemin qui s' | + | La seconde forme est un chemin qui s' |
En activant le contour et en diminuant l' | En activant le contour et en diminuant l' | ||
Ligne 27: | Ligne 27: | ||
It’s also important to note that the arms don’t have to completely pass through each other in order to be a self intersecting shape, and that the shape could self-intersect multiple times, as demonstrated in these variations on the theme:** | It’s also important to note that the arms don’t have to completely pass through each other in order to be a self intersecting shape, and that the shape could self-intersect multiple times, as demonstrated in these variations on the theme:** | ||
- | Notez comme le contour est visible pour les deux bras. Si l' | + | Notez que le contour est visible pour les deux bras. Si l' |
- | Il est aussi important de noter que les bras n' | + | Il est aussi important de noter que les bras ne sont pas obligés de passer complètement l'un à travers l' |
**Now we’re all clear on what a self-intersecting path actually is, let’s look at how they’re affected by the splodgy radio buttons. The first thing to note is that the images so far have all been taken with the second button selected – the one that’s completely filled in. Switch to the first button, and we get this: | **Now we’re all clear on what a self-intersecting path actually is, let’s look at how they’re affected by the splodgy radio buttons. The first thing to note is that the images so far have all been taken with the second button selected – the one that’s completely filled in. Switch to the first button, and we get this: | ||
Ligne 35: | Ligne 35: | ||
The basic U-shaped path remains unaffected. It’s not a self-intersecting path, and it doesn’t contain any sub-paths, so the radio buttons have no effect. All the others, however, have no fill rendered in the intersecting parts. The stroke is still drawn, but the fill isn’t.** | The basic U-shaped path remains unaffected. It’s not a self-intersecting path, and it doesn’t contain any sub-paths, so the radio buttons have no effect. All the others, however, have no fill rendered in the intersecting parts. The stroke is still drawn, but the fill isn’t.** | ||
- | Maintenant que tout est clair sur ce qu'est un chemin qui s' | + | Maintenant que tout est clair sur ce qu'est un chemin qui s' |
La forme de base en U reste inchangée. Ce n'est pas un chemin qui s' | La forme de base en U reste inchangée. Ce n'est pas un chemin qui s' | ||
- | **This behaviour is a little confusing at first. Surely the intersecting parts are inside the shape, so they should still be filled, right? Unfortunately our intuitive idea of in-and-out doesn’t always apply in the world of computer graphics. Instead there are different rules or heuristics for determining whether a point is inside or outside a shape – and the splodgy buttons are used to switch between a couple of those rules. Let’s take a look at paths with sub-paths to try to explain why there’s a need for this choice.** | + | **This behaviour is a little confusing at first. Surely the intersecting parts are inside the shape, so they should still be filled, right? Unfortunately our intuitive idea of in-and-out doesn’t always apply in the world of computer graphics. Instead there are different rules or heuristics for determining whether a point is inside or outside a shape – and the splodgy buttons are used to switch between a couple of those rules. Let’s take a look at paths with sub-paths to try to explain why there’s a need for this choice. |
- | **When you look at the self-intersecting shapes above, it’s pretty obvious that the fully-filled option (second button) is the right choice most of the time. Imagine trying to draw a figure-of-eight, | + | When you look at the self-intersecting shapes above, it’s pretty obvious that the fully-filled option (second button) is the right choice most of the time. Imagine trying to draw a figure-of-eight, |
• Draw a circle for the outside. | • Draw a circle for the outside. | ||
• Draw a smaller circle for the inside. | • Draw a smaller circle for the inside. | ||
• Path > Combine to create a complex path, made up of two sub-paths.** | • Path > Combine to create a complex path, made up of two sub-paths.** | ||
- | Ce comportement est, au début, un peu troublant. Il est sûr que les parties qui se croisent sont dans la forme, aussi elles devraient être remplies, | + | Ce comportement est, au début, un peu troublant. Il est sûr que les parties qui se croisent sont dans la forme, aussi elles devraient être remplies, |
- | Quand nous regardons les formes auto-croisées ci-dessus, il est assez évident que l' | + | Quand nous regardons les formes auto-croisées ci-dessus, il est assez évident que l' |
••Dessinez un cercle pour l' | ••Dessinez un cercle pour l' | ||
••Dessinez un cercle plus petit pour l' | ••Dessinez un cercle plus petit pour l' | ||
Ligne 61: | Ligne 61: | ||
Dans l' | Dans l' | ||
- | Maintenant, nous obtenons | + | Maintenant, nous obtenons |
- | Sur la gauche, le problème est l' | + | Sur la gauche, le problème est l' |
**The answer is obviously ‘yes’, but to get there it helps to understand what the two heuristics are that we’ve been switching between. The first button has a tooltip that reads “any path self-intersections or subpaths create holes in the fill”, and is referred to as the “even-odd” rule. The heuristic for this is pretty simple: | **The answer is obviously ‘yes’, but to get there it helps to understand what the two heuristics are that we’ve been switching between. The first button has a tooltip that reads “any path self-intersections or subpaths create holes in the fill”, and is referred to as the “even-odd” rule. The heuristic for this is pretty simple: | ||
Ligne 74: | Ligne 74: | ||
By performing this for a point in each region of the shape, Inkscape can determine which areas are inside, and therefore need to be filled, and which are outside. But it does result in self-intersections being counted as outside, and left unfilled.** | By performing this for a point in each region of the shape, Inkscape can determine which areas are inside, and therefore need to be filled, and which are outside. But it does result in self-intersections being counted as outside, and left unfilled.** | ||
- | La réponse est évidemment « oui », mais pour y arriver, il est préférable de comprendre ce que sont les deux heuristiques entre lesquelles nous basculons. Le premier bouton a une info-bulle qui dit « Tout auto-croisement ou sous-chemin crée un trou dans le remplissage » et elle se réfère à la règle « pair-impair ». L' | + | La réponse est évidemment « oui », mais pour y arriver, il est préférable de comprendre ce que sont les deux heuristiques entre lesquelles nous basculons. Le premier bouton a une info-bulle qui dit « Tout auto-croisement ou sous-chemin crée un trou dans le remplissage » et elle est nommée |
••Sélectionner un point de la forme. | ••Sélectionner un point de la forme. | ||
- | ••Dessiner une ligne droite imaginaire à partir de ce point de la forme dans une direction quelconque | + | ••Dessiner une ligne droite imaginaire à partir de ce point de la forme dans une direction quelconque. |
••Compter les points de croisement, en commençant à zéro. | ••Compter les points de croisement, en commençant à zéro. | ||
- | ••Ajouter un au compteur chaque fois que la ligne croise une limite de chemin ou de sous-chemin . | + | ••Ajouter un au compteur chaque fois que la ligne croise une limite de chemin ou de sous-chemin. |
••Si le compte final est pair, le point était en dehors de la forme. Si le compte est impair, le point était à l' | ••Si le compte final est pair, le point était en dehors de la forme. Si le compte est impair, le point était à l' | ||
Ligne 90: | Ligne 90: | ||
• If the final count is zero the point is outside the shape, otherwise it is inside.** | • If the final count is zero the point is outside the shape, otherwise it is inside.** | ||
- | L' | + | L' |
••Sélectionner un point dans la forme. | ••Sélectionner un point dans la forme. | ||
- | ••Dessiner une ligne droite imaginaire à partir de ce point de la forme dans une direction queconque | + | ••Dessiner une ligne droite imaginaire à partir de ce point de la forme dans une direction queconque. |
- | ••Faire le compte des enroulements en commençant à zéro | + | ••Faire le compte des enroulements en commençant à zéro. |
••Chaque fois que la ligne croise un chemin ou un sous-chemin, | ••Chaque fois que la ligne croise un chemin ou un sous-chemin, | ||
••Si le résultat final est zéro, le point est en dehors de la forme ; autrement, il est interne. | ••Si le résultat final est zéro, le point est en dehors de la forme ; autrement, il est interne. | ||
Ligne 102: | Ligne 102: | ||
• Use Path > Reverse to reverse the order of the nodes in the sub-path without changing the shape.** | • Use Path > Reverse to reverse the order of the nodes in the sub-path without changing the shape.** | ||
- | À paritr | + | À partir |
••Sélectionnez le chemin composite et passez sur l' | ••Sélectionnez le chemin composite et passez sur l' | ||
••Sélectionnez un nœud du sous-chemin. | ••Sélectionnez un nœud du sous-chemin. | ||
Ligne 111: | Ligne 111: | ||
Unfortunately this simple approach doesn’t appear to work in the beta of Inkscape v1.0, where the Path > Reverse operation reverses the entire path rather than the selected sub-path. The only option in this case is to use Path > Break Apart to split the shape down into its constituent parts, then use Path > Reverse on just one of those paths, then finally use Path > Combine to re-combine them back into your original complex path. This is a definite step backwards in the workflow, so I will be filing a bug about this on the Inkscape issue tracker.** | Unfortunately this simple approach doesn’t appear to work in the beta of Inkscape v1.0, where the Path > Reverse operation reverses the entire path rather than the selected sub-path. The only option in this case is to use Path > Break Apart to split the shape down into its constituent parts, then use Path > Reverse on just one of those paths, then finally use Path > Combine to re-combine them back into your original complex path. This is a definite step backwards in the workflow, so I will be filing a bug about this on the Inkscape issue tracker.** | ||
- | Vous pouvez voir l' | + | Vous pouvez voir l' |
- | Malheureusement, | + | Malheureusement, |
**This path-reversing approach works for simple shapes where the nesting of sub-paths isn’t very deep. For more complex arrangements you may need to reverse more than one path to get the effect you want. And if there are also intersections between sub-paths, or self-intersections within them, you may never be able to get just the fill you want, no matter what you try. In those cases you may find it easiest to use the first splodge (even-odd) to fill the entire shape, then create your complex hole arrangement by clipping with a suitably constructed path. | **This path-reversing approach works for simple shapes where the nesting of sub-paths isn’t very deep. For more complex arrangements you may need to reverse more than one path to get the effect you want. And if there are also intersections between sub-paths, or self-intersections within them, you may never be able to get just the fill you want, no matter what you try. In those cases you may find it easiest to use the first splodge (even-odd) to fill the entire shape, then create your complex hole arrangement by clipping with a suitably constructed path. | ||
Ligne 119: | Ligne 119: | ||
It’s worth noting that you might never experience this problem. Punching a hole through a shape is more commonly done using Path > Difference than Path > Combine, and the former usually results in a sub-path going in the right direction. But it’s worth knowing about these splodgy buttons and how to work with them, just in case you ever find yourself presented with a path that contains inexplicable holes or fills where it shouldn’t.** | It’s worth noting that you might never experience this problem. Punching a hole through a shape is more commonly done using Path > Difference than Path > Combine, and the former usually results in a sub-path going in the right direction. But it’s worth knowing about these splodgy buttons and how to work with them, just in case you ever find yourself presented with a path that contains inexplicable holes or fills where it shouldn’t.** | ||
- | Cette approche d' | + | Cette approche d' |
- | Il est intéressant de noter que vous pourriez ne jamais tomber sur ce problème. Découper un trou dans une forme est un action plus classiquement faite avec Chemin > Différence qu' | + | Il est intéressant de noter que vous pourriez ne jamais tomber sur ce problème. Découper un trou dans une forme est une action plus classiquement faite avec Chemin > Différence qu' |
issue155/inkscape.1586410447.txt.gz · Dernière modification : 2020/04/09 07:34 de d52fr