ivapylibs / puzzle_solver

1 stars 2 forks source link

Code: puzzle board exploded view #22

Closed pv33 closed 3 years ago

pv33 commented 3 years ago

The puzzle.builder.fromMask code stub had a member function called explodedPuzzle that did not get translated to the board. Please implement for puzzle.board

An exploded view takes a given puzzle board and "explodes" the pieces outwards so that they are no longer touching if they were before. This terminology comes from mechanical designs (see google search: exploded view). If the puzzle is gridded and the puzzle looks like the ones from basic07, then an exploded view would look like that puzzle template I showed you in the last meeting (bottom row visual of this image).

The function should ask for the delta x and delta y to apply to the pieces as a 2x1 array. This might make sense for the gridded puzzle only, so that might be where to put the member function. The others probably need a different way of exploding the view. Like scaling outwards from some center point in a radial fashion. Who knows.

Please write a test script for the exploded view. Better to prefix with explodeXX_TTTT and not basicXX_YY. The prefix should be informative.

Uio96 commented 3 years ago

demo