From cd14fb993fa72b36d81488c5088dcf96fabd7524 Mon Sep 17 00:00:00 2001 From: ChenX Date: Thu, 10 Mar 2022 16:27:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91:=E5=A2=9E=E5=8A=A0=E7=94=A8?= =?UTF-8?q?=E4=BE=8B=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __test__/Geometry/EdgeGeometry.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/__test__/Geometry/EdgeGeometry.test.ts b/__test__/Geometry/EdgeGeometry.test.ts index 572d087b2..6ca1a1743 100644 --- a/__test__/Geometry/EdgeGeometry.test.ts +++ b/__test__/Geometry/EdgeGeometry.test.ts @@ -86,3 +86,15 @@ test('构建盖子失败2', () => expect(builder.edgeAndLidBuilder.lineVerticesArray.length).toMatchSnapshot(); } }); + +test('板件轮廓错误导致的崩溃', () => +{ + let d = + { "file": [1, "Board", 8, 2, 82700, false, 1, 2, 0, [-1.8369701987210297e-16, 0, -1, 0, 1, 0, -1.8369701987210297e-16, 0, 0, -1, 0, 0, 75366.82649228878, -20, 61444.81332130321, 1], 82701, 0, true, [6.123233995736766e-17, 0, -1, 0, 0, 1, 0, 0, 1, 0, 6.123233995736766e-17, 0, 75366.82649228878, -20, 61414.70998797221, 1], 0, 3, 0, 30.10333333100425, 18, true, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 2.4492935982947064e-16, 0, 0, -2.4492935982947064e-16, 1, 0, 0, 0, 0, 1, 0, 30.10333333100425, 400, 0, 1], 0, 0, true, [1, 2.4492935982947064e-16, 0, 0, 0, 0, -1, 0, -2.4492935982947064e-16, 1, 0, 0, -573.8645894921335, -4.9261083746064855, 0, 1], 0, 2, 4, [0, -400], 0, [0, -400], 0, [-30.10333333100425, -400], 0, [-30.10333333100425, -400], 0, true, 1, 3, 400, 9.900000000000189, 14.2, true, "Polyline", 8, 2, 0, false, 0, 7, 0, [1, 2.4492935982947064e-16, 0, 0, -2.4492935982947064e-16, 1, 0, 0, 0, 0, 1, 0, 0, 400, 0, 1], 0, 0, true, [1, 2.4492935982947064e-16, 0, 0, 0, 0, -1, 0, -2.4492935982947064e-16, 1, 0, 0, -863.9645894921334, -4.926108374606542, 0, 1], 0, 2, 4, [0, -400], 0, [0, -400], 0, [9.900000000000091, -400], 0, [9.900000000000091, -400], 0, true, 0, 3, 0, 0, 0, 0, 0, [-1.8369701987210297e-16, 0, -1, 0, 1, 0, -1.8369701987210297e-16, 0, 0, -1, 0, 0, 75366.82649228878, -20, 61454.713321303214, 1], 3, 0, 0, 0, 0, 0, 10, 2, "左开门板", "户外鞋柜", "标准柜", "", "", "", 0, 0, "不排", 2, 4, 1.2, 1.2, 0, 1.2, "1.2", "1.2", "1.2", "0", "", "", "", 4, "不排", "不排", "不排", "不排", true, true, 1, "1", "装母拉手", 0, 0, 0, 0, 0, 0, 1, true, 0, 0], "basePt": { "x": 75366.82649228878, "y": -38, "z": 61414.70998797221 }, "ucs": [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1] }; + + let brs = LoadBoardsFromFileData(d); + + brs[0].MeshGeometry; + + expect(0).toBe(0); +});