Embiggening embeds an n-quad at the center of an otherwise empty (n+1)-quad. Each quadrant of the original becomes a corner subquad of the larger structure, leaving an empty ring around it. section 4.3.7
The operation is especially useful with immutable quadtrees: the surrounding empty subquads can all reference one shared empty object. At level zero it is invalid; at the maximum level it returns the existing quad. section 4.3.7
Keeping Life patterns away from the edge
HashLife embiggens a grid when its empty border is insufficient, steps the safely padded grid, and embiggens the result again. This maintains an invariant: living cells remain far from the boundary, so the represented grid does not shrink and can expand when a spaceship approaches an edge. section 4.4.3 section 4.4
Figure 4.8 A 2-quad is “embiggened” so that we have a 3-quad with the cells of the 2-quad in its center. Notice what happens to the northeast portion of the 2-quad when we place it in the 3-quad.
The figure traces how the northeast, northwest, southeast, and southwest portions of a 2-quad relocate inside the four quadrants of a 3-quad. section 4.3.7
public void Step(int speed = 0) #1
{
IQuad current = cells;
if (!current.HasAllEmptyEdges())
current = current.Embiggen().Embiggen();
else if (!current.Center().HasAllEmptyEdges())
current = current.Embiggen(); #2
IQuad next = Step(current); #3
cells = next.Embiggen(); #4
}
The Step implementation shows the two-stage padding test, recursive stepping, and final embiggening used to preserve the boundary invariant. section 4.4.3
