Why can't we model the math/code that generates their forms? I would love to have a random-diatom creating app. Better still to take it to the next level and generate an .stl file I could 3D print.
Once you have some molecules/proteins, they'll assemble into microstructures controlled by other proteins and small molecules that can push/pull on 'things', and they'll be influenced by the ambient conditions: temperatures, pHs, mineral contents which they're not fully in control of, but they're the progeny of ancestors that have been doing it for millions of years in the same habitat, and they've been trained and optimized to handle those varying conditions, so they get it right most of the time.
The biology then interacts with physics and chemistry to kinetically grow faster here to make something grow outwards, slower here to make it grow inward, then you can start forming shapes.