Skip to content

Draft: Add single direction mode for rough hatches LPE.

karliss1 requested to merge karliss1/inkscape:rough_hatches into master

Hatches (rough) currently creates single (or few in more complicated input shape) zigzag line. When shading with a pen or similar drawing tool, a common patern is to draw a bunch of lines instead of single zigzag.

This MR adds an option where hatching is formed by a bunch of lines going in single direction, instead of single connected zigzag line.

Some examples: image

  1. First of all I would like to discuss whether feature would be useful and the idea of adding more options for the existing LPE. Does it provide enough convenience over other techniques for creating similar effect. From the chat it wasn't quite clear if there is a better place to discuss such proposals and what would it be.

  2. The code itself is currently more of proof of concept. If the idea is accepted it will require a bit more work to properly handle edge cases. Last few or first few points are probably not handled properly resulting in less lines than there should be, I also sometimes saw unexpected curves at the ends. Other thing that could be improved is behavior of some of the existing options which don't quite apply directly to the new hatching style.

  3. Assuming it gets that far. I will need little bit of clarification how the file compatibility when adding new options is handled. From what I understood reading docs all the inkscape specific stuff gets stored in optional fields so any third party software shouldn't be affected by this. The default value should also deal with opening older svg files with newer inkscape. But what about opening the new svg using older inkscape? Are any extra options simply ignored by older version or does it require some additional steps when introducing new options?

Some general observations about use of hatches LPE:

  • Random Bottom, Random top add positive and negative offset. Sometimes that's fine. But in some cases if you don't want to draw over a line without setting random to 0 it can be annoying. There are workarounds like clipping afterwards, or insetting shape before applying hatching but they are somewhat tedious.
  • Noticed that in some places top/bottom left/right is mixed up also a comment mentioning similar thing. Didn't touch that.
  • The handles controlled by "smooth" options are moved in the direction of original shape contour. I guess it sometimes helps keeping everything within original shape. But it can also sometimes have the opposite effect producing worse looking results than if the effect used the hatching direction parameter.
Edited by karliss1

Merge request reports