My first attempt to programmatically draw Celtic knots made use of the fact that Celtic knots on rectangular grids can be decomposed into a set of 35 base tiles, or just twelve tile types with rotations:
|Single outer||Two opposite outer|
|Two adjacent outer||Triple outer|
|Single inner||Two opposite inner|
|Two adjacent inner||Triple inner|
|Full inner||Opposite outer and inner|
By adjoining these tiles together, seamless knot images can be created.
The tile decomposition divides the knot into independent pieces that are easy to draw, but rules must be followed in adjoining the tiles together. The diamond decomposition is an alternate way of decomposing Celtic knots which more naturally encodes information about the structure of the knot. Each diamond is a quadrilateral.There are two strands in each diamond, which either cross or deflect. In the case of crossing, the strands connect opposite sides of the diamond. In the case of deflection, the two strands run roughly parallel, connecting pairs of adjacent sides. I refer to diamonds where the strands cross as “open” and those with crossings as “closed” (note there are two ways for a diamond to be closed), and say that the closed diamonds have a “gate” that runs between opposite corners of the diamond, separating the diamond into two compartments that contain the two strand segments.
Diamonds can be adjoined to create Celtic knots, but it is difficult to produce a set of tiles that produce smooth-looking knots because the closure of adjacent diamonds affects the curvature of the strands.
The basis for free-form Celtic knots is the natural extension of the diamond decomposition.