I'm trying to implement the solution to get the minimum dissection into rectangles of a rectilinear polygon.
My shape is made out of pseudo-pixels (different width/height) but for the moment let's say it's only pixels.
I need to find a way to convert my shape to a vertices loop.
for example a simple pixel of coordinate {50, 25}
would give me 4 vertices (to read clockwise) as follow {{50, 25}{51, 25}{51, 26}{50, 26}}
.
Imagine now a more complex filled shape with holes in it like this one of 6 pixels height and 24 pixels width.
S
|¯¯¯¯| |¯¯¯¯¯¯|
__| |____| __ |__
| |__| |
¯¯| |¯¯¯¯| |¯¯
|____| |______|
I can't seem to find the logic to parse my shape and convert it to vertices. Only thing I know is I think I will start parsing with pixel of coordinate S
which is the top-left pixel of the shape.
Thanks in advance,