Path -> Difference

Post questions on how to use or achieve an effect in Inkscape.
ekeagle
Posts: 1
Joined: Fri Jan 24, 2014 3:48 am

Path -> Difference

Postby ekeagle » Fri Jan 24, 2014 3:58 am

I need help to understand why difference tool sometimes it works, sometimes not.

Please check the attached file, there are two circles, each one is crossed by a path (line) that passes under each circle from below (each circle on top of each line),
but when you apply path -> difference to each, one works as intended (only the left and right parts of the line remain (out from the circle), but the other deletes everything.
Attachments
problemOrBug.svg
Apply difference and one works but the other deletes both the line and the circle
(2.91 KiB) Downloaded 150 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Path -> Difference

Postby Lazur » Thu Jan 30, 2014 11:39 pm

Hi.

The difference tool is running a boolean operation which is based on the area the paths are enclosing.
Two noded paths with straight line segment(s) don't have any area to them.
More than that, by subtracting from an open path, it will create a closed one.
You can see that in your example too: the bottom one creates two "triangles".
Which is, only due to the fact it is not a straight line segment, but a curved one, and having a very small area enclosed. Straighten it, and the difference tool will delete it.

Booleans have about a 0,02 pixel inaccuracy, and, they merge together nodes closer than that.
Which, in this case, pretty much answers why there is no sign at all of the action.


Return to “Help with using Inkscape”