Previous optimization approaches with regard to the overall urban form can no longer meet the demand for accurately implementing building energy consumption carbon emission reduction at small spatial scales. This study constructed building energy consumption-oriented urban functional area division method using points of point-of-interest (POI), three-dimensional building and roadway data with urban functional areas as units. The method linked POI to buildings, using building volume as an auxiliary parameter to determine the functional attributes of blocks while taking into account the building operational energy consumption. The residential functional areas, commercial functional areas and industrial functional areas, which account for more than 90% of the total building operation energy consumption and the top three in terms of share, are selected as the analysis objects. Geographic detector was applied to analyze the mechanism of carbon metabolism in the compact spatial patterns of these three functional areas. The case study in Xiamen, China reveals that (1) Three-dimensional building compactness is an important factor influencing building energy consumption(normalized difference vegetation index q-value is 0.227); (2) the difference in energy consumption between different compactness classes in residential and commercial functional areas is significant, while not in industrial functional areas; (3) according to the three-dimensional building compactness optimization path of this study, the building operation energy consumption in central Xiamen City could be optimized to reduce by 7% in 2015. Based on the self-created building energy consumption-oriented functional area division method, it is concluded at the functional areas scale that different types of urban functional zones have different optimization methods for three-dimensional building compactness. Such optimization can save construction resources and achieve double carbon more effectively.