How to merge a set of uniform cells (2D), into minimal number of larger square cells, plus un-merged cells?
The picture depicts a signed distance field (SDF) of a torus cross-section in 1st quadrant (SD <= 0). Those SDF cells (not refined) that arefar from the cross-section, are not interested, thus need to be merged into big squares as much as possible.
As you can see, I can manually combined those cells, with 1 big square cell (in red color) and 6 smaller square cells (in green color).
Nevertheless, is there any particular algorithms to do this job?