## 7. Square Patterns

Some starter square patterns which can be used to create an initial tessellation. The idea here would be that the tessellation could then be sent into a correction filter to make a "technically correct" kufic pattern.

### 7.1. Macro Definition Group

Patterns are represented 16-bit integers. They are populated in a worgle group called `patterns`.

<<enums>>=
``<<patterns>>``

`radicals` are fundemental figures that can be OR'd together to make squares.

#### 7.2.1. Lines

There are two kinds of lines, horizontal and vertical, each with 4 possible positions. Giving a total of 8 lines.

`HLINE` goes from top to bottom 0-3.

<<patterns>>=
``````#define KUF_HLINE_0 0x0033
#define KUF_HLINE_1 0x00cc
#define KUF_HLINE_2 0x3300
#define KUF_HLINE_3 0xcc00``````

`VLINE` goes from left to right 0-3.

<<patterns>>=
``````#define KUF_VLINE_0 0x0505
#define KUF_VLINE_1 0x0a0a
#define KUF_VLINE_2 0x5050
#define KUF_VLINE_3 0xa0a0``````

#### 7.2.2. Half-Lines

Half lines are lines that are only 2 tiles long instead 4. There are horizontal half lines and vertical halflines. This makes a total of 16 possible segments.

`HLINE_HALF` goes in the same order, but with east and west halves.

<<patterns>>=
``````#define KUF_HLINE_HALF_WEST_0 0x0003
#define KUF_HLINE_HALF_EAST_0 0x0030
#define KUF_HLINE_HALF_WEST_1 0x000c
#define KUF_HLINE_HALF_EAST_1 0x00c0
#define KUF_HLINE_HALF_WEST_2 0x0300
#define KUF_HLINE_HALF_EAST_2 0x3000
#define KUF_HLINE_HALF_WEST_3 0x0c00
#define KUF_HLINE_HALF_EAST_3 0xc000``````

A similar deal with `VLINE_HALF`, only with north and south halves.

<<patterns>>=
``````#define KUF_VLINE_HALF_NORTH_0 0x0005
#define KUF_VLINE_HALF_SOUTH_0 0x0500
#define KUF_VLINE_HALF_NORTH_1 0x000a
#define KUF_VLINE_HALF_SOUTH_1 0x0a00
#define KUF_VLINE_HALF_NORTH_2 0x0050
#define KUF_VLINE_HALF_SOUTH_2 0x5000
#define KUF_VLINE_HALF_NORTH_3 0x00a0
#define KUF_VLINE_HALF_SOUTH_3 0xa000``````

### 7.3. Parallel Lines

Horizontal and vertial parallel lines.

Ordering is done left-to-right, top-to-bottom.

<<patterns>>=
``````#define KUF_HPARALLEL_0 (KUF_HLINE_0 | KUF_HLINE_2)
#define KUF_HPARALLEL_1 (KUF_HLINE_1 | KUF_HLINE_3)
#define KUF_VPARALLEL_0 (KUF_VLINE_0 | KUF_VLINE_2)
#define KUF_VPARALLEL_1 (KUF_VLINE_1 | KUF_VLINE_3)``````

### 7.4. Corners

Labelled by their cardinal position.

<<patterns>>=
``````#define KUF_CORNER_NORTHWEST \
(KUF_HLINE_0 | \
KUF_VLINE_0 | \
KUF_HLINE_HALF_EAST_2 | \
KUF_VLINE_HALF_SOUTH_2)
#define KUF_CORNER_NORTHEAST \
(KUF_HLINE_0 | \
KUF_VLINE_3 | \
KUF_HLINE_HALF_WEST_2 | \
KUF_VLINE_HALF_SOUTH_1)
#define KUF_CORNER_SOUTHWEST \
(KUF_HLINE_3 | \
KUF_VLINE_0 | \
KUF_HLINE_HALF_EAST_1 | \
KUF_VLINE_HALF_NORTH_2)
#define KUF_CORNER_SOUTHEAST \
(KUF_HLINE_3 | \
KUF_VLINE_3 | \
KUF_HLINE_HALF_WEST_1 | \
KUF_VLINE_HALF_NORTH_1)``````

### 7.5. Diagonals and Crosshatches

<<patterns>>=
``````#define KUF_DIAGONAL_0 0x0660
#define KUF_DIAGONAL_1 0x9009
#define KUF_CROSSHATCH_0 0x4664
#define KUF_CROSSHATCH_1 ~KUF_CROSSHATCH_0``````

prev | home | next