|
@@ -66,6 +66,9 @@ public class OpsServiceImpl implements OpsService {
|
|
|
try {
|
|
|
ConvertUtils.convertDamToTxt2(damPath, testModelDataTxtPath);
|
|
|
log.info("dam2Txt完成, path: {}", testModelDataTxtPath);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
@@ -75,12 +78,23 @@ public class OpsServiceImpl implements OpsService {
|
|
|
private void doTxt2Obj(String code){
|
|
|
// todo modeldata.txt to mesh.obj
|
|
|
String basePath = configConstant.serverBasePath + code;
|
|
|
-// String txt2objDir = basePath+ "/test.txt";
|
|
|
+
|
|
|
+ // 删除旧文件test.obj、test.mtl
|
|
|
+ fileUtils.del("/tools/txt2obj/test.txt");
|
|
|
+ fileUtils.del("/tools/txt2obj/test.mtl");
|
|
|
+ fileUtils.del("/tools/txt2obj/test.obj");
|
|
|
+
|
|
|
+
|
|
|
String txt2objDir = configConstant.serverBasePath + "tools/txt2obj";
|
|
|
+ // 复制txt文件到算法工具目录
|
|
|
+ FileUtil.copy(configConstant.serverBasePath + code + "/test.txt", txt2objDir + "/test.txt", true);
|
|
|
String txt2objCmd = "python " + configConstant.serverBasePath + "tools\\txt2obj\\run.py " + txt2objDir;
|
|
|
CmdUtils.callLine(txt2objCmd);
|
|
|
String meshObjPath = txt2objDir + "/test.obj";
|
|
|
String meshObjMtlPath = txt2objDir + "/test.mtl";
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if (!FileUtil.exist(meshObjPath)) {
|
|
|
throw new BaseRuntimeException("算法生成test.obj失败: " + meshObjPath);
|
|
|
}
|