import { BoolOpeartionType } from "../../src/GraphicsSystem/BoolOperateUtils"; import { LoadRegionsFromFileData } from "../Utils/LoadEntity.util"; test('无法求到交集', () => { let d = { "file": [2, "Region", 8, 2, 138, false, 1, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 402.7349980402736, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 402.7349980402736, 0, 0, 1], 0, 1, 1, 1, 1, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 402.7349980402736, 0, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 402.7349980402736, 0, 0, 1], 0, 2, 4, [0, 0], 0, [387, 0], 0, [387, 18], 0, [0, 18], 0, true, 0, "Region", 8, 2, 139, false, 1, 2, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 377.7349980402736, -38.99960000002761, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 377.7349980402736, -38.99960000002761, 0, 1], 0, 1, 1, 1, 1, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 377.7349980402736, -38.99960000002761, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 377.7349980402736, -764.0012000002525, 0, 1], 0, 2, 6, [412, 725.0016000002249], 0, [0, 725.0016000002249], 0, [0, 0], 0, [25, 0], 0, [25, -56.998399999775074], 0, [412, -56.998399999775074], 0, true, 0], "basePt": { "x": 377.7349980402736, "y": -764.0012000002525, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] }; let [reg1, reg2] = LoadRegionsFromFileData(d); let reg = reg1.Clone(); reg.BooleanOper(reg2.Clone(), BoolOpeartionType.Intersection); expect(reg.Area).toMatchSnapshot(); });