Is there an algorithm that can cover a regular or irregular polygon with right triangles and rectangles?

115 Views Asked by At

I 'd like to know is there any algorithm that i could use to cover a regular or irregular polygon with right triangles and rectangles?

Ideally, it would use a minimum amount of triangles and rectangles.

This is a simple example of what i' m talking about:

Left is the inital state and right is the desired result

Any help would be appreciated.