1

I'm looking for a good (i.e., efficient and flexible) Inkscape technique to achieve a selective "cutout" effect for indicating depth of and visualize separation between overlapping paths (like the "Knot" path effect, but between paths).

My usual go-to for this kind of effect is to add a "phantom path" by duplicating the original, making it white, removing any markers, increasing the stroke width, and putting it behind the actual path. This works reasonably well:

Two overlapping paths

However, it comes with a couple of disadvantages:

  • You have two objects now. You can group them, but node editing only affects one at a time (or at least it's not so simple), so changing anything is often annoying.
  • There is no control over when the "cutout" should happen. In the figure, the red circle highlights a place where I actually don't want to cut out a grid line (like with the path on the left of it).

Alternatives I have considered and rejected:

  • Globally solving the z-order of all paths so that lines which should not be cut out are in front of the "phantom paths". This might not even be doable in general, and, if at all, is very much not efficient.
  • Turning the line into a filled object with "Stroke to Path" and adding a white stroke seems like it could work on first sight, but I never got acceptable results (the internal paths are completely unworkable). Also, I don't see how it could allow special treatment of markers, and solve the control problem.

I am asking the question because I have no solution for the selection part. But if I could fundamentally improve just the basic technique, that's also cool.

1 Answer 1

1

Not a "fix it all" -receipe, but maybe useful:

The gridlines that you want to stay uncovered are obviously your own shapes, they are not system gridlines which cannot be hidden behind objects.

You can give to your own gridlines blending mode multiply and bring them to front (I would keep them in a new top layer). Then they cannot hide any black but they are well visible against white.

1
  • I didn't know about filters and blending before. This is a good solution when the foreground path is black. Unfortunately, I have colored paths as well. There would need to be some kind of nonlinear function involved (white + gray => gray, other + gray => other). Commented Feb 9, 2023 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.