diff --git a/__test__/Room/RoomParse.test.ts b/__test__/Room/RoomParse.test.ts index 7f14f11ec..0b758e94a 100644 --- a/__test__/Room/RoomParse.test.ts +++ b/__test__/Room/RoomParse.test.ts @@ -245,3 +245,18 @@ test('删除共面(同向)墙线', () => for (let c of walls[0].LidCurves) expect(c.Length).toMatchNumberSnapshot(); }); + +test('z不为0时分析错误', () => +{ + let d = + { "file": [2, "RoomWallLine", 1, 3, 8, 2, 124, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -13710.71648240625, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -13710.71648240625, 1], 0, 120, 0, 2700, 7598.467587478741, -303.5140527181652, 0, 5724.050903378557, -303.5140527181652, 0, "RoomWallLine", 1, 3, 8, 2, 126, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -13710.71648240625, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -13710.71648240625, 1], 0, 120, 0, 2700, 5776.923628395063, -1966.0055000000004, 0, 5776.923628395063, -303.5140527181652, 0], "basePt": { "x": 5716.923628395063, "y": -1966.0055000000004, "z": -13710.71648240625 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] }; + let walls = LoadEntityFromFileData(d); + new RoomWallParse(true, undefined, false).Parse(walls); + + for (let c of walls[0].LeftCurves) + expect(c.Length).toMatchNumberSnapshot(); + for (let c of walls[0].RightCurves) + expect(c.Length).toMatchNumberSnapshot(); + for (let c of walls[0].LidCurves) + expect(c.Length).toMatchNumberSnapshot(); +}); diff --git a/__test__/Room/__snapshots__/RoomParse.test.ts.snap b/__test__/Room/__snapshots__/RoomParse.test.ts.snap index 3e1acfeac..3772dd7ea 100644 --- a/__test__/Room/__snapshots__/RoomParse.test.ts.snap +++ b/__test__/Room/__snapshots__/RoomParse.test.ts.snap @@ -1,5 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`z不为0时分析错误 1`] = `"1761.54396"`; + +exports[`z不为0时分析错误 2`] = `"1874.41668"`; + +exports[`z不为0时分析错误 3`] = `"120.00000"`; + +exports[`z不为0时分析错误 4`] = `"60.00000"`; + exports[`不同厚度的墙合理的延伸 1`] = ` Array [ -1741.576246932827,