From 011fe692ed33d55880b3709876d4d368b1ff58ff Mon Sep 17 00:00:00 2001 From: ChenX Date: Thu, 29 Aug 2019 16:52:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0CADViewer=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E7=9A=84=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __test__/DTO/Board2CADViewer.test.ts | 14 + .../Board2CADViewer.test.ts.snap | 1199 +++++++++++++++++ 2 files changed, 1213 insertions(+) create mode 100644 __test__/DTO/Board2CADViewer.test.ts create mode 100644 __test__/DTO/__snapshots__/Board2CADViewer.test.ts.snap diff --git a/__test__/DTO/Board2CADViewer.test.ts b/__test__/DTO/Board2CADViewer.test.ts new file mode 100644 index 000000000..6c2b50448 --- /dev/null +++ b/__test__/DTO/Board2CADViewer.test.ts @@ -0,0 +1,14 @@ +import { LoadBoardsFromFileData } from "../Utils/LoadEntity.util"; +import { ErpParseData } from "../../src/Add-on/Erp/ParseData"; + +test('板件到CADViewer', () => +{ + let d = + { "file": [4, "Board", 5, 2, 101, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 578.7081339712918, 220.0956937799043, 0, 1], 0, 0, 2, 800, 582, 18, false, "Polyline", 5, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1067.7357379169855, 971.8129079922719, 0, 1], 0, 0, 2, 24, [1164.6720034839952, -243.277917476808], 0, [1121.00372884482, -317.9365805695915], 0, [1211.1575861644, -408.090437889186], 0, [1067.7357379169855, -358.1241165642739], 0, [1067.7357379169855, -406.94264572423117], 0, [1158.3330603912116, -497.53996819845736], 0, [1067.7357379169855, -497.53996819845736], 0, [1067.7357379169855, -540.718942633777], 0, [1188.6191218345107, -581.3548824252614], 0, [1067.7357379169855, -646.0134366137052], 0, [1067.7357379169855, -706.1802774996197], 0, [1216.792202246882, -675.7347018067047], 0, [1067.7357379169855, -757.6804357511028], 0, [1067.7357379169855, -839.1385681984573], 0, [1190.0277758551292, -839.1385681984573], 0, [1067.7357379169855, -888.8844819360072], 0, [1067.7357379169855, -940.5616576829932], 0, [1153.402771319047, -940.5616576829932], 0, [1067.7357379169855, -953.2307260030163], 0, [1067.7357379169855, -971.8129079922719], 0, [1649.7357379169855, -971.8129079922719], 0, [1649.7357379169855, -171.8129079922719], 0, [1067.7357379169855, -171.8129079922719], 0, [1067.7357379169855, -187.43419926972626], 0, true, 3, 2, 179.17946854625225, 179.17946854625222, 10, false, "Circle", 5, 2, 0, false, 0, 2, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 89.58973427312611, 89.58973427312613, 0, 1], 0, 0, 1, 89.58973427312613, 1, 2, 139.17946854625225, 139.17946854625222, 10, false, "Circle", 5, 2, 0, false, 0, 2, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 69.58973427312611, 69.58973427312613, 0, 1], 0, 0, 1, 69.58973427312613, 0, 3, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 499.9143210279227, 465.4482044552313, 0, 1], 3, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 519.9143210279227, 445.4482044552313, 0, 1], 2, 800, 9, 10, true, "Polyline", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -553.0000000000002, 0, 0, 1], 0, 0, 2, 4, [562.0000000000002, 0], 0, [562.0000000000002, 800], 0, [553.0000000000002, 800], 0, [553.0000000000002, 0], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 578.7081339712915, 773.0956937799039, 8, 1], 2, 116.79966683283226, 116.79966683283226, 10, false, "Circle", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 58.39983341641613, 58.39983341641607, 0, 1], 0, 0, 1, 58.39983341641612, 0, 3, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 33.54710058358364, 574.8605795387455, 8, 1], 3, 0, 0, 0, 5, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 578.7081339712918, 220.0956937799043, 0, 1], 0, "底板", "", "", "", "", "", 0, 1, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 24, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0, "Board", 5, 2, 101, false, 1, 11, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, -100.91743119266054, 73.39449541284404, 0, 1], 0, 0, 2, 4408.678960586129, 4408.678960586129, 18, false, "Circle", 5, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 2204.3394802930643, 2204.3394802930643, 0, 1], 0, 0, 1, 2204.3394802930643, 4, 2, 633.2307692307686, 633.2307692307686, 5, false, "Circle", 5, 2, 0, false, 0, 4, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 316.6153846153843, 316.6153846153843, 0, 1], 0, 0, 1, 316.6153846153843, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, -100.91743119266054, 2910.9647449366785, 1405.2625572161414, 1], 2, 557.8461538461524, 557.8461538461524, 5, false, "Circle", 5, 2, 0, false, 0, 3, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 278.9230769230762, 278.9230769230762, 0, 1], 0, 0, 1, 278.9230769230762, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, -87.91743119266054, 3016.50320647514, 2257.1087110622957, 1], 2, 444.76923076923117, 686, 5, true, "Polyline", 5, 2, 0, false, 0, 2, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -2929.394495412844, -1758.4615384615392, 0, 1], 0, 0, 2, 4, [2929.394495412844, 1758.4615384615392], 0, [3615.394495412844, 1758.4615384615392], 0, [3615.394495412844, 2203.2307692307704], 0, [2929.394495412844, 2203.2307692307704], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, -100.91743119266054, 1689.7339757059085, 1556.0317879853721, 1], 2, 625.6923076923076, 1349.3846153846157, 5, true, "Polyline", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -2416.7791107974595, -2828.923076923078, 0, 1], 0, 0, 2, 4, [2416.7791107974595, 2828.923076923078], 0, [3766.163726182075, 2828.923076923078], 0, [3766.163726182075, 3454.6153846153857], 0, [2416.7791107974595, 3454.6153846153857], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, -87.91743119266054, 1177.1185910905238, 2626.493326446911, 1], 3, 0, 0, 0, 5, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -100.91743119266054, 73.39449541284404, 0, 1], 1, "左侧板", "主卧", "下柜", "", "", "", 0, 0, "123", 2, 0, "1", "1", "1", "1", "", "", "", 1, "123", true, true, 0, 0, 0, 0, 0, "Board", 5, 2, 102, false, 1, 11, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1081.0825688073396, 73.39449541284404, 0, 1], 0, 0, 2, 2000, 600, 18, true, "Polyline", 5, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 2, 4, [0, 0], 0, [600, 0], 0, [600, 2000], 0, [0, 2000], 0, true, 2, 2, 144.00000000000023, 170.42201834862385, 5, true, "Polyline", 5, 2, 0, false, 0, 2, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1810.3119266055044, -1946.2018348623849, 0, 1], 0, 0, 2, 4, [1810.3119266055044, 1946.2018348623849], 0, [1980.7339449541282, 1946.2018348623849], 0, [1980.7339449541282, 2090.201834862385], 0, [1810.3119266055044, 2090.201834862385], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1094.0825688073396, 288.2935779816515, 1001.247706422018, 1], 2, 189.0974955047293, 189.0974955047293, 18, false, "Circle", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 94.54874775236465, 94.54874775236476, 0, 1], 0, 0, 1, 94.54874775236466, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1081.0825688073396, 234.6989586696538, 1267.3595091283692, 1], 3, 0, 0, 0, 5, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1081.0825688073396, 73.39449541284404, 0, 1], 1, "右侧板", "主卧", "下柜", "", "", "", 0, 0, "123", 2, 0, "1", "1", "1", "1", "", "", "", 4, "123", "123", "123", "123", true, true, 0, 0, 0, 0, 0, "Board", 5, 2, 112, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 1165.9726463403786, 6053.1586224684725, 0, 1], 0, 0, 2, 800, 582, 18, false, "Polyline", 5, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1067.7357379169855, 971.8129079922719, 0, 1], 0, 0, 2, 24, [1164.6720034839952, -243.277917476808], 0, [1121.00372884482, -317.9365805695915], 0, [1211.1575861644, -408.090437889186], 0, [1067.7357379169855, -358.1241165642739], 0, [1067.7357379169855, -406.94264572423117], 0, [1158.3330603912116, -497.53996819845736], 0, [1067.7357379169855, -497.53996819845736], 0, [1067.7357379169855, -540.718942633777], 0, [1188.6191218345107, -581.3548824252614], 0, [1067.7357379169855, -646.0134366137052], 0, [1067.7357379169855, -706.1802774996197], 0, [1216.792202246882, -675.7347018067047], 0, [1067.7357379169855, -757.6804357511028], 0, [1067.7357379169855, -839.1385681984573], 0, [1190.0277758551292, -839.1385681984573], 0, [1067.7357379169855, -888.8844819360072], 0, [1067.7357379169855, -940.5616576829932], 0, [1153.402771319047, -940.5616576829932], 0, [1067.7357379169855, -953.2307260030163], 0, [1067.7357379169855, -971.8129079922719], 0, [1649.7357379169855, -971.8129079922719], 0, [1649.7357379169855, -171.8129079922719], 0, [1067.7357379169855, -171.8129079922719], 0, [1067.7357379169855, -187.43419926972626], 0, true, 3, 2, 179.17946854625225, 179.17946854625222, 10, false, "Circle", 5, 2, 0, false, 0, 2, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 89.58973427312611, 89.58973427312613, 0, 1], 0, 0, 1, 89.58973427312613, 1, 2, 139.17946854625225, 139.17946854625222, 10, false, "Circle", 5, 2, 0, false, 0, 2, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 69.58973427312611, 69.58973427312613, 0, 1], 0, 0, 1, 69.58973427312613, 0, 3, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 1087.1788333970103, 6298.5111331438, 0, 1], 3, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 1107.1788333970103, 6278.5111331438, 0, 1], 2, 800, 9, 10, true, "Polyline", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -553.0000000000002, 0, 0, 1], 0, 0, 2, 4, [562.0000000000002, 0], 0, [562.0000000000002, 800], 0, [553.0000000000002, 800], 0, [553.0000000000002, 0], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 1165.972646340378, 6606.1586224684725, 8, 1], 2, 116.79966683283226, 116.79966683283226, 10, false, "Circle", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 58.39983341641613, 58.39983341641607, 0, 1], 0, 0, 1, 58.39983341641612, 0, 3, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 620.8116129526711, 6407.9235082273135, 8, 1], 3, 0, 0, 0, 5, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1165.972646340378, 6053.1586224684725, 0, 1], 0, "底板", "", "", "", "", "", 0, 1, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 24, "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0], "basePt": { "x": -221.29186602870823, "y": 73.39449541284404, "z": 0 } } + let brs = LoadBoardsFromFileData(d); + let u = new ErpParseData(); + for (let br of brs) + { + expect(u.GetModelData(br)).toMatchSnapshot(); + } +}); diff --git a/__test__/DTO/__snapshots__/Board2CADViewer.test.ts.snap b/__test__/DTO/__snapshots__/Board2CADViewer.test.ts.snap new file mode 100644 index 000000000..c9de1554d --- /dev/null +++ b/__test__/DTO/__snapshots__/Board2CADViewer.test.ts.snap @@ -0,0 +1,1199 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`板件到CADViewer 1`] = ` +CADDbBoard { + "BasePoint": Vector3 { + "x": 578.7081339712918, + "y": 220.0956937799043, + "z": 18, + }, + "BoardName": "", + "Buls": Array [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 18, + "L": 800, + "Pts": Array [ + Vector2 { + "x": 96.93626556700974, + "y": 728.534990515464, + }, + Vector2 { + "x": 53.26799092783449, + "y": 653.8763274226803, + }, + Vector2 { + "x": 143.42184824741457, + "y": 563.7224701030859, + }, + Vector2 { + "x": 0, + "y": 613.688791427998, + }, + Vector2 { + "x": 0, + "y": 564.8702622680407, + }, + Vector2 { + "x": 90.59732247422608, + "y": 474.27293979381454, + }, + Vector2 { + "x": 0, + "y": 474.27293979381454, + }, + Vector2 { + "x": 0, + "y": 431.09396535849487, + }, + Vector2 { + "x": 120.88338391752518, + "y": 390.4580255670105, + }, + Vector2 { + "x": 0, + "y": 325.79947137856675, + }, + Vector2 { + "x": 0, + "y": 265.6326304926522, + }, + Vector2 { + "x": 149.05646432989647, + "y": 296.0782061855672, + }, + Vector2 { + "x": 0, + "y": 214.13247224116913, + }, + Vector2 { + "x": 0, + "y": 132.67433979381462, + }, + Vector2 { + "x": 122.29203793814372, + "y": 132.67433979381462, + }, + Vector2 { + "x": 0, + "y": 82.9284260562647, + }, + Vector2 { + "x": 0, + "y": 31.251250309278703, + }, + Vector2 { + "x": 85.6670334020614, + "y": 31.251250309278703, + }, + Vector2 { + "x": 0, + "y": 18.58218198925556, + }, + Vector2 { + "x": 0, + "y": 0, + }, + Vector2 { + "x": 582, + "y": 0, + }, + Vector2 { + "x": 582, + "y": 800, + }, + Vector2 { + "x": 0, + "y": 800, + }, + Vector2 { + "x": 0, + "y": 784.3787087225456, + }, + Vector2 { + "x": 96.93626556700974, + "y": 728.534990515464, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [ + CADDbBoard { + "BasePoint": Vector3 { + "x": 519.9143210279227, + "y": 445.4482044552313, + "z": 10, + }, + "BoardName": "", + "Buls": Array [ + -0.9999999999999999, + -0.9999999999999999, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 10, + "L": 179.17946854625225, + "Pts": Array [ + Vector2 { + "x": 179.17946854625222, + "y": 89.58973427312613, + }, + Vector2 { + "x": -1.4210854715202004e-14, + "y": 89.58973427312614, + }, + Vector2 { + "x": 179.17946854625222, + "y": 89.58973427312613, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [ + CADDbBoard { + "BasePoint": Vector3 { + "x": 499.9143210279227, + "y": 465.4482044552313, + "z": 10, + }, + "BoardName": "", + "Buls": Array [ + -0.9999999999999999, + -0.9999999999999999, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 10, + "L": 139.17946854625225, + "Pts": Array [ + Vector2 { + "x": 139.17946854625222, + "y": 69.58973427312613, + }, + Vector2 { + "x": -1.4210854715202004e-14, + "y": 69.58973427312614, + }, + Vector2 { + "x": 139.17946854625222, + "y": 69.58973427312613, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 139.17946854625222, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": -1, + "y": 0, + "z": 0, + }, + "ZVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + }, + ], + "W": 179.17946854625222, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": -1, + "y": 0, + "z": 0, + }, + "ZVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + }, + CADDbBoard { + "BasePoint": Vector3 { + "x": 578.7081339712915, + "y": 773.0956937799039, + "z": 18, + }, + "BoardName": "", + "Buls": Array [ + 0, + 0, + 0, + 0, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 10, + "L": 800, + "Pts": Array [ + Vector2 { + "x": 9, + "y": 0, + }, + Vector2 { + "x": 9, + "y": 800, + }, + Vector2 { + "x": 0, + "y": 800, + }, + Vector2 { + "x": 0, + "y": 0, + }, + Vector2 { + "x": 9, + "y": 0, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 9, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": -1, + "y": 0, + "z": 0, + }, + "ZVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + }, + CADDbBoard { + "BasePoint": Vector3 { + "x": 33.54710058358364, + "y": 574.8605795387455, + "z": 18, + }, + "BoardName": "", + "Buls": Array [ + -0.9999999999999999, + -0.9999999999999999, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 10, + "L": 116.79966683283226, + "Pts": Array [ + Vector2 { + "x": 116.79966683283226, + "y": 58.39983341641607, + }, + Vector2 { + "x": 7.105427357601002e-15, + "y": 58.39983341641608, + }, + Vector2 { + "x": 116.79966683283226, + "y": 58.39983341641607, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 116.79966683283226, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": -1, + "y": 0, + "z": 0, + }, + "ZVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + }, + ], + "W": 582, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": -1, + "y": 0, + "z": 0, + }, + "ZVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, +} +`; + +exports[`板件到CADViewer 2`] = ` +CADDbBoard { + "BasePoint": Vector3 { + "x": -82.91743119266054, + "y": 73.39449541284404, + "z": 0, + }, + "BoardName": "", + "Buls": Array [ + -0.9999999999999999, + -0.9999999999999999, + 0, + ], + "CabName": "主卧", + "Drillings": null, + "Grain": 0, + "H": 18, + "L": 4408.678960586129, + "Pts": Array [ + Vector2 { + "x": 4408.678960586129, + "y": 2204.3394802930643, + }, + Vector2 { + "x": 0, + "y": 2204.3394802930648, + }, + Vector2 { + "x": 4408.678960586129, + "y": 2204.3394802930643, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [ + CADDbBoard { + "BasePoint": Vector3 { + "x": -95.91743119266054, + "y": 2910.9647449366785, + "z": 1405.2625572161414, + }, + "BoardName": "", + "Buls": Array [ + -0.9999999999999999, + -0.9999999999999999, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 5, + "L": 633.2307692307686, + "Pts": Array [ + Vector2 { + "x": 633.2307692307686, + "y": 316.6153846153843, + }, + Vector2 { + "x": 0, + "y": 316.61538461538436, + }, + Vector2 { + "x": 633.2307692307686, + "y": 316.6153846153843, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 633.2307692307686, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + "ZVec": Vector3 { + "x": 1, + "y": 0, + "z": 0, + }, + }, + CADDbBoard { + "BasePoint": Vector3 { + "x": -82.91743119266054, + "y": 3016.50320647514, + "z": 2257.1087110622957, + }, + "BoardName": "", + "Buls": Array [ + -0.9999999999999999, + -0.9999999999999999, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 5, + "L": 557.8461538461524, + "Pts": Array [ + Vector2 { + "x": 557.8461538461524, + "y": 278.9230769230762, + }, + Vector2 { + "x": 0, + "y": 278.9230769230763, + }, + Vector2 { + "x": 557.8461538461524, + "y": 278.9230769230762, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 557.8461538461524, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + "ZVec": Vector3 { + "x": 1, + "y": 0, + "z": 0, + }, + }, + CADDbBoard { + "BasePoint": Vector3 { + "x": -95.91743119266054, + "y": 1689.7339757059085, + "z": 1556.0317879853721, + }, + "BoardName": "", + "Buls": Array [ + 0, + 0, + 0, + 0, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 5, + "L": 444.76923076923117, + "Pts": Array [ + Vector2 { + "x": 0, + "y": 0, + }, + Vector2 { + "x": 686, + "y": 0, + }, + Vector2 { + "x": 686, + "y": 444.76923076923117, + }, + Vector2 { + "x": 0, + "y": 444.76923076923117, + }, + Vector2 { + "x": 0, + "y": 0, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 686, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + "ZVec": Vector3 { + "x": 1, + "y": 0, + "z": 0, + }, + }, + CADDbBoard { + "BasePoint": Vector3 { + "x": -82.91743119266054, + "y": 1177.1185910905238, + "z": 2626.493326446911, + }, + "BoardName": "", + "Buls": Array [ + 0, + 0, + 0, + 0, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 5, + "L": 625.6923076923076, + "Pts": Array [ + Vector2 { + "x": 0, + "y": 0, + }, + Vector2 { + "x": 1349.3846153846157, + "y": 0, + }, + Vector2 { + "x": 1349.3846153846157, + "y": 625.6923076923076, + }, + Vector2 { + "x": 0, + "y": 625.6923076923076, + }, + Vector2 { + "x": 0, + "y": 0, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 1349.3846153846157, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + "ZVec": Vector3 { + "x": 1, + "y": 0, + "z": 0, + }, + }, + ], + "W": 4408.678960586129, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + "ZVec": Vector3 { + "x": 1, + "y": 0, + "z": 0, + }, +} +`; + +exports[`板件到CADViewer 3`] = ` +CADDbBoard { + "BasePoint": Vector3 { + "x": 1099.0825688073396, + "y": 73.39449541284404, + "z": 0, + }, + "BoardName": "", + "Buls": Array [ + 0, + 0, + 0, + 0, + 0, + ], + "CabName": "主卧", + "Drillings": null, + "Grain": 0, + "H": 18, + "L": 2000, + "Pts": Array [ + Vector2 { + "x": 0, + "y": 0, + }, + Vector2 { + "x": 600, + "y": 0, + }, + Vector2 { + "x": 600, + "y": 2000, + }, + Vector2 { + "x": 0, + "y": 2000, + }, + Vector2 { + "x": 0, + "y": 0, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [ + CADDbBoard { + "BasePoint": Vector3 { + "x": 1099.0825688073396, + "y": 288.2935779816515, + "z": 1001.247706422018, + }, + "BoardName": "", + "Buls": Array [ + 0, + 0, + 0, + 0, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 5, + "L": 144.00000000000023, + "Pts": Array [ + Vector2 { + "x": 0, + "y": 0, + }, + Vector2 { + "x": 170.42201834862385, + "y": 0, + }, + Vector2 { + "x": 170.42201834862385, + "y": 144.00000000000023, + }, + Vector2 { + "x": 0, + "y": 144.00000000000023, + }, + Vector2 { + "x": 0, + "y": 0, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 170.42201834862385, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + "ZVec": Vector3 { + "x": 1, + "y": 0, + "z": 0, + }, + }, + CADDbBoard { + "BasePoint": Vector3 { + "x": 1099.0825688073396, + "y": 234.6989586696538, + "z": 1267.3595091283692, + }, + "BoardName": "", + "Buls": Array [ + -0.9999999999999999, + -0.9999999999999999, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 18, + "L": 189.0974955047293, + "Pts": Array [ + Vector2 { + "x": 189.0974955047293, + "y": 94.54874775236476, + }, + Vector2 { + "x": -1.4210854715202004e-14, + "y": 94.54874775236478, + }, + Vector2 { + "x": 189.0974955047293, + "y": 94.54874775236476, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 189.0974955047293, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + "ZVec": Vector3 { + "x": 1, + "y": 0, + "z": 0, + }, + }, + ], + "W": 600, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + "ZVec": Vector3 { + "x": 1, + "y": 0, + "z": 0, + }, +} +`; + +exports[`板件到CADViewer 4`] = ` +CADDbBoard { + "BasePoint": Vector3 { + "x": 1165.9726463403786, + "y": 6053.1586224684725, + "z": 18, + }, + "BoardName": "", + "Buls": Array [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 18, + "L": 800, + "Pts": Array [ + Vector2 { + "x": 96.93626556700974, + "y": 728.534990515464, + }, + Vector2 { + "x": 53.26799092783449, + "y": 653.8763274226803, + }, + Vector2 { + "x": 143.42184824741457, + "y": 563.7224701030859, + }, + Vector2 { + "x": 0, + "y": 613.688791427998, + }, + Vector2 { + "x": 0, + "y": 564.8702622680407, + }, + Vector2 { + "x": 90.59732247422608, + "y": 474.27293979381454, + }, + Vector2 { + "x": 0, + "y": 474.27293979381454, + }, + Vector2 { + "x": 0, + "y": 431.09396535849487, + }, + Vector2 { + "x": 120.88338391752518, + "y": 390.4580255670105, + }, + Vector2 { + "x": 0, + "y": 325.79947137856675, + }, + Vector2 { + "x": 0, + "y": 265.6326304926522, + }, + Vector2 { + "x": 149.05646432989647, + "y": 296.0782061855672, + }, + Vector2 { + "x": 0, + "y": 214.13247224116913, + }, + Vector2 { + "x": 0, + "y": 132.67433979381462, + }, + Vector2 { + "x": 122.29203793814372, + "y": 132.67433979381462, + }, + Vector2 { + "x": 0, + "y": 82.9284260562647, + }, + Vector2 { + "x": 0, + "y": 31.251250309278703, + }, + Vector2 { + "x": 85.6670334020614, + "y": 31.251250309278703, + }, + Vector2 { + "x": 0, + "y": 18.58218198925556, + }, + Vector2 { + "x": 0, + "y": 0, + }, + Vector2 { + "x": 582, + "y": 0, + }, + Vector2 { + "x": 582, + "y": 800, + }, + Vector2 { + "x": 0, + "y": 800, + }, + Vector2 { + "x": 0, + "y": 784.3787087225456, + }, + Vector2 { + "x": 96.93626556700974, + "y": 728.534990515464, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [ + CADDbBoard { + "BasePoint": Vector3 { + "x": 1107.1788333970103, + "y": 6278.5111331438, + "z": 10, + }, + "BoardName": "", + "Buls": Array [ + -0.9999999999999999, + -0.9999999999999999, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 10, + "L": 179.17946854625225, + "Pts": Array [ + Vector2 { + "x": 179.17946854625222, + "y": 89.58973427312613, + }, + Vector2 { + "x": -1.4210854715202004e-14, + "y": 89.58973427312614, + }, + Vector2 { + "x": 179.17946854625222, + "y": 89.58973427312613, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [ + CADDbBoard { + "BasePoint": Vector3 { + "x": 1087.1788333970103, + "y": 6298.5111331438, + "z": 10, + }, + "BoardName": "", + "Buls": Array [ + -0.9999999999999999, + -0.9999999999999999, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 10, + "L": 139.17946854625225, + "Pts": Array [ + Vector2 { + "x": 139.17946854625222, + "y": 69.58973427312613, + }, + Vector2 { + "x": -1.4210854715202004e-14, + "y": 69.58973427312614, + }, + Vector2 { + "x": 139.17946854625222, + "y": 69.58973427312613, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 139.17946854625222, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": -1, + "y": 0, + "z": 0, + }, + "ZVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + }, + ], + "W": 179.17946854625222, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": -1, + "y": 0, + "z": 0, + }, + "ZVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + }, + CADDbBoard { + "BasePoint": Vector3 { + "x": 1165.972646340378, + "y": 6606.1586224684725, + "z": 18, + }, + "BoardName": "", + "Buls": Array [ + 0, + 0, + 0, + 0, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 10, + "L": 800, + "Pts": Array [ + Vector2 { + "x": 9, + "y": 0, + }, + Vector2 { + "x": 9, + "y": 800, + }, + Vector2 { + "x": 0, + "y": 800, + }, + Vector2 { + "x": 0, + "y": 0, + }, + Vector2 { + "x": 9, + "y": 0, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 9, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": -1, + "y": 0, + "z": 0, + }, + "ZVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + }, + CADDbBoard { + "BasePoint": Vector3 { + "x": 620.8116129526711, + "y": 6407.9235082273135, + "z": 18, + }, + "BoardName": "", + "Buls": Array [ + -0.9999999999999999, + -0.9999999999999999, + 0, + ], + "CabName": "", + "Drillings": null, + "Grain": 0, + "H": 10, + "L": 116.79966683283226, + "Pts": Array [ + Vector2 { + "x": 116.79966683283226, + "y": 58.39983341641607, + }, + Vector2 { + "x": 7.105427357601002e-15, + "y": 58.39983341641608, + }, + Vector2 { + "x": 116.79966683283226, + "y": 58.39983341641607, + }, + ], + "SubBoardAssoc": null, + "SubBoardLocal": Array [], + "W": 116.79966683283226, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": -1, + "y": 0, + "z": 0, + }, + "ZVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, + }, + ], + "W": 582, + "XVec": Vector3 { + "x": 0, + "y": 1, + "z": 0, + }, + "YVec": Vector3 { + "x": -1, + "y": 0, + "z": 0, + }, + "ZVec": Vector3 { + "x": 0, + "y": 0, + "z": 1, + }, +} +`;