I have a 150*150 figure inside it are multiple irregular shaply
polygons. The polygons are defined using points as follows: polyon((140 0, 140 50, 140 95, 140 140, 95 140, 65 140, 65 150, 150 150, 150 0, 140 0))
Is there any way to divide each irregular shape into multiple perfect rectangles.
Like this (the red lines):
All the polygons in the image:
Polygon((140 0, 140 50, 140 95, 140 140, 95 140, 65 140, 65 150, 150 150, 150 0, 140 0))
Polygon((75 0, 75 25, 90 25, 90 0, 75 0))
Polygon((0 140, 0 150, 40 150, 40 145, 15 145, 15 140, 0 140))
Polygon((25 25, 25 30, 30 30, 30 45, 40 45, 40 25, 25 25))
Polygon((15 35, 15 30, 10 30, 10 35, 15 35))
Polygon((5 0, 5 5, 10 5, 10 0, 5 0))