Partition wire segments into rectangles.