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.
Connect this to DALL-E, and instaneously create new Lego sets with text prompts.
So that's how the world ends, a computer going full paperclip maximizer trying to build Lego sheep that are in some way "electric"
I think LEGO used to have a publicly-available CAD which could give the building steps, given a model.
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.