Skip to content

Patterns

Taco de Wolff edited this page Apr 16, 2023 · 5 revisions

Hatch patterns

There are three different hatch patterns: line hatch, cross hatch, and shape hatch. A line hatch is a hatch of evenly spaced lines at a given distance and at an angle with the X-axis. The cross hatch is basically two line hatches in one and are thus defined by two distances and two angles. The shape hatch can be any shape that is repeated by the rhombus primitive cell. Each hatch specifies the filling paint (color or gradient) and a thickness of the hatch' stroke. When the thickness is zero, no stroking is applied.

thickness := 0.05
lineHatch := canvas.NewLineHatch(canvas.Black, 90.0, 0.5, thickness)
crossHatch := canvas.NewCrossHatch(canvas.Black, 45.0, -45.0, 0.5, 0.5, thickness)
shapeHatch := canvas.NewShapeHatch(canvas.Black, canvas.Circle(0.15), 0.5, thickness)

Hatches

Source code

Tile patterns

Tiling

Source code

Clone this wiki locally