diff --git a/__test__/EdgeSealing/OneEdgeSealing.test.ts b/__test__/EdgeSealing/OneEdgeSealing.test.ts index f47805bdb..5d66eb057 100644 --- a/__test__/EdgeSealing/OneEdgeSealing.test.ts +++ b/__test__/EdgeSealing/OneEdgeSealing.test.ts @@ -17,3 +17,19 @@ test('只有一个封边,并且失败的案例', () => expect(con.Length).toMatchNumberSnapshot(); } }); + +test('只有一个封边,并且失败的案例(展示这个改进的缺陷的地方)', () => +{ + let d = + { "file": [1, "Board", 8, 2, 16179, false, 1, 2, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 31910.70739109177, 919.8136702083284, 1313, 1], 16190, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 30796.70739109177, 901.8136702083284, 1300, 1], 0, 3, 677, 552, 18, false, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 677, 0, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 6, [1.9681978798586215, -677], 0, [1.9681978798586215, -672], 0, [552, -672], 0, [552, 0], 0, [0, 0], 0, [0, -677], 0, true, 0, 3, 0, 0, 0, 0, 1, 16188, 10, 1, "右侧板", "橱柜", "地柜6号柜", "18-16181", "颗粒板", "16181", 0, 1, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 6, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 3, 16172, 2, 3, 36616, 36617, 36618, 3, 36619, 36620, 36621, 16180, 4, 3, 36624, 36625, 36626, 3, 36627, 36628, 36629, 1, 36630, 1, 36631, 16183, 2, 3, 36636, 36637, 36638, 3, 36639, 36640, 36641, 6, 16173, 16174, 16175, 16176, 16177, 16178, 0, 0, 0, 0, 0, true, 0, 0], "basePt": { "x": 31910.70739109177, "y": 919.8136702083284, "z": 1313 }, "ucs": [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1] }; + + let brs = LoadBoardsFromFileData(d); + + for (let br of brs) + { + let con = GetSealedBoardContour(br, false); + expect(con.IsClose).toBeTruthy(); + expect(con.Area2).toMatchNumberSnapshot(); + expect(con.Length).toMatchNumberSnapshot(); + } +}); diff --git a/__test__/EdgeSealing/__snapshots__/OneEdgeSealing.test.ts.snap b/__test__/EdgeSealing/__snapshots__/OneEdgeSealing.test.ts.snap index 3e5a06beb..188859cc0 100644 --- a/__test__/EdgeSealing/__snapshots__/OneEdgeSealing.test.ts.snap +++ b/__test__/EdgeSealing/__snapshots__/OneEdgeSealing.test.ts.snap @@ -15,3 +15,7 @@ exports[`只有一个封边,并且失败的案例 6`] = `"1033.16428"`; exports[`只有一个封边,并且失败的案例 7`] = `"728287.33629"`; exports[`只有一个封边,并且失败的案例 8`] = `"4881.66371"`; + +exports[`只有一个封边,并且失败的案例(展示这个改进的缺陷的地方) 1`] = `"368500.00000"`; + +exports[`只有一个封边,并且失败的案例(展示这个改进的缺陷的地方) 2`] = `"2440.00000"`;