Three-dimensional (3D) geological models can visually present various underground geological body forms, geological structures, geological hazards, which is of great significance for urban spatial planning and urban geological hazard prevention and control. To overcome technical difficulties such as poor accuracy, poor aesthetics and the difficulty to modify and improve the model afterward, this paper proposes a 3D modeling technology for urban geology with multiple complex geological structures based on multi-source heterogeneous data with the common constraints of geological knowledge and geological laws. This technique can utilize various modeling data, such as DEM data, geological profiles, drillhole data, geophysical interpretation data and structure outline maps. Under the common constraints of geological prior knowledge and geological laws, the block modeling technique is used to complete the construction of 3D urban geological models under complex geological conditions. Taking the construction of 3D geological model in Chengdu as an example, this paper focuses on the theory and algorithm of 3D modeling of urban geology, the geological background of the demonstration area, the preparation and processing of 3D modeling data, and the research and demonstration application of 3D modeling technology for urban geology.