Browse Source

场景obj模型转换为b3dm

lyhzzz 1 năm trước cách đây
mục cha
commit
a9af50cd43

+ 3 - 3
src/main/java/com/fdkankan/fusion/service/impl/CaseNumServiceImpl.java

@@ -118,7 +118,6 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
     private String getGlbUrl(Integer type, String num,Model model) {
         if(type == 0 || type == 1 || type == 4 || type == 6){ //看看,看见
             String objPath = String.format(FilePath.OBJ_LOCAL_PATH ,environment,num);
-            String ossGlbPath =String.format(FilePath.MODEL_OSS_PATH,environment,num);
 
             ShellUtil.yunDownload(String.format(FilePath.OBJ_OSS_PATH, num)+"/data/mesh" ,objPath);
             List<String> localGlbPaths = new ArrayList<>();
@@ -130,8 +129,9 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
                 for (String localGlbPath : localGlbPaths) {
                     File file = new File(localGlbPath);
                     model.setModelSize(FileWriterUtil.setFileSize(file.length()));
-                    ShellUtil.yunUpload(localGlbPath,objPath);
-                    ossGlbPaths.add(queryPath +ossGlbPath+"/tileset.json");
+                    String ossPath = localGlbPath.replace("/mnt/","");
+                    ShellUtil.yunUpload(localGlbPath,ossPath);
+                    ossGlbPaths.add(queryPath +ossPath+"/tileset.json");
                 }
                 return JSONArray.toJSONString(ossGlbPaths);
             }