Added isCCW in toShapes().