移除调试内容

This commit is contained in:
CZY committed 2025-06-09 09:39:25 +08:00
1 parent 10d5595fb6
commit 942c7f1cc7
3 files changed
+20 -15

No files matched your search

+18 -13
View File
@@ -16,19 +16,24 @@ Database.prototype.AllocationObjectId = function (this: Database, object: CADObj
export function MaterialOut(material: PhysicalMaterialRecord): string
{
let db = new Database();
db.WblockCloneObejcts(
[material],
db.MaterialTable,
new Map(),
DuplicateRecordCloning.Ignore
);
let json = JSON.stringify(db.FileWrite().Data);
// // TODO: Danger: 因为WebCAD依赖库中的部分类的构造函数名异常,所以在生成JSON时需要对类名进行替换
json = json.replace(LayerNode.name, "LayerNode")
.replace(TextureTableRecord.name, "TextureTableRecord")
.replace(PhysicalMaterialRecord.name, "PhysicalMaterialRecord");
return json;
try {
let db = new Database();
db.WblockCloneObejcts(
[material],
db.MaterialTable,
new Map(),
DuplicateRecordCloning.Ignore
);
let json = JSON.stringify(db.FileWrite().Data);
// // TODO: Danger: 因为WebCAD依赖库中的部分类的构造函数名异常,所以在生成JSON时需要对类名进行替换
json = json.replace(LayerNode.name, "LayerNode")
.replace(TextureTableRecord.name, "TextureTableRecord")
.replace(PhysicalMaterialRecord.name, "PhysicalMaterialRecord");
return json;
} catch (error) {
console.error("error in MaterialOut:", error, material);
throw error;
}
}
export function MaterialIn(fileData: Object[]): PhysicalMaterialRecord