import "../Utils/jest.util"; import { LoadEntityFromFileData } from "../Utils/LoadEntity.util"; LoadEntityFromFileData; //如果不延迟导入,则导致循环依赖错误 import { inflateBase64 } from "../../src/Common/inflate"; import { CADFiler } from "../../src/DatabaseServices/CADFiler"; import { Database } from "../../src/DatabaseServices/Database"; import { RoomWallBase } from "../../src/DatabaseServices/Room/Entity/Wall/RoomWallBase"; import { RoomWallLine } from "../../src/DatabaseServices/Room/Entity/Wall/RoomWallLine"; import { RoomWallParse } from "../../src/DatabaseServices/Room/ParseService/RoomWallParse"; test('网洞绘制错误', () => { let str = "WebCADSuperCopy:eJy9U7tOxEAM/JetncizL3v/gIIC0VCcrrgiSEgLkeAo+HucXAghdydFQpBkk1lr7MzI6x3IKZIjJXAkkLf1eKhvHbEh5yzg50Akd9/3zw+HWm+fXjpnjGCZlsM8kUBixB3sdbovov34Ob6+d5uo8EMIbPLE/hSDllYzRx9zQUhKWdBiedE5q1CDJNIyQ6BpeGTQOlq66Wt319ePOtnyky1ss7VFUeaNxhuIB7cIJUkKrDlSiqty39WQDA1ST10I1CjzXK/JfL1n/h97ZqLaopJTDJ4NbOvZZdZVQ+GvDfHvzJwdwKxDSZurrwnz4wo/9rC8EaY5zOMRzau9rCdXFwRPZUUHr/nAgsL7T0ws5zA="; str = str.substr(16); str = inflateBase64(str); let f = new CADFiler(JSON.parse(str)); f.Read(); f.Read(); let db = new Database; db.FileRead(f); let walls = db.ModelSpace.Entitys.filter(e => e instanceof RoomWallBase) as RoomWallLine[]; new RoomWallParse(false, undefined, false).Parse(walls); for (let w of walls) { expect(w.MeshGeometry.vertices.length).toMatchSnapshot(); } });