3x3 pattern grid generation