Calligra/Paintops/Hatching brush

Early documentation for the Hatching brush.

Last updated: Pentalis 14:40, 27 June 2010 (PDT)

Hatching Options

Graphical schematic of trigonometry-algebra.svg

The image attached is enough to explain the basic 5 parameters:

  • Angle: tilt of the lines in degrees.
  • Separation: distance between a line and the next in pixels.
  • Thickness: thickness of the lines in pixels.
  • Origin X and Origin Y: see below.

Origin X and Origin Y determine the position of the Base point in the Base line (just look at the image). The Base line is the first thing the algorithm "imagines". It will then imagine other nearby lines until it finds one with a segment visible in a hatching area. The remaining lines with visible segments are found and rasterized.

If no Base line and Base point were used, then the algorithm would have no way to find out which lines go where, it would simply paint lines "where it sees fit" preventing the coordination required to achieve a coherent hatching instead of just black blobs of paint or overlapping lines that would happen if one simply cloned a set of lines.

If a tool can achieve this coordination without an Origin point, then it is actually taking point (0, 0) as a base point. I preferred to let the user decide where his base point goes, even if most of the time he will just leave the default on. This has the advantage of making the brush resize resistant.

Crosshatching Options

In development

Hatching Preferences


  • Trigonometry-algebra: the basic algorithm,the user-visible part is described in the image.
  • Scratch off: a more involved algorithm, that creates a huge hatching area first, and then reveals it to the user gradually as he paints. This should allow to use curve-based hatching as well as to reduce the problem of thickening lines. All this at the cost of processing peaks every time the user restarts the brush (releases the mouse button and presses again) -----INDEFINITELY POSTPONED-----

Other Options:

  • Antialias: choose whether to use the Wu or DDA algorithm to trace lines, Wu for antialiased lines, DDA for aliased lines. The DDA algorithm allows only 1 px thick lines and so it must be substituted soon.
  • Subpixel precision: choose whether to preserve or strip off all subpixel data from the algorithm, this causes both coordinate and point to be rounded, save for "Thickness". The result of deactivating this is lines that don't thicken too much when the mouse is passed over them again.
  • Opaque Background: a background will be created beneath the lines before they are rendered, instead of tracing the lines over a transparent background. ----this feature doesn't look as well as it should at the moment----

This page was last edited on 6 December 2010, at 17:56. Content is available under Creative Commons License SA 4.0 unless otherwise noted.