From c20b8971eae71f69dfb1b26cc3754dc00008fbd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E6=BE=B3?= Date: Mon, 13 Jan 2025 15:29:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E5=A4=84=E7=90=86bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- post_pro/merge_obj.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/post_pro/merge_obj.py b/post_pro/merge_obj.py index 45c21e8..89c68ca 100644 --- a/post_pro/merge_obj.py +++ b/post_pro/merge_obj.py @@ -292,6 +292,17 @@ class MergeObj: def merge_grid_obj(self, grid_points: Dict[tuple, pd.DataFrame], translations: Dict[tuple, tuple]): """合并所有网格的OBJ模型""" + if len(grid_points) == 1: + grid_id = list(grid_points.keys())[0] + shutil.copytree(os.path.join(self.output_dir, + f"grid_{grid_id[0]}_{grid_id[1]}", + "project", + "odm_texturing"), + os.path.join(self.output_dir, "texturing")) + os.rename(os.path.join(self.output_dir, "texturing", "odm_textured_model_geo.obj"), + os.path.join(self.output_dir, "texturing", "textured_model.obj")) + return + try: # 创建输出目录 output_model_dir = os.path.join(self.output_dir, "texturing")