We describe a general approach to obtaining 3D microstructures as input to computer simulations of materials properties. We introduce a program called MicroConstructor, that takes 2D micrographs and generates 3D discrete computer microstructures which are statistically equivalent in terms of the microstructural variables of interest. The basis of the code is a genetic algorithm that evolves the 3D microstructure so that its stereological parameters match the 2D data. Since this approach is not limited by scale it can be used to generate 3D initial multiscale microstructures. This algorithm will enable microstructural modellers to use as their starting point, experimentally based microstructures without having to acquire 3D information experimentally, a very time consuming and expensive process.