Mobile app version of vmapp.org
Login or Join
Berryessa866

: How to create dynamic boolean masked objects in inkscape? Sometimes when tracing bitmaps in inkscape, I'll see a an object which has two or more disconnected curves, which automatically exclude

@Berryessa866

Posted in: #Inkscape

Sometimes when tracing bitmaps in inkscape, I'll see a an object which has two or more disconnected curves, which automatically exclude each other.

For example tracing this image:



Results in this:



I can edit either path and the fill updates in realtime:



How can I set something like this up manually?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Berryessa866

2 Comments

Sorted by latest first Latest Oldest Best

 

@Moriarity648

It helps to understand what SVG thinks of as being 'inside'.

Starting outside at 0, you count how many times you cross the path in getting to the region you are interested in. However you count based on the direction the path is going as you cross it. +1 for left and -1 for right. (or vis versa, I'm not sure which is used, but it works out the same either way).

The resulting number tells you whether you are inside or outside. You can specify whether you want inside to be when the number is odd, or the number is non-zero. This setting is on the Fill tab of the Fill and Stroke dialogue.

For simple cases, you can think of the even/odd rule as meaning subpaths within a path cancel each other out while the non-zero rule meaning that subpaths going in opposite directions cancel. This gets much more complicated as you add more subpaths and as they start intersecting, which is why the counting method is used as it doesn't care about intersections. In terms of boolean operators, even-odd is effectively an exclusive or, while non-zero isn't boolean.

You can select the nodes of a subpath with the node tool and then Path -> Reverse to reverse that subpath.

For a simple demonstration, draw a shape, then draw a figure 8 shape on top,. Select both and Paths -> Combine. If you are in even-odd mode, you will have two holes, if you are in non-zero mode, you will have just one hole. Try switching the fill rule in the Fill and Stroke dialog. In non-zero mode, try selecting the nodes of the figure 8 and then reverse them and you should see the hole flip to the other side.

10% popularity Vote Up Vote Down


 

@Megan533

Let you already have a C-like path. Then you can reconnect points with the following simple procedure:


Select 4 points near the future junction.
Disconnect these points with
Reconnect them in the diffenent order with




Or even simpler procedure:


Create two objects.
Flip the internal one horizontally or vertically
Combine paths (Ctrl K).




Both these procedures give you the dynamic boolean masked object just because it is the nature of combined paths in Inkscape:

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme