Boolean Difference on lines/strokes?

Post questions on how to use or achieve an effect in Inkscape.
theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Boolean Difference on lines/strokes?

Postby theozh » Wed May 10, 2017 4:40 am

If I like to remove parts of a large number of lines/strokes you would think that this could be done with a Boolean "Difference" operation. Well, "Difference" seems not to work on lines/strokes.

What you could do is:
a) "Stroke to Path" and do the "Boolean Difference", however I would like to keep the lines as strokes!
b) Do "Cut Path", however, then I have to select all unwanted objects manually and decide whether is was in the cutting area or not.

Any better suggestions?

I don't see a reason why the "Boolean Difference" should not work to cut & remove (at the same time) also strokes.

Example:
Top left: strokes which should be removed within the red shape
Top right: done by method a)
Bottom left: done by "Boolean Difference"
Bottom right: method b) "Cut Path". Good luck with finding the parts which need to be deleted ;-)

CutStrokes.png
CutStrokes.png (21.43 KiB) Viewed 1522 times
Win7/64, Inkscape 0.92.2

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Boolean Difference on lines/strokes?

Postby brynn » Wed May 10, 2017 4:51 am

I don't know how to explain it properly or technically. But most of the path operations work on the area inside the stroked path, and not so much the paths themselves. And if the paths aren't already closed, the path operation will close it. Only Cut Path and Division can work with open paths.

Instead of individual hatch marks, if you could make hatching where it'a all one long path, you might have better luck. I don't know for sure. The path operations are pretty much a mystery to me. I undestand generally what they can do, but why or how, I can't really explain.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Boolean Difference on lines/strokes?

Postby tylerdurden » Wed May 10, 2017 5:50 am

No elegant solution that I see offhand... but deleting the cut bits is not impossible:

Image
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: Boolean Difference on lines/strokes?

Postby theozh » Wed May 10, 2017 7:53 pm

Thanks, @tylerdurden. I guess that is probably the most convenient solution which seems possible.

I still don't understand why Boolean Difference should not work on lines/strokes. Well, unclosed paths like a single straight line will become closed, which gives a "double" line. The boolean difference of a double line with an extended shape located between it's original endpoints should result in a split into two "double" lines.
Win7/64, Inkscape 0.92.2


Return to “Help with using Inkscape”