Small unmanned aerial vehicles (UAVs) can use their flexible maneuverability to effectively collect images of urban buildings, and use the current multi-view stereo method to generate advanced 3D urban models. But the quality of the generated 3D model largely depends on a flight plan. This paper proposes a method to automatically generate a rough 3D contour based on the 2D contour of the building extracted from the orthophoto of the drone, and plan a shooting viewpoint for 3D reconstruction based on the contour information. The optimized ant colony algorithm is used to plan the optimal power consumption cost path of the viewpoint, and the UE4 game engine is used to simulate the planning result. This method can effectively simplify the flight planning process and minimize the small UAV in the acquisition process The problem of excessive consumption caused by alternate lifting.