Would be interesting to see a solution of the reverse process i.e. given an image or definition of a final model, create a bill of materials and (within various bounds) output step-by-step instructions to create it.
Lego did have this, and I think they still do, but the building instructions it created were fairly formulaic, layer-by-layer instructions. The manuals you get with a normal Lego set are much better.