Automatic generation of medium-detailed 3D models of buildings based on CAD data