How to convert pattern to shapes?