Three-dimensional building model is one of the major components of a cyber-city and is vital for the realization of 3D GIS applications. Related researches can be categorized into "data-driven", "model- driven" and hybrid approaches. The data used could be high-resolution satellite imagery, airborne stereo-pairs, airborne laser scanning, or combination of these data using data fusion scheme. This paper presents a novel algorithm for automatic reconstruction of roof models from 3D structural lines of a building, i.e. their eaves and ridges, which are measured from aerial stereo-pairs. A line-based roof model reconstruction algorithm, namely TIN-Merging and Reshaping (TMR), is proposed. The originality for 3D roof modeling is to perform geometric analysis and topology reconstruction and then reshapes the roof using elevation information from the original 3D structural lines. The proposed scheme reduces the complexity of 3D roof modeling and makes the modeling process easier. The final 3D polyhedral building models are generated by interpolating the building foot height from a digital elevation model. One test area was conducted covering university campus and residential area. Experimental results indicate a nearly 100% success rate for topology reconstruction can be achieved provided that the 3D structural lines can be enclosed as polygons. However, the success rate of the Reshaping stage is dependent on the complexity of the rooftop structure. The results demonstrate that the proposed scheme is robust and accurate, with a high degree of automation, even when a group of connected buildings with multiple layers and mixed roof types is processed.