better make polygon into blocks first (pixelize) and then decompose it into rectangles
rectirization A polygon to rectangle conversion tool, written in cpp
extractrect find the largest rectangle inscribed in a non-convex polygon
decompose rectlinear polygon in nodejs