mbrown1413 / Mechanical-Puzzle-Studio

The Swiss Army knife of mechanical puzzle design.
https://puzzlestudio.io/
Mozilla Public License 2.0
1 stars 0 forks source link

[Disassembler] Slow spacing of separated parts #84

Open mbrown1413 opened 5 months ago

mbrown1413 commented 5 months ago

Disassembly.spaceSeparatedParts() will space parts out so they don't touch each other in the disassembly view. The implementation is really slow! Try AlPackino.xmpuzzle from the BurrTools example files for example. The separation code is run inside SolutionDisplay, so it happens every time the puzzle is loaded (the non-separated version is stored, and only separated for display).

I'm pretty sure the algorithm's complexity can be improved. It's a pretty naive implementation at the moment.