Preperation for MarchingSquare.