!819 优化:取消90度直角走刀路径时的圆弧过度

pull/792/MERGE
ChenX 5 years ago
parent d8de1eff70
commit 0ce9b0c9a5

@ -49,7 +49,7 @@ test("极限刀半径", () =>
let data =
[1, "Board", 2, 1, 0, false, 7, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -657.7056127057733, -888.0170782475586, 0, 1], 0, 1, 1200, 600, 18, true, "Polyline", 2, 1, 0, false, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 4, [0, 0], 0, [600, 0], 0, [600, 1200], 0, [0, 1200], 0, true, 1, 1, 560, 310, 15, false, "Polyline", 2, 1, 0, false, 1, 0, [0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 533.9316239316239, 40.76923076923083, 0, 1], 0, 2, 8, [-269.2307692307692, -223.9316239316239], 0, [-209.23076923076923, -223.9316239316239], 0, [-209.2307692307692, -473.9316239316239], 0, [40.7692307692308, -473.9316239316239], 0, [40.76923076923081, -533.9316239316239], 0, [-519.2307692307692, -533.9316239316238], 0, [-519.2307692307692, -473.9316239316238], 0, [-269.23076923076917, -473.9316239316238], 0, true, 0, 30, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -990.7928086301262, -752.1719826564371, 0, 1], null, null, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], null, "", "{\"roomName\":\"\",\"cabinetName\":\"\",\"boardName\":\"\",\"material\":\"\",\"color\":\"\",\"lines\":0,\"bigHoleDir\":0,\"drillType\":\"three\",\"composingFace\":2,\"highSealed\":[],\"sealedUp\":\"1\",\"sealedDown\":\"1\",\"sealedLeft\":\"1\",\"sealedRight\":\"1\",\"knifeRad\":\"0\",\"grooveAddLength\":\"0\",\"grooveAddWidth\":\"0\",\"grooveAddDepth\":\"0\",\"spliteHeight\":\"\",\"spliteWidth\":\"\",\"spliteThickness\":\"\"}", 0];
let brs = LoadBoardsFromFileData(data);
testPathCount(brs[0], 4);
testPathCount(brs[0], 3);
data =
[1, "Board", 2, 1, 0, false, 7, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -663.8732094729834, -1836.8490686954794, 0, 1], 0, 1, 1200, 600, 18, true, "Polyline", 2, 1, 0, false, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 4, [0, 0], 0, [600, 0], 0, [600, 1200], 0, [0, 1200], 0, true, 1, 1, 746.2524018100552, 30, 18, false, "Polyline", 2, 1, 0, false, 2, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1480.7590848806103, 719.3699285130117, 0, 1], 0, 2, 4, [-1450.7590848806103, 26.7131494779253], 0, [-1450.7590848806103, -719.3699285130117], 0, [-1480.7590848806103, -719.3699285130117], 0, [-1480.7590848806103, 26.88247329704346], 0, true, 0, 15, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -864.4413047383622, -1532.97311226155, 0, 1], null, null, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], null, "", "{\"roomName\":\"\",\"cabinetName\":\"\",\"boardName\":\"\",\"material\":\"\",\"color\":\"\",\"lines\":0,\"bigHoleDir\":0,\"drillType\":\"three\",\"composingFace\":2,\"highSealed\":[],\"sealedUp\":\"1\",\"sealedDown\":\"1\",\"sealedLeft\":\"1\",\"sealedRight\":\"1\",\"knifeRad\":\"0\",\"grooveAddLength\":\"0\",\"grooveAddWidth\":\"0\",\"grooveAddDepth\":\"0\",\"spliteHeight\":\"\",\"spliteWidth\":\"\",\"spliteThickness\":\"\"}", 0];
brs = LoadBoardsFromFileData(data);
@ -57,7 +57,7 @@ test("极限刀半径", () =>
data =
[1, "Board", 2, 1, 0, false, 7, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -1045.5289925195948, 676.3547294712749, 0, 1], 0, 1, 1200, 600, 18, true, "Polyline", 2, 1, 0, false, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 2, 4, [0, 0], 0, [600, 0], 0, [600, 1200], 0, [0, 1200], 0, true, 1, 1, 795.8575198929175, 511.55082631160246, 20, false, "Polyline", 2, 1, 0, false, 3, 0, [0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, -119.65811965811962, 526.6267506621481, 0, 1], 0, 2, 8, [-269.2307692307692, 119.65811965811966], 0, [-269.23076923076945, 631.2089459697221], 0, [526.6267506621481, 631.2089459697221], 0, [526.6267506621481, 119.65811965811963], 0, [466.6267506621481, 119.65811965811962], 0, [466.62675066214797, 571.2089459697221], 0, [-209.2307692307695, 571.2089459697221], 0, [-209.23076923076923, 119.65811965811966], 0, true, 0, 30, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -1252.7209932983192, 706.2274154410178, 0, 1], null, null, 1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], null, "", "{\"roomName\":\"\",\"cabinetName\":\"\",\"boardName\":\"\",\"material\":\"\",\"color\":\"\",\"lines\":0,\"bigHoleDir\":0,\"drillType\":\"three\",\"composingFace\":2,\"highSealed\":[],\"sealedUp\":\"1\",\"sealedDown\":\"1\",\"sealedLeft\":\"1\",\"sealedRight\":\"1\",\"knifeRad\":\"0\",\"grooveAddLength\":\"0\",\"grooveAddWidth\":\"0\",\"grooveAddDepth\":\"0\",\"spliteHeight\":\"\",\"spliteWidth\":\"\",\"spliteThickness\":\"\"}", 0];
brs = LoadBoardsFromFileData(data);
testPathCount(brs[0], 5);
testPathCount(brs[0], 3);
data =
[1, "Board", 5, 2, 103, false, 1, 7, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -2464.8536219638777, -3019.7114880500603, 0, 1], 0, 0, 2, 1200, 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, 1200], 0, [0, 1200], 0, true, 1, 2, 400.00000000000006, 120, 18, false, "Polyline", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -229.66939762350881, -293.05345437892123, 0, 1], 0, 0, 2, 6, [229.66939762350881, 293.05345437892123], 0, [349.6693976235088, 293.05345437892123], 0, [349.6693976235088, 493.05345437892123], 0, [289.6693976235088, 493.05345437892123], 0, [289.6693976235088, 693.0534543789213], 0, [229.66939762350881, 693.0534543789213], 0, true, 0, 30, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -2757.907076342799, -2790.0420904265516, 0, 1], null, null, 0, 0, 5, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1761.6637493564908, 12.017858403159153, 0, 1], null, "", "", "", "", "", "", 0, 0, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 4, "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0];
@ -115,7 +115,7 @@ test("造型的外框和内框厚度等于刀直径", () =>
let data =
[1, "Board", 3, 2, 118, false, 1, 11, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 25702.129700607577, -1144.6658743078003, 0, 1], 2, 1200, 600, 18, true, "Polyline", 3, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 4, [0, 0], 0, [600, 0], 0, [600, 1200], 0, [0, 1200], 0, true, 1, 2, 416.58619999999996, 325.1405, 5, true, "Polyline", 3, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1187.5114150409554, -619.5823942857144, 0, 1], 2, 4, [1187.5114150409554, 619.5823942857144], 0, [1512.6519150409554, 619.5823942857144], 0, [1512.6519150409554, 1036.1685942857143], 0, [1187.5114150409554, 1036.1685942857143], 0, true, 1, 2, 404.58619999999996, 313.1405, 5, true, "Polyline", 3, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1193.5114150409554, -625.5823942857144, 0, 1], 2, 4, [1506.6519150409554, 1030.1685942857143], 0, [1193.5114150409554, 1030.1685942857143], 0, [1193.5114150409554, 625.5823942857144], 0, [1506.6519150409554, 625.5823942857144], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 25715.129700607577, -1015.7520587975966, 455.37831265306136, 1], 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 25715.129700607577, -1021.7520587975966, 449.37831265306136, 1], 3, 0, 0, 0, 2, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1686.3109561311285, 139.8723180005327, 0, 1], 1, "左侧板", "{\"roomName\":\"\",\"cabinetName\":\"\",\"boardName\":\"\",\"material\":\"\",\"color\":\"\",\"lines\":0,\"bigHoleDir\":0,\"drillType\":\"three\",\"composingFace\":2,\"highSealed\":[],\"sealedUp\":\"1\",\"sealedDown\":\"1\",\"sealedLeft\":\"1\",\"sealedRight\":\"1\",\"spliteHeight\":\"\",\"spliteWidth\":\"\",\"spliteThickness\":\"\",\"highDrill\":[\"three\",\"three\",\"three\",\"three\",\"three\",\"three\"]}", 0, 0];
let brs = LoadBoardsFromFileData(data);
testPathCount(brs[0], 7);
testPathCount(brs[0], 4);
});
test("#IYX1P", () =>
@ -123,7 +123,7 @@ test("#IYX1P", () =>
let data =
[1, "Board", 5, 2, 101, false, 1, 11, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 25627.96702118174, -1046.5797499058865, 0, 1], 0, 0, 2, 1200, 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, 1200], 0, [0, 1200], 0, true, 1, 2, 416.58619999999996, 325.1405, 5, true, "Polyline", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1187.5114150409554, -619.5823942857144, 0, 1], 0, 0, 2, 4, [1187.5114150409554, 619.5823942857144], 0, [1512.6519150409554, 619.5823942857144], 0, [1512.6519150409554, 1036.1685942857143], 0, [1187.5114150409554, 1036.1685942857143], 0, true, 1, 2, 404.58619999999996, 313.1405, 5, false, "Polyline", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1193.5114150409554, -625.5823942857144, 0, 1], 0, 0, 2, 4, [1444.8769130439057, 968.3935922886646], 0, [1193.5114150409554, 1030.1685942857143], 0, [1193.5114150409554, 625.5823942857144], 0, [1506.6519150409554, 625.5823942857144], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 25640.96702118174, -917.6659343956826, 455.37831265306136, 1], 3, 0, 0, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 25640.96702118174, -923.6659343956826, 449.37831265306136, 1], 3, 0, 0, 0, 3, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -1686.3109561311285, 160.2072462301978, 0, 1], 1, "左侧板", "", "", "", "", "", 0, 0, "three", 2, 0, "1", "1", "1", "1", "", "", "", 6, "three", "three", "three", "three", "three", "three", true, true, 0, 0];
let brs = LoadBoardsFromFileData(data);
testPathCount(brs[0], 7);
testPathCount(brs[0], 6);
});
test("极限刀半径#I11UDE", () =>
@ -131,7 +131,7 @@ test("极限刀半径#I11UDE", () =>
let data =
[1, "Board", 5, 2, 101, false, 1, 2, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -2274.8106081003034, 1049.489754699042, 0, 1], 0, 0, 2, 1500, 996.4248716877983, 18, true, "Polyline", 5, 2, 0, false, 0, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 396.42487168779826, 0, 0, 1], 0, 0, 2, 4, [-396.42487168779826, 0], 0, [600, 0], 0, [600, 1500], 0, [-396.42487168779826, 1500], 0, true, 1, 2, 613.5945382529881, 504.5731587306118, 12, false, "Polyline", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -286.0137526959925, -382.0303425189268, 0, 1], 0, 0, 2, 12, [656.1445063338533, 607.3988458450913], 0, [763.0711684959024, 607.3988458450913], 0, [763.0711684959024, 995.6248807719148], 0, [476.8367190159561, 995.6248807719148], 0, [476.8367190159561, 794.9317610216076], 0, [286.0137526959925, 794.9317610216076], 0, [286.0137526959925, 382.0303425189268], 0, [656.1445063338533, 382.0303425189268], 0, [656.1445063338533, 519.394335722528], 0, [790.5869114266043, 519.394335722528], 0, [790.5869114266043, 525.394335722528], 0, [656.1445063338533, 525.394335722528], 0, true, 1, 2, 601.5945382529881, 465.0574157999099, 12, false, "Polyline", 5, 2, 0, false, 0, 1, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -292.0137526959925, -388.0303425189268, 0, 1], 0, 0, 2, 12, [650.1445063338533, 525.394335722528], 0, [650.1445063338533, 613.3988458450913], 0, [757.0711684959024, 613.3988458450913], 0, [757.0711684959024, 989.6248807719148], 0, [482.8367190159561, 989.6248807719148], 0, [482.8367190159561, 788.9317610216076], 0, [292.0137526959925, 788.9317610216076], 0, [292.0137526959925, 388.0303425189268], 0, [650.1445063338533, 388.0303425189268], 0, [650.1445063338533, 519.394335722528], 0, [507.05781142660453, 519.394335722528], 0, [507.05781142660453, 525.394335722528], 0, true, 0, 3, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -2662.84095061923, 1341.5035073950344, 6, 1], 3, 0, 0, 0, [0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, -2656.84095061923, 1335.5035073950344, 6, 1], 3, 0, 0, 0, 5, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -2274.8106081003034, 1049.489754699042, 0, 1], 0, "底板", "主卧", "下柜", "", "", "", 0, 1, "三合一", 2, 0, "1", "1", "1", "1", "", "", "", 4, "三合一", "三合一", "三合一", "三合一", true, true, 0, 0, 0, 0, 0];
let brs = LoadBoardsFromFileData(data);
testPathCount(brs[0], 12);
testPathCount(brs[0], 5);
});
test("复杂造型01", () =>

@ -2,19 +2,17 @@
exports[`#IYX1P: 曲线长度 1`] = `3600`;
exports[`#IYX1P: 曲线长度 2`] = `1346.3292345344717`;
exports[`#IYX1P: 曲线长度 2`] = `1346.7694340038445`;
exports[`#IYX1P: 曲线长度 3`] = `8468.604267178238`;
exports[`#IYX1P: 曲线长度 3`] = `8462.397070725754`;
exports[`#IYX1P: 曲线长度 4`] = `10.71238898038469`;
exports[`#IYX1P: 曲线长度 5`] = `10.71238898038469`;
exports[`#IYX1P: 曲线长度 5`] = `1483.4533999999999`;
exports[`#IYX1P: 曲线长度 6`] = `1483.4533999999999`;
exports[`#IYX1P: 曲线长度 6`] = `1324.9044565737036`;
exports[`#IYX1P: 曲线长度 7`] = `1324.9044565737036`;
exports[`#IYX1P: 走刀数量 1`] = `4`;
exports[`#IYX1P: 走刀数量 1`] = `3`;
exports[`刀切到外轮廓情况: 曲线长度 1`] = `3600`;
@ -30,11 +28,11 @@ exports[`刀切到外轮廓情况: 曲线长度 6`] = `3600`;
exports[`刀切到外轮廓情况: 曲线长度 7`] = `14681.465974109033`;
exports[`刀切到外轮廓情况: 曲线长度 8`] = `14658.277022001026`;
exports[`刀切到外轮廓情况: 曲线长度 8`] = `14658.277022001035`;
exports[`刀切到外轮廓情况: 曲线长度 9`] = `14681.465974109033`;
exports[`刀切到外轮廓情况: 曲线长度 10`] = `14658.277022000973`;
exports[`刀切到外轮廓情况: 曲线长度 10`] = `14658.277022000966`;
exports[`刀切到外轮廓情况: 曲线长度 11`] = `2683.281572999748`;
@ -46,29 +44,25 @@ exports[`刀切到外轮廓情况: 走刀数量 2`] = `4`;
exports[`复杂极限刀半径: 曲线长度 1`] = `4356.840832388074`;
exports[`复杂极限刀半径: 曲线长度 2`] = `232.80420650475034`;
exports[`复杂极限刀半径: 曲线长度 3`] = `806.2513545258738`;
exports[`复杂极限刀半径: 曲线长度 2`] = `1073.246931353379`;
exports[`复杂极限刀半径: 曲线长度 4`] = `31170.805670163638`;
exports[`复杂极限刀半径: 曲线长度 3`] = `34218.239667713664`;
exports[`复杂极限刀半径: 曲线长度 5`] = `2917.48021978714`;
exports[`复杂极限刀半径: 曲线长度 4`] = `4434.591784188829`;
exports[`复杂极限刀半径: 曲线长度 6`] = `4434.591784188829`;
exports[`复杂极限刀半径: 曲线长度 5`] = `951.5402172137751`;
exports[`复杂极限刀半径: 曲线长度 7`] = `951.5402172137751`;
exports[`复杂极限刀半径: 曲线长度 6`] = `3278.9179349887763`;
exports[`复杂极限刀半径: 曲线长度 8`] = `3278.9179349887763`;
exports[`复杂极限刀半径: 走刀数量 1`] = `5`;
exports[`复杂极限刀半径: 走刀数量 1`] = `3`;
exports[`复杂造型01: 曲线长度 1`] = `3600`;
exports[`复杂造型01: 曲线长度 2`] = `45851.27982948799`;
exports[`复杂造型01: 曲线长度 2`] = `39413.775281964336`;
exports[`复杂造型01: 曲线长度 3`] = `9328.396540734857`;
exports[`复杂造型01: 曲线长度 3`] = `15808.94716168059`;
exports[`复杂造型01: 曲线长度 4`] = `4417.523956828297`;
exports[`复杂造型01: 曲线长度 4`] = `4413.317448318587`;
exports[`复杂造型01: 曲线长度 5`] = `1482.4552077856665`;
@ -78,13 +72,13 @@ exports[`复杂造型01: 曲线长度 7`] = `25.328937185896002`;
exports[`复杂造型01: 曲线长度 8`] = `25.328939247232213`;
exports[`复杂造型01: 曲线长度 9`] = `676.6930479102875`;
exports[`复杂造型01: 曲线长度 9`] = `676.6930479102881`;
exports[`复杂造型01: 曲线长度 10`] = `227.6085817490802`;
exports[`复杂造型01: 曲线长度 10`] = `227.60858174908054`;
exports[`复杂造型01: 曲线长度 11`] = `136.38881122495832`;
exports[`复杂造型01: 曲线长度 11`] = `80.89233579283737`;
exports[`复杂造型01: 曲线长度 12`] = `40.76338989846492`;
exports[`复杂造型01: 曲线长度 12`] = `10.104776221419284`;
exports[`复杂造型01: 曲线长度 13`] = `3.2524680966497335`;
@ -122,69 +116,65 @@ exports[`复杂造型测试: 曲线长度 5`] = `2293.076221853775`;
exports[`复杂造型测试: 曲线长度 6`] = `4096.105045378747`;
exports[`复杂造型测试: 曲线长度 7`] = `8.048633485555133`;
exports[`复杂造型测试: 曲线长度 8`] = `875.5142132396979`;
exports[`复杂造型测试: 曲线长度 7`] = `910.1341511193467`;
exports[`复杂造型测试: 曲线长度 9`] = `2841.1337227520216`;
exports[`复杂造型测试: 曲线长度 8`] = `2841.1337227520216`;
exports[`复杂造型测试: 曲线长度 10`] = `1079.2736477434978`;
exports[`复杂造型测试: 曲线长度 9`] = `1079.2736477434978`;
exports[`复杂造型测试: 曲线长度 11`] = `227.8342135021163`;
exports[`复杂造型测试: 曲线长度 10`] = `227.8342135021163`;
exports[`复杂造型测试: 曲线长度 12`] = `16.405200898113836`;
exports[`复杂造型测试: 曲线长度 11`] = `16.405200898113836`;
exports[`复杂造型测试: 曲线长度 13`] = `696.1986486992679`;
exports[`复杂造型测试: 曲线长度 12`] = `696.1986486992679`;
exports[`复杂造型测试: 曲线长度 14`] = `639.7910377879329`;
exports[`复杂造型测试: 曲线长度 13`] = `639.7910377879329`;
exports[`复杂造型测试: 曲线长度 15`] = `1715.2225461089636`;
exports[`复杂造型测试: 曲线长度 14`] = `1715.2225461089636`;
exports[`复杂造型测试: 曲线长度 16`] = `493.42887087968916`;
exports[`复杂造型测试: 曲线长度 15`] = `493.42887087968916`;
exports[`复杂造型测试: 曲线长度 17`] = `352.7973262382525`;
exports[`复杂造型测试: 曲线长度 16`] = `352.7973262382525`;
exports[`复杂造型测试: 曲线长度 18`] = `342.70973636046426`;
exports[`复杂造型测试: 曲线长度 17`] = `342.70973636046426`;
exports[`复杂造型测试: 曲线长度 19`] = `476.0989607667295`;
exports[`复杂造型测试: 曲线长度 18`] = `476.0989607667295`;
exports[`复杂造型测试: 曲线长度 20`] = `1167.5479341842502`;
exports[`复杂造型测试: 曲线长度 19`] = `1167.5479341842502`;
exports[`复杂造型测试: 曲线长度 21`] = `413.7195254587742`;
exports[`复杂造型测试: 曲线长度 20`] = `413.7195254587742`;
exports[`复杂造型测试: 曲线长度 22`] = `275.9275697576068`;
exports[`复杂造型测试: 曲线长度 21`] = `275.9275697576068`;
exports[`复杂造型测试: 曲线长度 23`] = `99.71551046503953`;
exports[`复杂造型测试: 曲线长度 22`] = `99.71551046503953`;
exports[`复杂造型测试: 曲线长度 24`] = `35.25475681965266`;
exports[`复杂造型测试: 曲线长度 23`] = `35.25475681965266`;
exports[`复杂造型测试: 曲线长度 25`] = `169.22283273433305`;
exports[`复杂造型测试: 曲线长度 24`] = `169.22283273433305`;
exports[`复杂造型测试: 曲线长度 26`] = `162.171881370416`;
exports[`复杂造型测试: 曲线长度 25`] = `162.171881370416`;
exports[`复杂造型测试: 曲线长度 27`] = `3600`;
exports[`复杂造型测试: 曲线长度 26`] = `3600`;
exports[`复杂造型测试: 曲线长度 28`] = `104483.03471871806`;
exports[`复杂造型测试: 曲线长度 27`] = `106935.16317310504`;
exports[`复杂造型测试: 曲线长度 29`] = `2279.1571138841996`;
exports[`复杂造型测试: 曲线长度 28`] = `5545.665343214347`;
exports[`复杂造型测试: 曲线长度 30`] = `5545.665343214347`;
exports[`复杂造型测试: 曲线长度 29`] = `2581.0848141151123`;
exports[`复杂造型测试: 曲线长度 31`] = `2581.0848141151123`;
exports[`复杂造型测试: 曲线长度 30`] = `463.19933816470575`;
exports[`复杂造型测试: 曲线长度 32`] = `463.19933816470575`;
exports[`复杂造型测试: 曲线长度 31`] = `713.891109728082`;
exports[`复杂造型测试: 曲线长度 33`] = `713.891109728082`;
exports[`复杂造型测试: 走刀数量 1`] = `12`;
exports[`复杂造型测试: 走刀数量 1`] = `13`;
exports[`复杂造型测试: 走刀数量 2`] = `3`;
exports[`复杂造型测试: 走刀数量 2`] = `2`;
exports[`带孔造型板件: 曲线长度 1`] = `3600`;
exports[`带孔造型板件: 曲线长度 2`] = `54662.04598627183`;
exports[`带孔造型板件: 曲线长度 2`] = `54665.25127222574`;
exports[`带孔造型板件: 曲线长度 3`] = `4678.35714568232`;
exports[`带孔造型板件: 曲线长度 3`] = `4667.086663355046`;
exports[`带孔造型板件: 曲线长度 4`] = `2195.9741153279983`;
@ -192,9 +182,9 @@ exports[`带孔造型板件: 曲线长度 5`] = `1209.6929369796912`;
exports[`带孔造型板件: 曲线长度 6`] = `3600`;
exports[`带孔造型板件: 曲线长度 7`] = `54662.04598627183`;
exports[`带孔造型板件: 曲线长度 7`] = `54665.25127222574`;
exports[`带孔造型板件: 曲线长度 8`] = `4678.35714568232`;
exports[`带孔造型板件: 曲线长度 8`] = `4667.086663355046`;
exports[`带孔造型板件: 曲线长度 9`] = `2195.9741153279983`;
@ -206,231 +196,183 @@ exports[`带孔造型板件: 走刀数量 2`] = `2`;
exports[`极限刀半径#I11UDE: 曲线长度 1`] = `4992.8497433755965`;
exports[`极限刀半径#I11UDE: 曲线长度 2`] = `2589.4683707776608`;
exports[`极限刀半径#I11UDE: 曲线长度 3`] = `10.71238898038469`;
exports[`极限刀半径#I11UDE: 曲线长度 4`] = `10.71238898038469`;
exports[`极限刀半径#I11UDE: 曲线长度 5`] = `10.71238898038469`;
exports[`极限刀半径#I11UDE: 曲线长度 2`] = `2157.303908105796`;
exports[`极限刀半径#I11UDE: 曲线长度 6`] = `10.712388980384734`;
exports[`极限刀半径#I11UDE: 曲线长度 3`] = `277.52909999999974`;
exports[`极限刀半径#I11UDE: 曲线长度 7`] = `10.71238898038408`;
exports[`极限刀半径#I11UDE: 曲线长度 4`] = `2450.188718291298`;
exports[`极限刀半径#I11UDE: 曲线长度 8`] = `10.7123889803843`;
exports[`极限刀半径#I11UDE: 曲线长度 5`] = `2419.4772979202935`;
exports[`极限刀半径#I11UDE: 曲线长度 9`] = `10.712388980384993`;
exports[`极限刀半径#I11UDE: 曲线长度 10`] = `10.71238898038469`;
exports[`极限刀半径#I11UDE: 曲线长度 11`] = `2450.188718291298`;
exports[`极限刀半径#I11UDE: 曲线长度 12`] = `2419.4772979202935`;
exports[`极限刀半径#I11UDE: 走刀数量 1`] = `9`;
exports[`极限刀半径#I11UDE: 走刀数量 1`] = `2`;
exports[`极限刀半径: 曲线长度 1`] = `3600`;
exports[`极限刀半径: 曲线长度 2`] = `267.1238898038468`;
exports[`极限刀半径: 曲线长度 2`] = `999.9999999999999`;
exports[`极限刀半径: 曲线长度 3`] = `827.1238898038469`;
exports[`极限刀半径: 曲线长度 3`] = `1740`;
exports[`极限刀半径: 曲线长度 4`] = `1740`;
exports[`极限刀半径: 曲线长度 4`] = `3600`;
exports[`极限刀半径: 曲线长度 5`] = `3600`;
exports[`极限刀半径: 曲线长度 5`] = `716.1675009811012`;
exports[`极限刀半径: 曲线长度 6`] = `716.1675009811012`;
exports[`极限刀半径: 曲线长度 6`] = `1552.335957639782`;
exports[`极限刀半径: 曲线长度 7`] = `1552.335957639782`;
exports[`极限刀半径: 曲线长度 7`] = `3600`;
exports[`极限刀半径: 曲线长度 8`] = `3600`;
exports[`极限刀半径: 曲线长度 8`] = `1638.9591725161226`;
exports[`极限刀半径: 曲线长度 9`] = `1638.9591725161224`;
exports[`极限刀半径: 曲线长度 9`] = `3517.9183450322453`;
exports[`极限刀半径: 曲线长度 10`] = `47.12388980384689`;
exports[`极限刀半径: 曲线长度 10`] = `3600`;
exports[`极限刀半径: 曲线长度 11`] = `47.12388980384689`;
exports[`极限刀半径: 曲线长度 11`] = `600`;
exports[`极限刀半径: 曲线长度 12`] = `3517.9183450322453`;
exports[`极限刀半径: 曲线长度 12`] = `1040`;
exports[`极限刀半径: 曲线长度 13`] = `3600`;
exports[`极限刀半径: 曲线长度 14`] = `617.1238898038469`;
exports[`极限刀半径: 曲线长度 15`] = `1040`;
exports[`极限刀半径: 曲线长度 16`] = `3600`;
exports[`极限刀半径: 曲线长度 17`] = `390`;
exports[`极限刀半径: 曲线长度 18`] = `23.56194490192345`;
exports[`极限刀半径: 曲线长度 14`] = `390`;
exports[`极限刀半径: 曲线长度 19`] = `900`;
exports[`极限刀半径: 曲线长度 15`] = `900`;
exports[`极限刀半径: 走刀数量 1`] = `2`;
exports[`极限刀半径: 走刀数量 1`] = `1`;
exports[`极限刀半径: 走刀数量 2`] = `1`;
exports[`极限刀半径: 走刀数量 3`] = `3`;
exports[`极限刀半径: 走刀数量 3`] = `1`;
exports[`极限刀半径: 走刀数量 4`] = `1`;
exports[`极限刀半径: 走刀数量 5`] = `2`;
exports[`极限刀半径: 走刀数量 5`] = `1`;
exports[`超级复杂造型01: 曲线长度 1`] = `5230.469840585598`;
exports[`超级复杂造型01: 曲线长度 2`] = `23310.391778382174`;
exports[`超级复杂造型01: 曲线长度 2`] = `23338.03269164334`;
exports[`超级复杂造型01: 曲线长度 3`] = `11849.91310995222`;
exports[`超级复杂造型01: 曲线长度 3`] = `11855.399792240174`;
exports[`超级复杂造型01: 曲线长度 4`] = `9.894843040787247`;
exports[`超级复杂造型01: 曲线长度 5`] = `2.686492242389678`;
exports[`超级复杂造型01: 曲线长度 5`] = `34.11040843800545`;
exports[`超级复杂造型01: 曲线长度 6`] = `15.558634753572182`;
exports[`超级复杂造型01: 曲线长度 6`] = `36.738926324214475`;
exports[`超级复杂造型01: 曲线长度 7`] = `1.5023362215203946`;
exports[`超级复杂造型01: 曲线长度 7`] = `93.09682354812655`;
exports[`超级复杂造型01: 曲线长度 8`] = `36.738926324214475`;
exports[`超级复杂造型01: 曲线长度 8`] = `3.005160240466534`;
exports[`超级复杂造型01: 曲线长度 9`] = `2.345373451530522`;
exports[`超级复杂造型01: 曲线长度 9`] = `15.558634753572182`;
exports[`超级复杂造型01: 曲线长度 10`] = `23.179252903171008`;
exports[`超级复杂造型01: 曲线长度 10`] = `1.5023362215203946`;
exports[`超级复杂造型01: 曲线长度 11`] = `34.11040843800545`;
exports[`超级复杂造型01: 曲线长度 11`] = `34.11040843800589`;
exports[`超级复杂造型01: 曲线长度 12`] = `3.00516024046907`;
exports[`超级复杂造型01: 曲线长度 12`] = `36.73892632422102`;
exports[`超级复杂造型01: 曲线长度 13`] = `3.005160240466534`;
exports[`超级复杂造型01: 曲线长度 13`] = `23.17925136224735`;
exports[`超级复杂造型01: 曲线长度 14`] = `3.0051602404694115`;
exports[`超级复杂造型01: 曲线长度 15`] = `3.0051642696018828`;
exports[`超级复杂造型01: 曲线长度 16`] = `23.17925136224735`;
exports[`超级复杂造型01: 曲线长度 16`] = `15.558634753573735`;
exports[`超级复杂造型01: 曲线长度 17`] = `2.3453734515378883`;
exports[`超级复杂造型01: 曲线长度 17`] = `1.5023362215224114`;
exports[`超级复杂造型01: 曲线长度 18`] = `36.73892632422056`;
exports[`超级复杂造型01: 曲线长度 18`] = `9.894843040789354`;
exports[`超级复杂造型01: 曲线长度 19`] = `34.11040843800589`;
exports[`超级复杂造型01: 曲线长度 19`] = `2.2726434483396147`;
exports[`超级复杂造型01: 曲线长度 20`] = `9.894843040789354`;
exports[`超级复杂造型01: 曲线长度 20`] = `23.17925136224733`;
exports[`超级复杂造型01: 曲线长度 21`] = `2.2726434483396147`;
exports[`超级复杂造型01: 曲线长度 21`] = `36.73892632421867`;
exports[`超级复杂造型01: 曲线长度 22`] = `2.6864922423941437`;
exports[`超级复杂造型01: 曲线长度 22`] = `34.110408438008804`;
exports[`超级复杂造型01: 曲线长度 23`] = `15.558634753573351`;
exports[`超级复杂造型01: 曲线长度 23`] = `3.005160240470314`;
exports[`超级复杂造型01: 曲线长度 24`] = `1.5023362215224114`;
exports[`超级复杂造型01: 曲线长度 24`] = `3.0051602404691264`;
exports[`超级复杂造型01: 曲线长度 25`] = `23.17925136224733`;
exports[`超级复杂造型01: 曲线长度 25`] = `15.558634753574319`;
exports[`超级复杂造型01: 曲线长度 26`] = `2.345373451535995`;
exports[`超级复杂造型01: 曲线长度 26`] = `1.5023362215216194`;
exports[`超级复杂造型01: 曲线长度 27`] = `36.73892632421837`;
exports[`超级复杂造型01: 曲线长度 27`] = `9.894843040786107`;
exports[`超级复杂造型01: 曲线长度 28`] = `34.110408438008804`;
exports[`超级复杂造型01: 曲线长度 28`] = `2.272644014939738`;
exports[`超级复杂造型01: 曲线长度 29`] = `3.005160240470314`;
exports[`超级复杂造型01: 曲线长度 29`] = `23.179252903170394`;
exports[`超级复杂造型01: 曲线长度 30`] = `3.0051602404691264`;
exports[`超级复杂造型01: 曲线长度 30`] = `36.73892632421504`;
exports[`超级复杂造型01: 曲线长度 31`] = `2.686492242389917`;
exports[`超级复杂造型01: 曲线长度 31`] = `34.11040843800676`;
exports[`超级复杂造型01: 曲线长度 32`] = `15.558634753574319`;
exports[`超级复杂造型01: 曲线长度 32`] = `3.0051602404685336`;
exports[`超级复杂造型01: 曲线长度 33`] = `1.5023362215216194`;
exports[`超级复杂造型01: 曲线长度 33`] = `3.0051630894960395`;
exports[`超级复杂造型01: 曲线长度 34`] = `9.894843040786107`;
exports[`超级复杂造型01: 曲线长度 34`] = `15.558634753573429`;
exports[`超级复杂造型01: 曲线长度 35`] = `2.272644014939738`;
exports[`超级复杂造型01: 曲线长度 35`] = `1.5023362215210545`;
exports[`超级复杂造型01: 曲线长度 36`] = `23.179252903170394`;
exports[`超级复杂造型01: 曲线长度 36`] = `9.894843040790184`;
exports[`超级复杂造型01: 曲线长度 37`] = `2.3453734515314206`;
exports[`超级复杂造型01: 曲线长度 37`] = `2.27264424963326`;
exports[`超级复杂造型01: 曲线长度 38`] = `36.73892632421504`;
exports[`超级复杂造型01: 曲线长度 38`] = `23.179252903170124`;
exports[`超级复杂造型01: 曲线长度 39`] = `34.11040843800676`;
exports[`超级复杂造型01: 曲线长度 39`] = `36.73892632421585`;
exports[`超级复杂造型01: 曲线长度 40`] = `3.0051602404685336`;
exports[`超级复杂造型01: 曲线长度 40`] = `34.11040843800687`;
exports[`超级复杂造型01: 曲线长度 41`] = `3.0051630894960395`;
exports[`超级复杂造型01: 曲线长度 41`] = `3.005160240469785`;
exports[`超级复杂造型01: 曲线长度 42`] = `2.6864922423866937`;
exports[`超级复杂造型01: 曲线长度 42`] = `3.005164269599573`;
exports[`超级复杂造型01: 曲线长度 43`] = `15.558634753573163`;
exports[`超级复杂造型01: 曲线长度 43`] = `15.558634753572598`;
exports[`超级复杂造型01: 曲线长度 44`] = `1.5023362215210545`;
exports[`超级复杂造型01: 曲线长度 44`] = `1.5023362215214884`;
exports[`超级复杂造型01: 曲线长度 45`] = `9.894843040790184`;
exports[`超级复杂造型01: 曲线长度 45`] = `9.894843040792889`;
exports[`超级复杂造型01: 曲线长度 46`] = `2.27264424963326`;
exports[`超级复杂造型01: 曲线长度 46`] = `2.272643448340335`;
exports[`超级复杂造型01: 曲线长度 47`] = `23.179252903170124`;
exports[`超级复杂造型01: 曲线长度 47`] = `23.17925136224723`;
exports[`超级复杂造型01: 曲线长度 48`] = `2.345373451550585`;
exports[`超级复杂造型01: 曲线长度 48`] = `34.11040843800603`;
exports[`超级复杂造型01: 曲线长度 49`] = `36.738926324216564`;
exports[`超级复杂造型01: 曲线长度 49`] = `36.73892632422722`;
exports[`超级复杂造型01: 曲线长度 50`] = `34.11040843800687`;
exports[`超级复杂造型01: 曲线长度 50`] = `3.0051602404670064`;
exports[`超级复杂造型01: 曲线长度 51`] = `3.005160240469785`;
exports[`超级复杂造型01: 曲线长度 51`] = `3.0051602404692153`;
exports[`超级复杂造型01: 曲线长度 52`] = `3.005164269599573`;
exports[`超级复杂造型01: 曲线长度 52`] = `9.894843040791566`;
exports[`超级复杂造型01: 曲线长度 53`] = `2.686492242390355`;
exports[`超级复杂造型01: 曲线长度 53`] = `2.2726440149400053`;
exports[`超级复杂造型01: 曲线长度 54`] = `15.558634753572672`;
exports[`超级复杂造型01: 曲线长度 54`] = `15.558634753570464`;
exports[`超级复杂造型01: 曲线长度 55`] = `1.5023362215214884`;
exports[`超级复杂造型01: 曲线长度 55`] = `1.5023362215189802`;
exports[`超级复杂造型01: 曲线长度 56`] = `9.894843040792889`;
exports[`超级复杂造型01: 曲线长度 56`] = `11906.411531839705`;
exports[`超级复杂造型01: 曲线长度 57`] = `2.272643448340335`;
exports[`超级复杂造型01: 曲线长度 57`] = `464.88809827474097`;
exports[`超级复杂造型01: 曲线长度 58`] = `23.17925136224723`;
exports[`超级复杂造型01: 曲线长度 58`] = `464.8880982747457`;
exports[`超级复杂造型01: 曲线长度 59`] = `2.345373451548128`;
exports[`超级复杂造型01: 曲线长度 59`] = `464.8880982747495`;
exports[`超级复杂造型01: 曲线长度 60`] = `36.73892632422722`;
exports[`超级复杂造型01: 曲线长度 60`] = `464.888098274753`;
exports[`超级复杂造型01: 曲线长度 61`] = `34.11040843800603`;
exports[`超级复杂造型01: 曲线长度 61`] = `464.88809827475325`;
exports[`超级复杂造型01: 曲线长度 62`] = `3.0051602404692153`;
exports[`超级复杂造型01: 曲线长度 62`] = `464.8880982747512`;
exports[`超级复杂造型01: 曲线长度 63`] = `3.0051602404670064`;
exports[`超级复杂造型01: 曲线长度 63`] = `9277.910642188759`;
exports[`超级复杂造型01: 曲线长度 64`] = `2.686492242390764`;
exports[`超级复杂造型01: 曲线长度 65`] = `15.558634753570397`;
exports[`超级复杂造型01: 曲线长度 66`] = `1.5023362215189802`;
exports[`超级复杂造型01: 曲线长度 67`] = `9.894843040791566`;
exports[`超级复杂造型01: 曲线长度 68`] = `2.2726440149400053`;
exports[`超级复杂造型01: 曲线长度 69`] = `11906.411531839705`;
exports[`超级复杂造型01: 曲线长度 70`] = `464.88809827474097`;
exports[`超级复杂造型01: 曲线长度 71`] = `464.8880982747457`;
exports[`超级复杂造型01: 曲线长度 72`] = `464.8880982747495`;
exports[`超级复杂造型01: 曲线长度 73`] = `464.888098274753`;
exports[`超级复杂造型01: 曲线长度 74`] = `464.88809827475325`;
exports[`超级复杂造型01: 曲线长度 75`] = `464.8880982747512`;
exports[`超级复杂造型01: 曲线长度 76`] = `9277.910642188759`;
exports[`超级复杂造型01: 走刀数量 1`] = `67`;
exports[`超级复杂造型01: 走刀数量 1`] = `54`;
exports[`通孔造型测试: 曲线长度 1`] = `3600`;
@ -446,16 +388,10 @@ exports[`造型的外框和内框厚度小于刀半径厚度: 走刀数量 1`] =
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 1`] = `3600`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 2`] = `1468.0153449019233`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 3`] = `10.71238898038469`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 4`] = `10.71238898038469`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 5`] = `10.71238898038469`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 2`] = `1459.4533999999999`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 6`] = `1483.4533999999999`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 3`] = `1483.4533999999999`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 7`] = `1435.4533999999999`;
exports[`造型的外框和内框厚度等于刀直径: 曲线长度 4`] = `1435.4533999999999`;
exports[`造型的外框和内框厚度等于刀直径: 走刀数量 1`] = `4`;
exports[`造型的外框和内框厚度等于刀直径: 走刀数量 1`] = `1`;

@ -184,7 +184,7 @@ exports[`简单图形因为点在线内算法错误导致的丢失 3`] = `7.1494
exports[`简单图形因为点在线内算法错误导致的丢失 4`] = `6.693604273021889`;
exports[`精度过高导致无法连接 1`] = `"6721.53910"`;
exports[`精度过高导致无法连接 1`] = `"6723.54629"`;
exports[`精度过高导致的曲线丢失 1`] = `1`;

@ -125,7 +125,9 @@ export class OffsetPolyline
_IsClose: boolean;
_OffsetDistSign: number;
constructor(public _Polyline: Polyline, public _OffsetDist: number, public _ToolPath = false)
constructor(public _Polyline: Polyline, public _OffsetDist: number, public _ToolPath = false,
private _OffsetDistSq = (_OffsetDist ** 2) * 2.1//对直角走刀不进行圆弧过度
)
{
}
@ -240,9 +242,10 @@ export class OffsetPolyline
{
if (iPts.length > 0 && curveNow.GetParamAtPoint(iPts[0]) > 1)
{
if (this._ToolPath)
let refP = this._Vertexs[curveResNext.index];
let distSq = iPts[0].distanceToSquared(refP);
if (this._ToolPath && distSq > this._OffsetDistSq)
{
let refP = this._Vertexs[curveResNext.index];
curveResNow.paddingCurve = [this.CreateArc(refP, sp, ep)];
this._TrimCircleContours.push(this._Circles[curveResNext.index]);
}

@ -77,7 +77,7 @@ export function OptimizeToolPath(offsetCus: Curve[], originShape: Shape, rad: nu
let dir = Math.sign(h.Curve.Area2);
if (h.Curve instanceof Circle)
dir = 1;
cantIntCur.push(...GetOffsetCurves(h.Curve, rad * dir));
cantIntCur.push(h.Curve, ...GetOffsetCurves(h.Curve, rad * dir));
}
}

Loading…
Cancel
Save