diff --git a/__test__/EdgeSealing/EdgeSealing.test.ts b/__test__/EdgeSealing/EdgeSealing.test.ts index e1eb7955d..a033cf019 100644 --- a/__test__/EdgeSealing/EdgeSealing.test.ts +++ b/__test__/EdgeSealing/EdgeSealing.test.ts @@ -154,6 +154,28 @@ test("封边错误板件4", () => expect(con.Area2).toMatchNumberSnapshot(); }); +test("封边错误板件5", () => +{ + let data = + { "file": [1, "Board", 10, 2, 100, 0, 1, 2, 71, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 707.7669902912621, 389.3203883495146, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 111.76699029126212, 407.3203883495146, 0, 1], 0, 0, 1, 3, 328, 510, 18, false, "Polyline", 10, 2, 0, 0, 0, 7, 71, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 36, 0, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, 2, 8, [474, 0], 0, [474, 328], 0, [-18, 328], 0, [-18, 278], 0, [-36, 278], 0, [-36, 61], 0, [0, 61], 0, [0, 0], 0, true, 0, 3, 0, 0, 0, 0, 0, 11, 1, "立板", "A06203*2", "B2", "2102双面板", "S", "", 0, 0, "三合一", 2, 8, 0, 0, 1, 1, 1, 1, 0, 0, "1", "0", "0", "0", "", "", "", 8, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, 0, 0, null], "basePt": { "x": 707.7669902912621, "y": 389.3203883495146, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] }; + let br = LoadBoardsFromFileData(data)[0]; + + let { sealedContour: con } = GetSealedBoardContour(br); + expect(con.IsClose).toBeTruthy(); + + expect(con.Area2).toMatchNumberSnapshot(); +}); +test("封边错误板件6", () => +{ + let data = + { "file": [1, "Board", 10, 2, 100, 0, 1, 2, 71, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 2168.8389067505414, 321.8527315914489, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1146.8389067505414, 321.8527315914489, -678, 1], 0, 0, 1, 3, 1053.3994768218004, 596.1299906822055, 16, false, "Polyline", 10, 2, 0, 0, 0, 7, 71, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 203.3994768217999, 0, 1], 0, 0, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, 2, 6, [596.1299906822055, 210.74509690396826], 0, [596.1299906822055, 850], 0, [0.12999068220551635, 850.0000000000005], 0, [0.1299906822050616, 0], 0, [0, 0], 0, [193.39199063443812, -203.3994768217999], 0, true, 0, 3, 0, 0, 0, 0, 0, 11, 0, "顶板", "A07076", "H", "哑白单面板", "D", "", 2, 0, "三合一", 0, 6, 0, 0, 1, 1, 1, 0, "1", "0", "0", "0", "", "", "", 6, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, 0, 0, 0, true, 0, 0, null], "basePt": { "x": 1115.439429928741, "y": 321.8527315914489, "z": 0 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] }; + let br = LoadBoardsFromFileData(data)[0]; + + let { sealedContour: con } = GetSealedBoardContour(br); + expect(con.IsClose).toBeTruthy(); + + expect(con.Area2).toMatchNumberSnapshot(); +}); test("切割残留一个封边厚度的凸角的板件封边", () => { @@ -295,6 +317,7 @@ test('镜像判断不足导致点表凸度错误2', () => }); + //测试代码 /** let enRes = await app.Editor.GetEntity({ Filter: { filterTypes: [Polyline] } }); diff --git a/__test__/EdgeSealing/__snapshots__/EdgeSealing.test.ts.snap b/__test__/EdgeSealing/__snapshots__/EdgeSealing.test.ts.snap index d29359c25..188275097 100644 --- a/__test__/EdgeSealing/__snapshots__/EdgeSealing.test.ts.snap +++ b/__test__/EdgeSealing/__snapshots__/EdgeSealing.test.ts.snap @@ -34,6 +34,10 @@ exports[`封边错误板件3 1`] = `"359947.95128"`; exports[`封边错误板件4 1`] = `"30748.99860"`; +exports[`封边错误板件5 1`] = `"163864.00000"`; + +exports[`封边错误板件6 1`] = `"523658.53369"`; + exports[`常规板件,常规坐标系 1`] = `"716404.00000"`; exports[`常规板件,常规坐标系 2`] = `"711624.00000"`;