Left Boundary Turn Sequence

The left boundary turn sequence is

Lt(i) = / if i == 1 mod 3 then  turn -120   (right)
        | otherwise
        | let b = bit above lowest 1-bit of i-floor((i+1)/3)
        | if b = 0 then         turn 0      (straight ahead)
        \ if b = 1 then         turn +120   (left)

= 1, 0, 0, 1, -1, 0, 1, 0, -1, 1, -1, 0, 1, 0, 0, 1, -1, -1, ...
  starting i=1, multiple of 120 degrees

The sequence can be calculated in a similar way to the right boundary, but from an initial V part since the "0" and "2" points are on the left boundary (and "1" is not).

     2
Vrev  \
       \
  0-----1

This expands as

  2     *      initial
   \   / \       Vtrev[0] = 1
    \ /   \      Rtrev[0] = empty
     a-----1
      \          Vtrev[1] = Vtrev[0], 0, Rtrev[0]
       \                  = 1, 0   (at "*" and "a")
  0-----*

   Vtrev[k+1] = Vtrev[k], 0, Rtrev[k]
   Rtrev[k+1] = Vtrev[k], 1, Rtrev[k]
The
R and V parts are the same on the left, but are to be taken in reverse.

The left side 0 to 2 is the same V shape as on the right (by symmetry), but the points are in reverse.

Right and Left Turn Matching

Boundary Straight 2s

1 x straight Right j=2 010 left j == 2 mod 8 j=3 11 straight i == 3 mod 12 j= 1100 straight trailing 0s >= 2 j= 1101 left

2 x straight Right i=9 j=6 110 i=10 j=7 111 even ...110 so j == 6 mod 8 odd ...111 i == 9 mod 12 i=21 +12 i=22 +12

Left odd even N and N+1 both bit-above-low-1 = 1 both straight 2m-1 2m odd must be ...11 odd+1 x100 must be ...1100 so odd 1011 is 11 mod 16

Boundary Isolated Triangles

When the boundary visits a point twice it does so by enclosing a single unit triangle. This is seen for example in the turn sequence diagram above where turns 5 and 8 are at the same point and the turns go -1, 1, 1, -1 to enclose a single unit triangle.

\     7  Rt(7)=1
 \   / \
  \8/   \
   *-----6  Rt(6)=1
    \5  Rt(5)=-1
     \
      \

         *     *
        / \   / \
       /   \ /   \
\     *-----*-----*
 \   / \   / \
  \ /   \ /   \
   *     *-----*
          \
           \
            \