Generation of Spatial Patterns Through Cell Polarity Switching