1

So we have some complicated shape A which we want to approximate with the union of up to N grid-aligned (x/y axis) rectangles, which we'll call B.

For simplicity let's say A is rendered to a bitmap. This also means that rectangle corners will be on lattice points.

The metric I originally wanted to use and minimize was the area of A XOR B, but we could use another.

I'm guessing this is NP, and for my purposes a fast approximation will suffice. The generated rectangle set should be within some amount of the optimal solution.

  • Please show a sample. –  Jul 25 '17 at 21:41
  • 1
    What exactly does grid-aligned mean? You have an orthogonal uniform grid with a certain cell size and all rectangle edges have to be composed of grid edges? Is the origin of the grid with respect to the shape fixed? – Nico Schertler Jul 27 '17 at 04:05

0 Answers0