From 0deb9626858b8933e34d15246bcb70f4806f36d2 Mon Sep 17 00:00:00 2001 From: ChenX Date: Tue, 30 Jul 2019 21:28:04 +0800 Subject: [PATCH] =?UTF-8?q?!436=20=E4=BF=AE=E5=A4=8D=E5=B9=B3=E8=A1=8C?= =?UTF-8?q?=E7=BA=BF=E5=80=92=E8=A7=92,=E5=A4=9A=E6=AE=B5=E7=BA=BF?= =?UTF-8?q?=E4=B8=8E=E6=9B=B2=E7=BA=BF=E5=80=92=E8=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __test__/Fillet/ParalleLine.test.ts | 64 + .../__snapshots__/ParalleLine.test.ts.snap | 3589 +++++++++++++++++ __test__/Polyline/Fillet.test.ts | 25 + .../__snapshots__/Fillet.test.ts.snap | 6 + .../__snapshots__/offset.test.ts.snap | 80 +- __test__/Polyline/offset.test.ts | 4 +- src/Add-on/Fillet.ts | 13 +- src/Add-on/FilletUtils.ts | 157 +- src/DatabaseServices/Entity/Polyline.ts | 16 +- src/Geometry/GeUtils.ts | 7 + 10 files changed, 3873 insertions(+), 88 deletions(-) create mode 100644 __test__/Fillet/ParalleLine.test.ts create mode 100644 __test__/Fillet/__snapshots__/ParalleLine.test.ts.snap diff --git a/__test__/Fillet/ParalleLine.test.ts b/__test__/Fillet/ParalleLine.test.ts new file mode 100644 index 000000000..58f72adff --- /dev/null +++ b/__test__/Fillet/ParalleLine.test.ts @@ -0,0 +1,64 @@ +import { LoadEntityFromFileData } from "../Utils/LoadEntity.util"; +import { Line } from "../../src/DatabaseServices/Entity/Line"; +import { FilletUtils, FilletRes } from "../../src/Add-on/FilletUtils"; +import { PromptEntityResult } from "../../src/Editor/PromptResult"; +import { Entity } from "../../src/DatabaseServices/Entity/Entity"; +import { CADFiler } from "../../src/DatabaseServices/CADFiler"; + + +function expectEntity(e: Entity) +{ + let f = new CADFiler(); + e.WriteFile(f); + expect(f.Data).toMatchSnapshot(); +} + +function expectxSnapshot(fres: FilletRes) +{ + let l1 = fres.cu1 as Line; + let l2 = fres.cu2 as Line; + let arc = fres.arc; + + expect(l1.StartPoint).toMatchSnapshot(); + expect(l1.EndPoint).toMatchSnapshot(); + expect(l2.StartPoint).toMatchSnapshot(); + expect(l2.EndPoint).toMatchSnapshot(); + + expectEntity(arc); +} + +test('平行线倒角', () => +{ + + let filletUtil = new FilletUtils(); + + let d = + { "file": [26, "Line", 5, 2, 165, false, 1, 7, 0, [0, -0.9195768791852731, 0.3929101211064353, 0, 0, -0.3929101211064353, -0.9195768791852731, 0, 1, 0, 0, 0, 0, 14623.719240410923, 2429.6470638527735, 1], 0, 0, 1, [1692.670818240843, 343.04557415800707, 0], [3372.3693514346232, 2642.1329414669926, 0], "Line", 5, 2, 166, false, 1, 7, 0, [0, -0.9195768791852731, 0.3929101211064353, 0, 0, -0.3929101211064353, -0.9195768791852731, 0, 1, 0, 0, 0, 0, 14568.429154096713, 2567.433469429394, 1], 0, 0, 1, [1692.670818240843, 343.04557415800707, 0], [3372.3693514346232, 2642.1329414669926, 0], "Line", 5, 2, 163, false, 1, 7, 0, [0, 0.39291012110643525, 0.9195768791852731, 0, 0, -0.9195768791852731, 0.39291012110643525, 0, 1, 0, 0, 0, 0, 6203.497215967531, -2471.1785825859374, 1], 0, 0, 1, [1692.670818240843, 343.04557415800707, 0], [3372.3693514346232, 2642.1329414669926, 0], "Line", 5, 2, 164, false, 1, 7, 0, [0, 0.39291012110643525, 0.9195768791852731, 0, 0, -0.9195768791852731, 0.39291012110643525, 0, 1, 0, 0, 0, 0, 6341.283621544151, -2415.888496271727, 1], 0, 0, 1, [1692.670818240843, 343.04557415800707, 0], [3372.3693514346232, 2642.1329414669926, 0], "Line", 5, 2, 161, false, 1, 7, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1], 0, 0, 1, [1692.670818240843, 343.04557415800707, 0], [3372.3693514346232, 2642.1329414669926, 0], "Line", 5, 2, 162, false, 1, 7, 0, [0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 104.98115832463645, -104.98115832460257, 1], 0, 0, 1, [1692.670818240843, 343.04557415800707, 0], [3372.3693514346232, 2642.1329414669926, 0], "Line", 5, 2, 101, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [145.9330143540669, -28.708133971291886, 0], [145.9330143540669, 325.3588516746412, 0], "Line", 5, 2, 102, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [184.21052631578942, -27.511961722488138, 0], [184.21052631578942, 316.98564593301444, 0], "Line", 5, 2, 103, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [510.76555023923447, -57.41626794258377, 0], [510.76555023923447, 355.2631578947369, 0], "Line", 5, 2, 104, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [562.200956937799, 361.244019138756, 0], [562.200956937799, -130.38277511961724, 0], "Line", 5, 2, 110, false, 0, 7, 0, [0.8214737453237212, -0.5702463377732627, 0, 0, 0.5702463377732627, 0.8214737453237212, 0, 0, 0, 0, 1, 0, 1192.7055566180743, 222.97759104658724, 0, 1], 0, 0, 1, [145.93301435406704, -27.511961722488195, 0], [145.9330143540669, 325.3588516746412, 0], "Line", 5, 2, 111, false, 0, 7, 0, [0.8214737453237212, -0.5702463377732627, 0, 0, 0.5702463377732627, 0.8214737453237212, 0, 0, 0, 0, 1, 0, 1192.7055566180743, 222.97759104658724, 0, 1], 0, 0, 1, [184.21052631578942, -27.511961722488138, 0], [184.21052631578948, 325.3588516746413, 0], "Line", 5, 2, 112, false, 0, 7, 0, [0.8214737453237212, -0.5702463377732627, 0, 0, 0.5702463377732627, 0.8214737453237212, 0, 0, 0, 0, 1, 0, 1192.7055566180743, 222.97759104658724, 0, 1], 0, 0, 1, [510.7655502392346, -130.38277511961724, 0], [510.76555023923447, 355.2631578947369, 0], "Line", 5, 2, 113, false, 0, 7, 0, [0.8214737453237212, -0.5702463377732627, 0, 0, 0.5702463377732627, 0.8214737453237212, 0, 0, 0, 0, 1, 0, 1192.7055566180743, 222.97759104658724, 0, 1], 0, 0, 1, [562.2009569377991, 355.2631578947369, 0], [562.200956937799, -130.38277511961724, 0], "Line", 5, 2, 134, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [2647.8208243286344, 317.92433298415114, 0], [3169.8822406013596, 317.92433298415114, 0], "Line", 5, 2, 135, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [2722.4010266533096, 227.5240877421207, 0], [3337.122694299116, 227.5240877421207, 0], "Line", 5, 2, 149, false, 1, 7, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1], 0, 0, 1, [2907.9548191037384, 493.8714486099474, 0], [2907.9548191037384, 1488.0701817589372, 0], "Line", 5, 2, 150, false, 1, 7, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1], 0, 0, 1, [3024.1598658354383, 1494.526017688476, 0], [3024.1598658354383, 355.0709761248611, 0], "Line", 5, 2, 153, false, 1, 7, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1], 0, 0, 1, [3705.2505564017906, 280.8288629351637, 0], [3705.2505564017906, 1568.7681308781732, 0], "Line", 5, 2, 154, false, 1, 7, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1], 0, 0, 1, [3869.8743726050325, 287.28469886470253, 0], [3869.8743726050325, 1546.1727051247872, 0], "Line", 5, 2, 157, false, 1, 7, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1], 0, 0, 1, [5086.799445323114, 468.04810489179147, 0], [5086.799445323114, 1820.5457321301901, 0], "Line", 5, 2, 158, false, 1, 7, 0, [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1], 0, 0, 1, [5190.092820195736, 1865.7365836369625, 0], [5190.092820195736, 225.95425753408313, 0], "Line", 5, 2, 136, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [4345.085428747755, 295.3242716736435, 0], [4776.746599778449, 295.3242716736435, 0], "Line", 5, 2, 137, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 1, [5095.4074642566065, 191.36398964530858, 0], [4220.785091539963, 191.36398964530858, 0], "Line", 5, 2, 167, false, 1, 7, 0, [0, -1, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 1], 0, 0, 1, [8996.91886327466, -984.963632541074, 0], [12643.991371767113, 5415.060382361811, 0], "Line", 5, 2, 168, false, 1, 7, 0, [0, -1, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, -447.06050104057067, -447.06050104171936, 1], 0, 0, 1, [8996.91886327466, -984.963632541074, 0], [12643.991371767113, 5415.060382361811, 0]], "basePt": { "x": 0, "y": -13091.051872807684, "z": -1432.0241335827934 } } + + let lines = LoadEntityFromFileData(d) as Line[]; + + for (let i = 0; i < lines.length / 2; i++) + { + let l1 = lines[i * 2]; + let l2 = lines[i * 2 + 1]; + + let e1 = new PromptEntityResult(l1, l1.StartPoint); + let e2 = new PromptEntityResult(l2, l2.StartPoint); + + let fres = filletUtil.Fillet(e1, e2); + expectxSnapshot(fres); + + e1.Point = l1.EndPoint; + fres = filletUtil.Fillet(e1, e2); + expectxSnapshot(fres); + + e1 = new PromptEntityResult(l2, l2.StartPoint); + e2 = new PromptEntityResult(l1, l1.StartPoint); + fres = filletUtil.Fillet(e1, e2); + expectxSnapshot(fres); + + e1.Point = l2.EndPoint; + fres = filletUtil.Fillet(e1, e2); + expectxSnapshot(fres); + } +}); diff --git a/__test__/Fillet/__snapshots__/ParalleLine.test.ts.snap b/__test__/Fillet/__snapshots__/ParalleLine.test.ts.snap new file mode 100644 index 000000000..b09d8b8c7 --- /dev/null +++ b/__test__/Fillet/__snapshots__/ParalleLine.test.ts.snap @@ -0,0 +1,3589 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`平行线倒角 1`] = ` +Vector3 { + "x": 0, + "y": 12932.392213797577, + "z": 2779.2577815385716, +} +`; + +exports[`平行线倒角 2`] = ` +Vector3 { + "x": 0, + "y": 10484.44558274751, + "z": 1325.0407494337594, +} +`; + +exports[`平行线倒角 3`] = ` +Vector3 { + "x": 0, + "y": 12857.468238434572, + "z": 2905.380560343655, +} +`; + +exports[`平行线倒角 4`] = ` +Vector3 { + "x": 0, + "y": 10429.1554964333, + "z": 1462.8271550103798, +} +`; + +exports[`平行线倒角 5`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + 1, + 0, + 0, + -0, + -0, + -1, + 0, + -1, + 0, + 0, + 0, + 0, + 12894.930226116076, + 2842.319170941113, + 1, + ], + 0, + 0, + 2, + 73.34943322499446, + 1.0347589842802478, + 4.176351637870041, + true, +] +`; + +exports[`平行线倒角 6`] = ` +Vector3 { + "x": 0, + "y": 12932.392213797577, + "z": 2779.2577815385716, +} +`; + +exports[`平行线倒角 7`] = ` +Vector3 { + "x": 0, + "y": 10484.44558274751, + "z": 1325.0407494337594, +} +`; + +exports[`平行线倒角 8`] = ` +Vector3 { + "x": 0, + "y": 12877.102127483367, + "z": 2917.044187115192, +} +`; + +exports[`平行线倒角 9`] = ` +Vector3 { + "x": 0, + "y": 10409.521607384508, + "z": 1451.1635282388422, +} +`; + +exports[`平行线倒角 10`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + 1, + 0, + 0, + -0, + -0, + -1, + 0, + -1, + 0, + 0, + 0, + 0, + 10446.983595066009, + 1388.102138836301, + 1, + ], + 0, + 0, + 2, + 73.34943322499456, + 1.0347589842802496, + 4.176351637870041, + false, +] +`; + +exports[`平行线倒角 11`] = ` +Vector3 { + "x": 0, + "y": 12877.102127483367, + "z": 2917.044187115192, +} +`; + +exports[`平行线倒角 12`] = ` +Vector3 { + "x": 0, + "y": 10429.1554964333, + "z": 1462.8271550103798, +} +`; + +exports[`平行线倒角 13`] = ` +Vector3 { + "x": 0, + "y": 12952.02610284637, + "z": 2790.921408310108, +} +`; + +exports[`平行线倒角 14`] = ` +Vector3 { + "x": 0, + "y": 10484.44558274751, + "z": 1325.0407494337594, +} +`; + +exports[`平行线倒角 15`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + -1, + 0, + 0, + -0, + -0, + -1, + 0, + 1, + 0, + 0, + 0, + 0, + 12914.564115164869, + 2853.9827977126506, + 1, + ], + 0, + 0, + 2, + 73.34943322499446, + 5.248426322899339, + 2.1068336693095455, + true, +] +`; + +exports[`平行线倒角 16`] = ` +Vector3 { + "x": 0, + "y": 12877.102127483367, + "z": 2917.044187115192, +} +`; + +exports[`平行线倒角 17`] = ` +Vector3 { + "x": 0, + "y": 10429.1554964333, + "z": 1462.8271550103798, +} +`; + +exports[`平行线倒角 18`] = ` +Vector3 { + "x": 0, + "y": 12932.392213797577, + "z": 2779.2577815385716, +} +`; + +exports[`平行线倒角 19`] = ` +Vector3 { + "x": 0, + "y": 10504.079471796305, + "z": 1336.7043762052947, +} +`; + +exports[`平行线倒角 20`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + -1, + 0, + 0, + -0, + -0, + -1, + 0, + 1, + 0, + 0, + 0, + 0, + 10466.617484114802, + 1399.7657656078384, + 1, + ], + 0, + 0, + 2, + 73.34943322499446, + 5.248426322899339, + 2.1068336693095455, + false, +] +`; + +exports[`平行线倒角 21`] = ` +Vector3 { + "x": 0, + "y": 6553.1079336533285, + "z": -779.8515559725913, +} +`; + +exports[`平行线倒角 22`] = ` +Vector3 { + "x": 0, + "y": 5098.890901548517, + "z": 1668.095075077475, +} +`; + +exports[`平行线倒角 23`] = ` +Vector3 { + "x": 0, + "y": 6679.230712458412, + "z": -704.9275806095884, +} +`; + +exports[`平行线倒角 24`] = ` +Vector3 { + "x": 0, + "y": 5236.677307125137, + "z": 1723.3851613916854, +} +`; + +exports[`平行线倒角 25`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + 1, + 0, + 0, + -0, + -0, + -1, + 0, + -1, + 0, + 0, + 0, + 0, + 6616.16932305587, + -742.3895682910902, + 1, + ], + 0, + 0, + 2, + 73.34943322499475, + 2.6055553110751504, + 5.747147964664942, + true, +] +`; + +exports[`平行线倒角 26`] = ` +Vector3 { + "x": 0, + "y": 6553.1079336533285, + "z": -779.8515559725913, +} +`; + +exports[`平行线倒角 27`] = ` +Vector3 { + "x": 0, + "y": 5098.890901548517, + "z": 1668.095075077475, +} +`; + +exports[`平行线倒角 28`] = ` +Vector3 { + "x": 0, + "y": 6690.894339229949, + "z": -724.5614696583809, +} +`; + +exports[`平行线倒角 29`] = ` +Vector3 { + "x": 0, + "y": 5225.013680353601, + "z": 1743.0190504404786, +} +`; + +exports[`平行线倒角 30`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + 1, + 0, + 0, + -0, + -0, + -1, + 0, + -1, + 0, + 0, + 0, + 0, + 5161.952290951059, + 1705.5570627589764, + 1, + ], + 0, + 0, + 2, + 73.34943322499473, + 2.6055553110751504, + 5.7471479646649435, + false, +] +`; + +exports[`平行线倒角 31`] = ` +Vector3 { + "x": 0, + "y": 6690.894339229949, + "z": -724.5614696583809, +} +`; + +exports[`平行线倒角 32`] = ` +Vector3 { + "x": 0, + "y": 5236.677307125137, + "z": 1723.3851613916854, +} +`; + +exports[`平行线倒角 33`] = ` +Vector3 { + "x": 0, + "y": 6564.771560424866, + "z": -799.4854450213827, +} +`; + +exports[`平行线倒角 34`] = ` +Vector3 { + "x": 0, + "y": 5098.890901548517, + "z": 1668.095075077475, +} +`; + +exports[`平行线倒角 35`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + -1, + 0, + 0, + -0, + -0, + -1, + 0, + 1, + 0, + 0, + 0, + 0, + 6627.832949827407, + -762.023457339882, + 1, + ], + 0, + 0, + 2, + 73.34943322499475, + 3.6776299961044363, + 0.5360373425146449, + true, +] +`; + +exports[`平行线倒角 36`] = ` +Vector3 { + "x": 0, + "y": 6690.894339229949, + "z": -724.5614696583809, +} +`; + +exports[`平行线倒角 37`] = ` +Vector3 { + "x": 0, + "y": 5236.677307125137, + "z": 1723.3851613916854, +} +`; + +exports[`平行线倒角 38`] = ` +Vector3 { + "x": 0, + "y": 6553.1079336533285, + "z": -779.8515559725913, +} +`; + +exports[`平行线倒角 39`] = ` +Vector3 { + "x": 0, + "y": 5110.5545283200545, + "z": 1648.4611860286836, +} +`; + +exports[`平行线倒角 40`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + -1, + 0, + 0, + -0, + -0, + -1, + 0, + 1, + 0, + 0, + 0, + 0, + 5173.615917722596, + 1685.9231737101843, + 1, + ], + 0, + 0, + 2, + 73.34943322499446, + 3.677629996104445, + 0.5360373425146466, + false, +] +`; + +exports[`平行线倒角 41`] = ` +Vector3 { + "x": 0, + "y": 1692.670818240843, + "z": 343.04557415800707, +} +`; + +exports[`平行线倒角 42`] = ` +Vector3 { + "x": 0, + "y": 3372.3693514346232, + "z": 2642.1329414669926, +} +`; + +exports[`平行线倒角 43`] = ` +Vector3 { + "x": 0, + "y": 1811.1240899758923, + "z": 256.50437106390706, +} +`; + +exports[`平行线倒角 44`] = ` +Vector3 { + "x": 0, + "y": 3477.3505097592597, + "z": 2537.15178314239, +} +`; + +exports[`平行线倒角 45`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + 1, + 0, + 0, + -0, + -0, + -1, + 0, + -1, + 0, + 0, + 0, + 0, + 1751.8974541083676, + 299.7749726109571, + 1, + ], + 0, + 0, + 2, + 73.34943322499451, + 3.7725575459849106, + 0.6309648923951185, + true, +] +`; + +exports[`平行线倒角 46`] = ` +Vector3 { + "x": 0, + "y": 1692.670818240843, + "z": 343.04557415800707, +} +`; + +exports[`平行线倒角 47`] = ` +Vector3 { + "x": 0, + "y": 3372.3693514346232, + "z": 2642.1329414669926, +} +`; + +exports[`平行线倒角 48`] = ` +Vector3 { + "x": 0, + "y": 1797.6519765654793, + "z": 238.0644158334045, +} +`; + +exports[`平行线倒角 49`] = ` +Vector3 { + "x": 0, + "y": 3490.8226231696726, + "z": 2555.591738372892, +} +`; + +exports[`平行线倒角 50`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + 1, + 0, + 0, + -0, + -0, + -1, + 0, + -1, + 0, + 0, + 0, + 0, + 3431.595987302148, + 2598.8623399199423, + 1, + ], + 0, + 0, + 2, + 73.3494332249947, + 3.772557545984914, + 0.6309648923951212, + false, +] +`; + +exports[`平行线倒角 51`] = ` +Vector3 { + "x": 0, + "y": 1797.6519765654793, + "z": 238.0644158334045, +} +`; + +exports[`平行线倒角 52`] = ` +Vector3 { + "x": 0, + "y": 3477.3505097592597, + "z": 2537.15178314239, +} +`; + +exports[`平行线倒角 53`] = ` +Vector3 { + "x": 0, + "y": 1679.19870483043, + "z": 324.6056189275045, +} +`; + +exports[`平行线倒角 54`] = ` +Vector3 { + "x": 0, + "y": 3372.3693514346232, + "z": 2642.1329414669926, +} +`; + +exports[`平行线倒角 55`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + -1, + 0, + 0, + -0, + -0, + -1, + 0, + 1, + 0, + 0, + 0, + 0, + 1738.4253406979547, + 281.3350173804545, + 1, + ], + 0, + 0, + 2, + 73.34943322499451, + 2.510627761194676, + 5.652220414784468, + true, +] +`; + +exports[`平行线倒角 56`] = ` +Vector3 { + "x": 0, + "y": 1797.6519765654793, + "z": 238.0644158334045, +} +`; + +exports[`平行线倒角 57`] = ` +Vector3 { + "x": 0, + "y": 3477.3505097592597, + "z": 2537.15178314239, +} +`; + +exports[`平行线倒角 58`] = ` +Vector3 { + "x": 0, + "y": 1692.670818240843, + "z": 343.04557415800707, +} +`; + +exports[`平行线倒角 59`] = ` +Vector3 { + "x": 0, + "y": 3358.8972380242103, + "z": 2623.69298623649, +} +`; + +exports[`平行线倒角 60`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + -1, + 0, + 0, + -0, + -0, + -1, + 0, + 1, + 0, + 0, + 0, + 0, + 3418.123873891735, + 2580.42238468944, + 1, + ], + 0, + 0, + 2, + 73.34943322499456, + 2.510627761194672, + 5.65222041478447, + false, +] +`; + +exports[`平行线倒角 61`] = ` +Vector3 { + "x": 145.9330143540669, + "y": -28.708133971291886, + "z": 0, +} +`; + +exports[`平行线倒角 62`] = ` +Vector3 { + "x": 145.9330143540669, + "y": 325.3588516746412, + "z": 0, +} +`; + +exports[`平行线倒角 63`] = ` +Vector3 { + "x": 184.21052631578942, + "y": -28.708133971291886, + "z": 0, +} +`; + +exports[`平行线倒角 64`] = ` +Vector3 { + "x": 184.21052631578942, + "y": 316.98564593301444, + "z": 0, +} +`; + +exports[`平行线倒角 65`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 165.07177033492815, + -28.708133971291886, + 0, + 1, + ], + 0, + 0, + 2, + 19.138755980861262, + 3.141592653589793, + 0, + true, +] +`; + +exports[`平行线倒角 66`] = ` +Vector3 { + "x": 145.9330143540669, + "y": -28.708133971291886, + "z": 0, +} +`; + +exports[`平行线倒角 67`] = ` +Vector3 { + "x": 145.9330143540669, + "y": 325.3588516746412, + "z": 0, +} +`; + +exports[`平行线倒角 68`] = ` +Vector3 { + "x": 184.21052631578942, + "y": -27.511961722488138, + "z": 0, +} +`; + +exports[`平行线倒角 69`] = ` +Vector3 { + "x": 184.21052631578942, + "y": 325.3588516746412, + "z": 0, +} +`; + +exports[`平行线倒角 70`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 165.07177033492815, + 325.3588516746412, + 0, + 1, + ], + 0, + 0, + 2, + 19.138755980861262, + 3.141592653589793, + 0, + false, +] +`; + +exports[`平行线倒角 71`] = ` +Vector3 { + "x": 184.21052631578942, + "y": -27.511961722488138, + "z": 0, +} +`; + +exports[`平行线倒角 72`] = ` +Vector3 { + "x": 184.21052631578942, + "y": 316.98564593301444, + "z": 0, +} +`; + +exports[`平行线倒角 73`] = ` +Vector3 { + "x": 145.9330143540669, + "y": -27.511961722488138, + "z": 0, +} +`; + +exports[`平行线倒角 74`] = ` +Vector3 { + "x": 145.9330143540669, + "y": 325.3588516746412, + "z": 0, +} +`; + +exports[`平行线倒角 75`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + -1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + 1, + 0, + 165.07177033492815, + -27.511961722488138, + 0, + 1, + ], + 0, + 0, + 2, + 19.138755980861262, + 3.141592653589793, + 0, + true, +] +`; + +exports[`平行线倒角 76`] = ` +Vector3 { + "x": 184.21052631578942, + "y": -27.511961722488138, + "z": 0, +} +`; + +exports[`平行线倒角 77`] = ` +Vector3 { + "x": 184.21052631578942, + "y": 316.98564593301444, + "z": 0, +} +`; + +exports[`平行线倒角 78`] = ` +Vector3 { + "x": 145.9330143540669, + "y": -28.708133971291886, + "z": 0, +} +`; + +exports[`平行线倒角 79`] = ` +Vector3 { + "x": 145.9330143540669, + "y": 316.98564593301444, + "z": 0, +} +`; + +exports[`平行线倒角 80`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + -1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + 1, + 0, + 165.07177033492815, + 316.98564593301444, + 0, + 1, + ], + 0, + 0, + 2, + 19.138755980861262, + 3.141592653589793, + 0, + false, +] +`; + +exports[`平行线倒角 81`] = ` +Vector3 { + "x": 510.76555023923447, + "y": -57.41626794258377, + "z": 0, +} +`; + +exports[`平行线倒角 82`] = ` +Vector3 { + "x": 510.76555023923447, + "y": 355.2631578947369, + "z": 0, +} +`; + +exports[`平行线倒角 83`] = ` +Vector3 { + "x": 562.200956937799, + "y": 361.244019138756, + "z": 0, +} +`; + +exports[`平行线倒角 84`] = ` +Vector3 { + "x": 562.200956937799, + "y": -57.41626794258377, + "z": 0, +} +`; + +exports[`平行线倒角 85`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 536.4832535885167, + -57.41626794258377, + 0, + 1, + ], + 0, + 0, + 2, + 25.71770334928226, + 3.141592653589793, + 0, + true, +] +`; + +exports[`平行线倒角 86`] = ` +Vector3 { + "x": 510.76555023923447, + "y": -57.41626794258377, + "z": 0, +} +`; + +exports[`平行线倒角 87`] = ` +Vector3 { + "x": 510.76555023923447, + "y": 355.2631578947369, + "z": 0, +} +`; + +exports[`平行线倒角 88`] = ` +Vector3 { + "x": 562.200956937799, + "y": 355.2631578947369, + "z": 0, +} +`; + +exports[`平行线倒角 89`] = ` +Vector3 { + "x": 562.200956937799, + "y": -130.38277511961724, + "z": 0, +} +`; + +exports[`平行线倒角 90`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 536.4832535885167, + 355.2631578947369, + 0, + 1, + ], + 0, + 0, + 2, + 25.71770334928226, + 3.141592653589793, + 0, + false, +] +`; + +exports[`平行线倒角 91`] = ` +Vector3 { + "x": 562.200956937799, + "y": 361.244019138756, + "z": 0, +} +`; + +exports[`平行线倒角 92`] = ` +Vector3 { + "x": 562.200956937799, + "y": -130.38277511961724, + "z": 0, +} +`; + +exports[`平行线倒角 93`] = ` +Vector3 { + "x": 510.76555023923447, + "y": -57.41626794258377, + "z": 0, +} +`; + +exports[`平行线倒角 94`] = ` +Vector3 { + "x": 510.76555023923447, + "y": 361.244019138756, + "z": 0, +} +`; + +exports[`平行线倒角 95`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 536.4832535885167, + 361.244019138756, + 0, + 1, + ], + 0, + 0, + 2, + 25.71770334928226, + 0, + 3.141592653589793, + true, +] +`; + +exports[`平行线倒角 96`] = ` +Vector3 { + "x": 562.200956937799, + "y": 361.244019138756, + "z": 0, +} +`; + +exports[`平行线倒角 97`] = ` +Vector3 { + "x": 562.200956937799, + "y": -130.38277511961724, + "z": 0, +} +`; + +exports[`平行线倒角 98`] = ` +Vector3 { + "x": 510.76555023923447, + "y": -130.38277511961724, + "z": 0, +} +`; + +exports[`平行线倒角 99`] = ` +Vector3 { + "x": 510.76555023923447, + "y": 355.2631578947369, + "z": 0, +} +`; + +exports[`平行线倒角 100`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 536.4832535885167, + -130.38277511961724, + 0, + 1, + ], + 0, + 0, + 2, + 25.71770334928226, + 0, + 3.141592653589793, + false, +] +`; + +exports[`平行线倒角 101`] = ` +Vector3 { + "x": 1296.897101068683, + "y": 117.1594698135923, + "z": 0, +} +`; + +exports[`平行线倒角 102`] = ` +Vector3 { + "x": 1498.1203901154684, + "y": 407.0335785103602, + "z": 0, +} +`; + +exports[`平行线倒角 103`] = ` +Vector3 { + "x": 1328.3410721815526, + "y": 95.33185879834795, + "z": 0, +} +`; + +exports[`平行线倒角 104`] = ` +Vector3 { + "x": 1529.5643612283382, + "y": 385.2059674951157, + "z": 0, +} +`; + +exports[`平行线倒角 105`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 1312.6190866251177, + 106.24566430597008, + 0, + 1, + ], + 0, + 0, + 2, + 19.138755980861163, + 3.7483983505742517, + 0.6068056969844513, + true, +] +`; + +exports[`平行线倒角 106`] = ` +Vector3 { + "x": 1296.897101068683, + "y": 117.1594698135923, + "z": 0, +} +`; + +exports[`平行线倒角 107`] = ` +Vector3 { + "x": 1498.1203901154684, + "y": 407.0335785103602, + "z": 0, +} +`; + +exports[`平行线倒角 108`] = ` +Vector3 { + "x": 1328.3410721815526, + "y": 95.3318587983479, + "z": 0, +} +`; + +exports[`平行线倒角 109`] = ` +Vector3 { + "x": 1529.564361228338, + "y": 385.20596749511566, + "z": 0, +} +`; + +exports[`平行线倒角 110`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 1513.842375671903, + 396.11977300273793, + 0, + 1, + ], + 0, + 0, + 2, + 19.138755980861216, + 3.748398350574254, + 0.6068056969844566, + false, +] +`; + +exports[`平行线倒角 111`] = ` +Vector3 { + "x": 1328.3410721815526, + "y": 95.3318587983479, + "z": 0, +} +`; + +exports[`平行线倒角 112`] = ` +Vector3 { + "x": 1529.5643612283382, + "y": 385.2059674951157, + "z": 0, +} +`; + +exports[`平行线倒角 113`] = ` +Vector3 { + "x": 1296.897101068683, + "y": 117.1594698135922, + "z": 0, +} +`; + +exports[`平行线倒角 114`] = ` +Vector3 { + "x": 1498.1203901154684, + "y": 407.0335785103602, + "z": 0, +} +`; + +exports[`平行线倒角 115`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + -1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + 1, + 0, + 1312.6190866251177, + 106.2456643059701, + 0, + 1, + ], + 0, + 0, + 2, + 19.13875598086116, + 2.534786956605342, + 5.676379610195128, + true, +] +`; + +exports[`平行线倒角 116`] = ` +Vector3 { + "x": 1328.3410721815526, + "y": 95.3318587983479, + "z": 0, +} +`; + +exports[`平行线倒角 117`] = ` +Vector3 { + "x": 1529.5643612283382, + "y": 385.2059674951157, + "z": 0, +} +`; + +exports[`平行线倒角 118`] = ` +Vector3 { + "x": 1296.897101068683, + "y": 117.1594698135923, + "z": 0, +} +`; + +exports[`平行线倒角 119`] = ` +Vector3 { + "x": 1498.1203901154684, + "y": 407.03357851036026, + "z": 0, +} +`; + +exports[`平行线倒角 120`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + -1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + 1, + 0, + 1513.8423756719033, + 396.119773002738, + 0, + 1, + ], + 0, + 0, + 2, + 19.138755980861294, + 2.5347869566053394, + 5.676379610195132, + false, +] +`; + +exports[`平行线倒角 121`] = ` +Vector3 { + "x": 1537.9357461347531, + "y": -175.3906200412942, + "z": 0, +} +`; + +exports[`平行线倒角 122`] = ` +Vector3 { + "x": 1814.8735608906677, + "y": 223.5547634532404, + "z": 0, +} +`; + +exports[`平行线倒角 123`] = ` +Vector3 { + "x": 1857.1263970735863, + "y": 194.22391115150555, + "z": 0, +} +`; + +exports[`平行线倒角 124`] = ` +Vector3 { + "x": 1580.1885823176715, + "y": -204.72147234302884, + "z": 0, +} +`; + +exports[`平行线倒角 125`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 1559.0621642262122, + -190.05604619216146, + 0, + 1, + ], + 0, + 0, + 2, + 25.71770334928209, + 3.7483983505742495, + 0.6068056969844513, + true, +] +`; + +exports[`平行线倒角 126`] = ` +Vector3 { + "x": 1537.9357461347531, + "y": -175.3906200412942, + "z": 0, +} +`; + +exports[`平行线倒角 127`] = ` +Vector3 { + "x": 1814.8735608906677, + "y": 223.5547634532404, + "z": 0, +} +`; + +exports[`平行线倒角 128`] = ` +Vector3 { + "x": 1857.1263970735863, + "y": 194.22391115150555, + "z": 0, +} +`; + +exports[`平行线倒角 129`] = ` +Vector3 { + "x": 1580.1885823176715, + "y": -204.7214723430289, + "z": 0, +} +`; + +exports[`平行线倒角 130`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 1835.999978982127, + 208.889337302373, + 0, + 1, + ], + 0, + 0, + 2, + 25.717703349282267, + 3.7483983505742486, + 0.6068056969844557, + false, +] +`; + +exports[`平行线倒角 131`] = ` +Vector3 { + "x": 1857.1263970735863, + "y": 194.22391115150555, + "z": 0, +} +`; + +exports[`平行线倒角 132`] = ` +Vector3 { + "x": 1580.1885823176715, + "y": -204.7214723430289, + "z": 0, +} +`; + +exports[`平行线倒角 133`] = ` +Vector3 { + "x": 1537.9357461347531, + "y": -175.3906200412942, + "z": 0, +} +`; + +exports[`平行线倒角 134`] = ` +Vector3 { + "x": 1814.8735608906677, + "y": 223.55476345324013, + "z": 0, +} +`; + +exports[`平行线倒角 135`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 1835.999978982127, + 208.8893373023729, + 0, + 1, + ], + 0, + 0, + 2, + 25.717703349282235, + 0.606805696984454, + 3.748398350574247, + true, +] +`; + +exports[`平行线倒角 136`] = ` +Vector3 { + "x": 1857.1263970735863, + "y": 194.22391115150555, + "z": 0, +} +`; + +exports[`平行线倒角 137`] = ` +Vector3 { + "x": 1580.1885823176715, + "y": -204.7214723430289, + "z": 0, +} +`; + +exports[`平行线倒角 138`] = ` +Vector3 { + "x": 1537.9357461347531, + "y": -175.3906200412942, + "z": 0, +} +`; + +exports[`平行线倒角 139`] = ` +Vector3 { + "x": 1814.8735608906677, + "y": 223.5547634532404, + "z": 0, +} +`; + +exports[`平行线倒角 140`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 1559.0621642262122, + -190.0560461921616, + 0, + 1, + ], + 0, + 0, + 2, + 25.717703349282118, + 0.6068056969844523, + 3.7483983505742513, + false, +] +`; + +exports[`平行线倒角 141`] = ` +Vector3 { + "x": 2647.8208243286344, + "y": 317.92433298415114, + "z": 0, +} +`; + +exports[`平行线倒角 142`] = ` +Vector3 { + "x": 3169.8822406013596, + "y": 317.92433298415114, + "z": 0, +} +`; + +exports[`平行线倒角 143`] = ` +Vector3 { + "x": 2647.8208243286344, + "y": 227.5240877421207, + "z": 0, +} +`; + +exports[`平行线倒角 144`] = ` +Vector3 { + "x": 3337.122694299116, + "y": 227.5240877421207, + "z": 0, +} +`; + +exports[`平行线倒角 145`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 2647.8208243286344, + 272.7242103631359, + 0, + 1, + ], + 0, + 0, + 2, + 45.20012262101521, + 4.71238898038469, + 1.570796326794897, + true, +] +`; + +exports[`平行线倒角 146`] = ` +Vector3 { + "x": 2647.8208243286344, + "y": 317.92433298415114, + "z": 0, +} +`; + +exports[`平行线倒角 147`] = ` +Vector3 { + "x": 3169.8822406013596, + "y": 317.92433298415114, + "z": 0, +} +`; + +exports[`平行线倒角 148`] = ` +Vector3 { + "x": 2722.4010266533096, + "y": 227.5240877421207, + "z": 0, +} +`; + +exports[`平行线倒角 149`] = ` +Vector3 { + "x": 3169.8822406013596, + "y": 227.5240877421207, + "z": 0, +} +`; + +exports[`平行线倒角 150`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 3169.8822406013596, + 272.7242103631359, + 0, + 1, + ], + 0, + 0, + 2, + 45.20012262101521, + 4.71238898038469, + 1.570796326794897, + false, +] +`; + +exports[`平行线倒角 151`] = ` +Vector3 { + "x": 2722.4010266533096, + "y": 227.5240877421207, + "z": 0, +} +`; + +exports[`平行线倒角 152`] = ` +Vector3 { + "x": 3337.122694299116, + "y": 227.5240877421207, + "z": 0, +} +`; + +exports[`平行线倒角 153`] = ` +Vector3 { + "x": 2722.4010266533096, + "y": 317.92433298415114, + "z": 0, +} +`; + +exports[`平行线倒角 154`] = ` +Vector3 { + "x": 3169.8822406013596, + "y": 317.92433298415114, + "z": 0, +} +`; + +exports[`平行线倒角 155`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + -0.9999999999999999, + 0, + 0, + 0, + -0, + -0.9999999999999998, + -0, + 0, + 0, + 0, + 0.9999999999999999, + 0, + 2722.4010266533096, + 272.7242103631359, + 0, + 1, + ], + 0, + 0, + 2, + 45.20012262101521, + 1.570796326794897, + 4.71238898038469, + true, +] +`; + +exports[`平行线倒角 156`] = ` +Vector3 { + "x": 2722.4010266533096, + "y": 227.5240877421207, + "z": 0, +} +`; + +exports[`平行线倒角 157`] = ` +Vector3 { + "x": 3337.122694299116, + "y": 227.5240877421207, + "z": 0, +} +`; + +exports[`平行线倒角 158`] = ` +Vector3 { + "x": 2647.8208243286344, + "y": 317.92433298415114, + "z": 0, +} +`; + +exports[`平行线倒角 159`] = ` +Vector3 { + "x": 3337.122694299116, + "y": 317.92433298415114, + "z": 0, +} +`; + +exports[`平行线倒角 160`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + -0.9999999999999999, + 0, + 0, + 0, + -0, + -0.9999999999999998, + -0, + 0, + 0, + 0, + 0.9999999999999999, + 0, + 3337.122694299116, + 272.7242103631359, + 0, + 1, + ], + 0, + 0, + 2, + 45.20012262101521, + 1.570796326794897, + 4.71238898038469, + false, +] +`; + +exports[`平行线倒角 161`] = ` +Vector3 { + "x": 2907.9548191037384, + "y": 0, + "z": 493.8714486099474, +} +`; + +exports[`平行线倒角 162`] = ` +Vector3 { + "x": 2907.9548191037384, + "y": 0, + "z": 1488.0701817589372, +} +`; + +exports[`平行线倒角 163`] = ` +Vector3 { + "x": 3024.1598658354383, + "y": 0, + "z": 1494.526017688476, +} +`; + +exports[`平行线倒角 164`] = ` +Vector3 { + "x": 3024.1598658354383, + "y": 0, + "z": 493.8714486099474, +} +`; + +exports[`平行线倒角 165`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + 1, + 0, + 0, + 2966.0573424695885, + 0, + 493.8714486099474, + 1, + ], + 0, + 0, + 2, + 58.10252336584995, + 3.141592653589793, + 0, + true, +] +`; + +exports[`平行线倒角 166`] = ` +Vector3 { + "x": 2907.9548191037384, + "y": 0, + "z": 493.8714486099474, +} +`; + +exports[`平行线倒角 167`] = ` +Vector3 { + "x": 2907.9548191037384, + "y": 0, + "z": 1488.0701817589372, +} +`; + +exports[`平行线倒角 168`] = ` +Vector3 { + "x": 3024.1598658354383, + "y": 0, + "z": 1488.0701817589372, +} +`; + +exports[`平行线倒角 169`] = ` +Vector3 { + "x": 3024.1598658354383, + "y": 0, + "z": 355.0709761248611, +} +`; + +exports[`平行线倒角 170`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + 1, + 0, + 0, + 2966.0573424695885, + 0, + 1488.0701817589372, + 1, + ], + 0, + 0, + 2, + 58.10252336584995, + 3.141592653589793, + 0, + false, +] +`; + +exports[`平行线倒角 171`] = ` +Vector3 { + "x": 3024.1598658354383, + "y": 0, + "z": 1494.526017688476, +} +`; + +exports[`平行线倒角 172`] = ` +Vector3 { + "x": 3024.1598658354383, + "y": 0, + "z": 355.0709761248611, +} +`; + +exports[`平行线倒角 173`] = ` +Vector3 { + "x": 2907.9548191037384, + "y": 0, + "z": 493.8714486099474, +} +`; + +exports[`平行线倒角 174`] = ` +Vector3 { + "x": 2907.9548191037384, + "y": 0, + "z": 1494.526017688476, +} +`; + +exports[`平行线倒角 175`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + 1, + 0, + 0, + 2966.0573424695885, + 0, + 1494.526017688476, + 1, + ], + 0, + 0, + 2, + 58.10252336584995, + 0, + 3.141592653589793, + true, +] +`; + +exports[`平行线倒角 176`] = ` +Vector3 { + "x": 3024.1598658354383, + "y": 0, + "z": 1494.526017688476, +} +`; + +exports[`平行线倒角 177`] = ` +Vector3 { + "x": 3024.1598658354383, + "y": 0, + "z": 355.0709761248611, +} +`; + +exports[`平行线倒角 178`] = ` +Vector3 { + "x": 2907.9548191037384, + "y": 0, + "z": 355.0709761248611, +} +`; + +exports[`平行线倒角 179`] = ` +Vector3 { + "x": 2907.9548191037384, + "y": 0, + "z": 1488.0701817589372, +} +`; + +exports[`平行线倒角 180`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + 1, + 0, + 0, + 2966.0573424695885, + 0, + 355.0709761248611, + 1, + ], + 0, + 0, + 2, + 58.10252336584995, + 0, + 3.141592653589793, + false, +] +`; + +exports[`平行线倒角 181`] = ` +Vector3 { + "x": 3705.2505564017906, + "y": 0, + "z": 280.8288629351637, +} +`; + +exports[`平行线倒角 182`] = ` +Vector3 { + "x": 3705.2505564017906, + "y": 0, + "z": 1568.7681308781732, +} +`; + +exports[`平行线倒角 183`] = ` +Vector3 { + "x": 3869.8743726050325, + "y": 0, + "z": 280.8288629351637, +} +`; + +exports[`平行线倒角 184`] = ` +Vector3 { + "x": 3869.8743726050325, + "y": 0, + "z": 1546.1727051247872, +} +`; + +exports[`平行线倒角 185`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + 1, + 0, + 0, + 3787.5624645034113, + 0, + 280.8288629351637, + 1, + ], + 0, + 0, + 2, + 82.31190810162093, + 3.141592653589793, + 0, + true, +] +`; + +exports[`平行线倒角 186`] = ` +Vector3 { + "x": 3705.2505564017906, + "y": 0, + "z": 280.8288629351637, +} +`; + +exports[`平行线倒角 187`] = ` +Vector3 { + "x": 3705.2505564017906, + "y": 0, + "z": 1568.7681308781732, +} +`; + +exports[`平行线倒角 188`] = ` +Vector3 { + "x": 3869.8743726050325, + "y": 0, + "z": 287.28469886470253, +} +`; + +exports[`平行线倒角 189`] = ` +Vector3 { + "x": 3869.8743726050325, + "y": 0, + "z": 1568.7681308781732, +} +`; + +exports[`平行线倒角 190`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + 1, + 0, + 0, + 3787.5624645034113, + 0, + 1568.7681308781732, + 1, + ], + 0, + 0, + 2, + 82.31190810162093, + 3.141592653589793, + 0, + false, +] +`; + +exports[`平行线倒角 191`] = ` +Vector3 { + "x": 3869.8743726050325, + "y": 0, + "z": 287.28469886470253, +} +`; + +exports[`平行线倒角 192`] = ` +Vector3 { + "x": 3869.8743726050325, + "y": 0, + "z": 1546.1727051247872, +} +`; + +exports[`平行线倒角 193`] = ` +Vector3 { + "x": 3705.2505564017906, + "y": 0, + "z": 287.28469886470253, +} +`; + +exports[`平行线倒角 194`] = ` +Vector3 { + "x": 3705.2505564017906, + "y": 0, + "z": 1568.7681308781732, +} +`; + +exports[`平行线倒角 195`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + -1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + -1, + 0, + 0, + 3787.5624645034113, + 0, + 287.28469886470253, + 1, + ], + 0, + 0, + 2, + 82.31190810162093, + 3.141592653589793, + 0, + true, +] +`; + +exports[`平行线倒角 196`] = ` +Vector3 { + "x": 3869.8743726050325, + "y": 0, + "z": 287.28469886470253, +} +`; + +exports[`平行线倒角 197`] = ` +Vector3 { + "x": 3869.8743726050325, + "y": 0, + "z": 1546.1727051247872, +} +`; + +exports[`平行线倒角 198`] = ` +Vector3 { + "x": 3705.2505564017906, + "y": 0, + "z": 280.8288629351637, +} +`; + +exports[`平行线倒角 199`] = ` +Vector3 { + "x": 3705.2505564017906, + "y": 0, + "z": 1546.1727051247872, +} +`; + +exports[`平行线倒角 200`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + -1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + -1, + 0, + 0, + 3787.5624645034113, + 0, + 1546.1727051247872, + 1, + ], + 0, + 0, + 2, + 82.31190810162093, + 3.141592653589793, + 0, + false, +] +`; + +exports[`平行线倒角 201`] = ` +Vector3 { + "x": 5086.799445323114, + "y": 0, + "z": 468.04810489179147, +} +`; + +exports[`平行线倒角 202`] = ` +Vector3 { + "x": 5086.799445323114, + "y": 0, + "z": 1820.5457321301901, +} +`; + +exports[`平行线倒角 203`] = ` +Vector3 { + "x": 5190.092820195736, + "y": 0, + "z": 1865.7365836369625, +} +`; + +exports[`平行线倒角 204`] = ` +Vector3 { + "x": 5190.092820195736, + "y": 0, + "z": 468.0481048917916, +} +`; + +exports[`平行线倒角 205`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + 1, + 0, + 0, + 5138.446132759425, + 0, + 468.0481048917915, + 1, + ], + 0, + 0, + 2, + 51.64668743631091, + 3.1415926535897927, + 0, + true, +] +`; + +exports[`平行线倒角 206`] = ` +Vector3 { + "x": 5086.799445323114, + "y": 0, + "z": 468.04810489179147, +} +`; + +exports[`平行线倒角 207`] = ` +Vector3 { + "x": 5086.799445323114, + "y": 0, + "z": 1820.5457321301901, +} +`; + +exports[`平行线倒角 208`] = ` +Vector3 { + "x": 5190.092820195736, + "y": 0, + "z": 1820.5457321301901, +} +`; + +exports[`平行线倒角 209`] = ` +Vector3 { + "x": 5190.092820195736, + "y": 0, + "z": 225.95425753408313, +} +`; + +exports[`平行线倒角 210`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + 1, + 0, + 0, + 5138.446132759425, + 0, + 1820.5457321301901, + 1, + ], + 0, + 0, + 2, + 51.64668743631091, + 3.141592653589793, + 0, + false, +] +`; + +exports[`平行线倒角 211`] = ` +Vector3 { + "x": 5190.092820195736, + "y": 0, + "z": 1865.7365836369625, +} +`; + +exports[`平行线倒角 212`] = ` +Vector3 { + "x": 5190.092820195736, + "y": 0, + "z": 225.95425753408313, +} +`; + +exports[`平行线倒角 213`] = ` +Vector3 { + "x": 5086.799445323114, + "y": 0, + "z": 468.04810489179147, +} +`; + +exports[`平行线倒角 214`] = ` +Vector3 { + "x": 5086.799445323114, + "y": 0, + "z": 1865.7365836369622, +} +`; + +exports[`平行线倒角 215`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + 1, + 0, + 0, + 5138.446132759425, + 0, + 1865.7365836369622, + 1, + ], + 0, + 0, + 2, + 51.64668743631091, + 0, + 3.141592653589793, + true, +] +`; + +exports[`平行线倒角 216`] = ` +Vector3 { + "x": 5190.092820195736, + "y": 0, + "z": 1865.7365836369625, +} +`; + +exports[`平行线倒角 217`] = ` +Vector3 { + "x": 5190.092820195736, + "y": 0, + "z": 225.95425753408313, +} +`; + +exports[`平行线倒角 218`] = ` +Vector3 { + "x": 5086.799445323114, + "y": 0, + "z": 225.95425753408313, +} +`; + +exports[`平行线倒角 219`] = ` +Vector3 { + "x": 5086.799445323114, + "y": 0, + "z": 1820.5457321301901, +} +`; + +exports[`平行线倒角 220`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -0, + -1, + 0, + 0, + 1, + 0, + 0, + 5138.446132759425, + 0, + 225.95425753408313, + 1, + ], + 0, + 0, + 2, + 51.64668743631091, + 0, + 3.141592653589793, + false, +] +`; + +exports[`平行线倒角 221`] = ` +Vector3 { + "x": 4345.085428747755, + "y": 295.3242716736435, + "z": 0, +} +`; + +exports[`平行线倒角 222`] = ` +Vector3 { + "x": 4776.746599778449, + "y": 295.3242716736435, + "z": 0, +} +`; + +exports[`平行线倒角 223`] = ` +Vector3 { + "x": 5095.4074642566065, + "y": 191.36398964530858, + "z": 0, +} +`; + +exports[`平行线倒角 224`] = ` +Vector3 { + "x": 4345.085428747755, + "y": 191.36398964530858, + "z": 0, +} +`; + +exports[`平行线倒角 225`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 4345.085428747755, + 243.34413065947604, + 0, + 1, + ], + 0, + 0, + 2, + 51.98014101416747, + 4.71238898038469, + 1.570796326794897, + true, +] +`; + +exports[`平行线倒角 226`] = ` +Vector3 { + "x": 4345.085428747755, + "y": 295.3242716736435, + "z": 0, +} +`; + +exports[`平行线倒角 227`] = ` +Vector3 { + "x": 4776.746599778449, + "y": 295.3242716736435, + "z": 0, +} +`; + +exports[`平行线倒角 228`] = ` +Vector3 { + "x": 4776.746599778449, + "y": 191.36398964530858, + "z": 0, +} +`; + +exports[`平行线倒角 229`] = ` +Vector3 { + "x": 4220.785091539963, + "y": 191.36398964530858, + "z": 0, +} +`; + +exports[`平行线倒角 230`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 4776.746599778449, + 243.34413065947604, + 0, + 1, + ], + 0, + 0, + 2, + 51.98014101416747, + 4.71238898038469, + 1.570796326794897, + false, +] +`; + +exports[`平行线倒角 231`] = ` +Vector3 { + "x": 5095.4074642566065, + "y": 191.36398964530858, + "z": 0, +} +`; + +exports[`平行线倒角 232`] = ` +Vector3 { + "x": 4220.785091539963, + "y": 191.36398964530858, + "z": 0, +} +`; + +exports[`平行线倒角 233`] = ` +Vector3 { + "x": 4345.085428747755, + "y": 295.3242716736435, + "z": 0, +} +`; + +exports[`平行线倒角 234`] = ` +Vector3 { + "x": 5095.4074642566065, + "y": 295.3242716736435, + "z": 0, +} +`; + +exports[`平行线倒角 235`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 5095.4074642566065, + 243.34413065947604, + 0, + 1, + ], + 0, + 0, + 2, + 51.98014101416747, + 1.570796326794897, + 4.71238898038469, + true, +] +`; + +exports[`平行线倒角 236`] = ` +Vector3 { + "x": 5095.4074642566065, + "y": 191.36398964530858, + "z": 0, +} +`; + +exports[`平行线倒角 237`] = ` +Vector3 { + "x": 4220.785091539963, + "y": 191.36398964530858, + "z": 0, +} +`; + +exports[`平行线倒角 238`] = ` +Vector3 { + "x": 4220.785091539963, + "y": 295.3242716736435, + "z": 0, +} +`; + +exports[`平行线倒角 239`] = ` +Vector3 { + "x": 4776.746599778449, + "y": 295.3242716736435, + "z": 0, +} +`; + +exports[`平行线倒角 240`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 1, + 0, + 0, + 0, + -0, + -1, + -0, + 0, + 0, + 0, + -1, + 0, + 4220.785091539963, + 243.34413065947604, + 0, + 1, + ], + 0, + 0, + 2, + 51.98014101416747, + 1.570796326794897, + 4.71238898038469, + false, +] +`; + +exports[`平行线倒角 241`] = ` +Vector3 { + "x": 0, + "y": -8996.91886327466, + "z": -984.963632541074, +} +`; + +exports[`平行线倒角 242`] = ` +Vector3 { + "x": 0, + "y": -12643.991371767113, + "z": 5415.060382361811, +} +`; + +exports[`平行线倒角 243`] = ` +Vector3 { + "x": 0, + "y": -9526.70076935374, + "z": -1286.8614099023139, +} +`; + +exports[`平行线倒角 244`] = ` +Vector3 { + "x": 0, + "y": -13091.051872807684, + "z": 4967.999881320092, +} +`; + +exports[`平行线倒角 245`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + -1, + 0, + 0, + -0, + -0, + -1, + 0, + 1, + 0, + 0, + 0, + 0, + -9261.8098163142, + -1135.912521221694, + 1, + ], + 0, + 0, + 2, + 304.88159012329635, + 3.6595501788556284, + 0.5179575252658354, + true, +] +`; + +exports[`平行线倒角 246`] = ` +Vector3 { + "x": 0, + "y": -8996.91886327466, + "z": -984.963632541074, +} +`; + +exports[`平行线倒角 247`] = ` +Vector3 { + "x": 0, + "y": -12643.991371767113, + "z": 5415.060382361811, +} +`; + +exports[`平行线倒角 248`] = ` +Vector3 { + "x": 0, + "y": -9443.979364315232, + "z": -1432.0241335827934, +} +`; + +exports[`平行线倒角 249`] = ` +Vector3 { + "x": 0, + "y": -13173.77327784619, + "z": 5113.16260500057, +} +`; + +exports[`平行线倒角 250`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + -1, + 0, + 0, + -0, + -0, + -1, + 0, + 1, + 0, + 0, + 0, + 0, + -12908.882324806651, + 5264.11149368119, + 1, + ], + 0, + 0, + 2, + 304.88159012329595, + 3.6595501788556346, + 0.5179575252658364, + false, +] +`; + +exports[`平行线倒角 251`] = ` +Vector3 { + "x": 0, + "y": -9443.979364315232, + "z": -1432.0241335827934, +} +`; + +exports[`平行线倒角 252`] = ` +Vector3 { + "x": 0, + "y": -13091.051872807684, + "z": 4967.999881320092, +} +`; + +exports[`平行线倒角 253`] = ` +Vector3 { + "x": 0, + "y": -8914.197458236153, + "z": -1130.1263562215536, +} +`; + +exports[`平行线倒角 254`] = ` +Vector3 { + "x": 0, + "y": -12643.991371767113, + "z": 5415.060382361811, +} +`; + +exports[`平行线倒角 255`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + 1, + 0, + 0, + -0, + -0, + -1, + 0, + -1, + 0, + 0, + 0, + 0, + -9179.088411275692, + -1281.0752449021734, + 1, + ], + 0, + 0, + 2, + 304.88159012329635, + 2.6236351283239583, + 5.765227781913752, + true, +] +`; + +exports[`平行线倒角 256`] = ` +Vector3 { + "x": 0, + "y": -9443.979364315232, + "z": -1432.0241335827934, +} +`; + +exports[`平行线倒角 257`] = ` +Vector3 { + "x": 0, + "y": -13091.051872807684, + "z": 4967.999881320092, +} +`; + +exports[`平行线倒角 258`] = ` +Vector3 { + "x": 0, + "y": -8996.91886327466, + "z": -984.963632541074, +} +`; + +exports[`平行线倒角 259`] = ` +Vector3 { + "x": 0, + "y": -12561.269966728603, + "z": 5269.8976586813305, +} +`; + +exports[`平行线倒角 260`] = ` +Array [ + 5, + 2, + 0, + false, + 0, + 7, + 0, + Array [ + 0, + 1, + 0, + 0, + -0, + -0, + -1, + 0, + -1, + 0, + 0, + 0, + 0, + -12826.160919768143, + 5118.948770000711, + 1, + ], + 0, + 0, + 2, + 304.88159012329686, + 2.623635128323963, + 5.765227781913753, + false, +] +`; diff --git a/__test__/Polyline/Fillet.test.ts b/__test__/Polyline/Fillet.test.ts index bd0d799b4..12672e97c 100644 --- a/__test__/Polyline/Fillet.test.ts +++ b/__test__/Polyline/Fillet.test.ts @@ -335,6 +335,31 @@ test('自交多段线R0', () => let pts = [new Vector3(4759.472137764609, -479.7070785210667, 0), new Vector3(6024.774672494344, 265.369726606551, 0), new Vector3(5976.082363634626, 748.2320220970707, 0), new Vector3(6672.691303327904, 807.7793855808623, 0), new Vector3(6683.501141538695, 782.8164602281072, 0), new Vector3(6586.348726590796, 528.4389981312158, 0), new Vector3(6696.36087689051, 753.119751786805, 0), new Vector3(7099.123174513582, 768.6481023223804, 0), new Vector3(6658.806811968616, 562.3819760828667, 0), new Vector3(6851.152936781651, 395.661799048499, 0), new Vector3(6890.235750785234, 305.4087027928025, 0), new Vector3(7047.556803344554, 744.4918443904984, 0)]; + for (let i = 0; i + 1 < pts.length; i = i + 2) + { + let p1 = pts[i]; + let p2 = pts[i + 1]; + + let e1 = new PromptEntityResult(pl, p1); + let e2 = new PromptEntityResult(pl, p2); + let fres = fillet.Fillet(e1, e2); + + excepeRes(fres); + } +}); + +test('多段线平行倒圆弧', () => +{ + let f = [1, "Polyline", 5, 2, 101, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 0, 0, 2, 4, [697.5655502392347, 300.3177033492824], 0, [1666.4995215311, 300.3177033492824], 0, [1666.4995215311, 1182.5990430622012], 0, [697.5655502392347, 1182.5990430622012], 0, true] + + let pl = LoadEntityFromFileData(f)[0] as Polyline; + + let fillet = new FilletUtils(); + + fillet.FilletRadius = 10; + + let pts = [new Vector3(697.5655502392347, 1007.4491640902602, 0), new Vector3(1666.4995215311, 999.8584025880182, 0), new Vector3(1011.2689613363971, 300.3177033492824, 0), new Vector3(1056.8135303498493, 1182.5990430622012, 0), new Vector3(697.5655502392347, 458.38408209475665, 0), new Vector3(1666.4995215311, 450.79332059251453, 0)]; + for (let i = 0; i + 1 < pts.length; i = i + 2) { let p1 = pts[i]; diff --git a/__test__/Polyline/__snapshots__/Fillet.test.ts.snap b/__test__/Polyline/__snapshots__/Fillet.test.ts.snap index 9757e6eae..b2010820a 100644 --- a/__test__/Polyline/__snapshots__/Fillet.test.ts.snap +++ b/__test__/Polyline/__snapshots__/Fillet.test.ts.snap @@ -6,6 +6,12 @@ exports[`圆弧跨越分割线 1`] = `"1420.95209"`; exports[`多段线双圆R0 1`] = `"5151.46930"`; +exports[`多段线平行倒圆弧 1`] = `"4255.49457"`; + +exports[`多段线平行倒圆弧 2`] = `"4206.03357"`; + +exports[`多段线平行倒圆弧 3`] = `"4255.49457"`; + exports[`自交多段线 1`] = `"7791.00495"`; exports[`自交多段线 2`] = `"9003.48566"`; diff --git a/__test__/Polyline/__snapshots__/offset.test.ts.snap b/__test__/Polyline/__snapshots__/offset.test.ts.snap index 729eb86eb..311f952fa 100644 --- a/__test__/Polyline/__snapshots__/offset.test.ts.snap +++ b/__test__/Polyline/__snapshots__/offset.test.ts.snap @@ -2,19 +2,19 @@ exports[`IKKGK圆与直线补圆弧 1`] = `1`; -exports[`IKKGK圆与直线补圆弧 2`] = `44.99893545255323`; +exports[`IKKGK圆与直线补圆弧 2`] = `"44.99894"`; exports[`IKKGK圆与直线补圆弧 3`] = `1`; -exports[`IKKGK圆与直线补圆弧 4`] = `44.998935452553226`; +exports[`IKKGK圆与直线补圆弧 4`] = `"44.99894"`; exports[`IKKGK圆与直线补圆弧 5`] = `1`; -exports[`IKKGK圆与直线补圆弧 6`] = `52.526991974363945`; +exports[`IKKGK圆与直线补圆弧 6`] = `"52.52699"`; exports[`中间区域需要圆裁剪 1`] = `1`; -exports[`中间区域需要圆裁剪 2`] = `24.711300177432427`; +exports[`中间区域需要圆裁剪 2`] = `"24.71130"`; exports[`圆求交错误导致的线丢失 1`] = `4148.6552839918695`; @@ -46,51 +46,51 @@ exports[`圆求交错误导致的线丢失 14`] = `6316.980887212943`; exports[`复杂圆盘选点 1`] = `1`; -exports[`复杂圆盘选点 2`] = `197.02551075687774`; +exports[`复杂圆盘选点 2`] = `"197.02551"`; exports[`复杂圆盘选点 3`] = `1`; -exports[`复杂圆盘选点 4`] = `190.82843823827838`; +exports[`复杂圆盘选点 4`] = `"190.82844"`; exports[`复杂圆盘选点 5`] = `1`; -exports[`复杂圆盘选点 6`] = `204.54080647675428`; +exports[`复杂圆盘选点 6`] = `"204.54081"`; exports[`复杂圆盘选点 7`] = `1`; -exports[`复杂圆盘选点 8`] = `205.5702779513265`; +exports[`复杂圆盘选点 8`] = `"205.57028"`; exports[`复杂圆盘选点 9`] = `1`; -exports[`复杂圆盘选点 10`] = `206.8233228255668`; +exports[`复杂圆盘选点 10`] = `"206.82332"`; exports[`多段线因为合并问题造成的错误 1`] = `1`; -exports[`多段线因为合并问题造成的错误 2`] = `2210.3833040297086`; +exports[`多段线因为合并问题造成的错误 2`] = `"2210.38330"`; exports[`多段线存在0长度线段导致偏移错误 1`] = `1`; -exports[`多段线存在0长度线段导致偏移错误 2`] = `81933.70549460052`; +exports[`多段线存在0长度线段导致偏移错误 2`] = `"81933.70549"`; exports[`多段线存在0长度线段导致偏移错误 3`] = `1`; -exports[`多段线存在0长度线段导致偏移错误 4`] = `86144.16549499573`; +exports[`多段线存在0长度线段导致偏移错误 4`] = `"86144.16549"`; exports[`拱门偏移 1`] = `1`; -exports[`拱门偏移 2`] = `4.314159265358979`; +exports[`拱门偏移 2`] = `"4.31416"`; exports[`拱门偏移 3`] = `1`; -exports[`拱门偏移 4`] = `6.827433388230814`; +exports[`拱门偏移 4`] = `"6.82743"`; exports[`海豚圆选点导致的错误 1`] = `1`; -exports[`海豚圆选点导致的错误 2`] = `1591.1982232513815`; +exports[`海豚圆选点导致的错误 2`] = `"1591.19822"`; exports[`海豚圆选点导致的错误 3`] = `1`; -exports[`海豚圆选点导致的错误 4`] = `1827.6352392619826`; +exports[`海豚圆选点导致的错误 4`] = `"1827.63524"`; exports[`简单图形因为点在线内算法错误导致的丢失 1`] = `8.675189454805244`; @@ -102,11 +102,11 @@ exports[`简单图形因为点在线内算法错误导致的丢失 4`] = `6.0456 exports[`纯圆生成的多段线偏移 1`] = `1`; -exports[`纯圆生成的多段线偏移 2`] = `7585.215254159188`; +exports[`纯圆生成的多段线偏移 2`] = `"7585.21525"`; exports[`纯圆生成的多段线偏移 3`] = `1`; -exports[`纯圆生成的多段线偏移 4`] = `6328.578192723271`; +exports[`纯圆生成的多段线偏移 4`] = `"6328.57819"`; exports[`补充bug测试 1`] = `7385.123391644449`; @@ -114,91 +114,91 @@ exports[`补充bug测试 2`] = `7455.861403941378`; exports[`补圆弧测试 补圆弧测试1 1`] = `1`; -exports[`补圆弧测试 补圆弧测试1 2`] = `202.39253405175808`; +exports[`补圆弧测试 补圆弧测试1 2`] = `"202.39253"`; exports[`补圆弧测试 补圆弧测试1 3`] = `1`; -exports[`补圆弧测试 补圆弧测试1 4`] = `202.97120101469034`; +exports[`补圆弧测试 补圆弧测试1 4`] = `"202.97120"`; exports[`补圆弧测试 补圆弧测试1 5`] = `1`; -exports[`补圆弧测试 补圆弧测试1 6`] = `203.6336810139832`; +exports[`补圆弧测试 补圆弧测试1 6`] = `"203.63368"`; exports[`补圆弧测试 补圆弧测试1 7`] = `1`; -exports[`补圆弧测试 补圆弧测试1 8`] = `204.40243508941455`; +exports[`补圆弧测试 补圆弧测试1 8`] = `"204.40244"`; exports[`补圆弧测试 补圆弧测试1 9`] = `1`; -exports[`补圆弧测试 补圆弧测试1 10`] = `205.30936570465022`; +exports[`补圆弧测试 补圆弧测试1 10`] = `"205.30937"`; exports[`补圆弧测试 补圆弧测试1 11`] = `1`; -exports[`补圆弧测试 补圆弧测试1 12`] = `206.40161902342368`; +exports[`补圆弧测试 补圆弧测试1 12`] = `"206.40162"`; exports[`补圆弧测试 补圆弧测试1 13`] = `1`; -exports[`补圆弧测试 补圆弧测试1 14`] = `207.75245158170867`; +exports[`补圆弧测试 补圆弧测试1 14`] = `"207.75245"`; exports[`补圆弧测试 补圆弧测试1 15`] = `1`; -exports[`补圆弧测试 补圆弧测试1 16`] = `209.48342742923182`; +exports[`补圆弧测试 补圆弧测试1 16`] = `"209.48343"`; exports[`补圆弧测试 补圆弧测试1 17`] = `1`; -exports[`补圆弧测试 补圆弧测试1 18`] = `211.81548185565424`; +exports[`补圆弧测试 补圆弧测试1 18`] = `"211.81548"`; exports[`补圆弧测试 补圆弧测试1 19`] = `1`; -exports[`补圆弧测试 补圆弧测试1 20`] = `215.20917509215795`; +exports[`补圆弧测试 补圆弧测试1 20`] = `"215.20918"`; exports[`补圆弧测试 补圆弧测试1 21`] = `1`; -exports[`补圆弧测试 补圆弧测试1 22`] = `220.89156198708565`; +exports[`补圆弧测试 补圆弧测试1 22`] = `"220.89156"`; exports[`补圆弧测试 补圆弧测试1 23`] = `1`; -exports[`补圆弧测试 补圆弧测试1 24`] = `243.05208882995845`; +exports[`补圆弧测试 补圆弧测试1 24`] = `"243.05209"`; exports[`补圆弧测试 补圆弧测试1 25`] = `1`; -exports[`补圆弧测试 补圆弧测试1 26`] = `236.7000505929851`; +exports[`补圆弧测试 补圆弧测试1 26`] = `"236.70005"`; exports[`补圆弧测试 补圆弧测试1 27`] = `1`; -exports[`补圆弧测试 补圆弧测试1 28`] = `236.7000505929851`; +exports[`补圆弧测试 补圆弧测试1 28`] = `"236.70005"`; exports[`补圆弧测试 补圆弧测试1 29`] = `1`; -exports[`补圆弧测试 补圆弧测试1 30`] = `205.63007530643267`; +exports[`补圆弧测试 补圆弧测试1 30`] = `"205.63008"`; exports[`补圆弧测试 补圆弧测试1 31`] = `1`; -exports[`补圆弧测试 补圆弧测试1 32`] = `198.5522282383345`; +exports[`补圆弧测试 补圆弧测试1 32`] = `"198.55223"`; exports[`补圆弧测试 补圆弧测试1 33`] = `1`; -exports[`补圆弧测试 补圆弧测试1 34`] = `195.9134975736565`; +exports[`补圆弧测试 补圆弧测试1 34`] = `"195.91350"`; exports[`补圆弧测试 补圆弧测试1 35`] = `1`; -exports[`补圆弧测试 补圆弧测试1 36`] = `194.55187803685857`; +exports[`补圆弧测试 补圆弧测试1 36`] = `"194.55188"`; exports[`补圆弧测试 补圆弧测试1 37`] = `1`; -exports[`补圆弧测试 补圆弧测试1 38`] = `193.73994771001938`; +exports[`补圆弧测试 补圆弧测试1 38`] = `"193.73995"`; exports[`补圆弧测试 补圆弧测试1 39`] = `1`; -exports[`补圆弧测试 补圆弧测试1 40`] = `193.2116587563558`; +exports[`补圆弧测试 补圆弧测试1 40`] = `"193.21166"`; exports[`补圆弧测试 补圆弧测试1 41`] = `1`; -exports[`补圆弧测试 补圆弧测试1 42`] = `192.84673020284998`; +exports[`补圆弧测试 补圆弧测试1 42`] = `"192.84673"`; exports[`补圆弧测试 补圆弧测试1 43`] = `1`; -exports[`补圆弧测试 补圆弧测试1 44`] = `192.58327191623619`; +exports[`补圆弧测试 补圆弧测试1 44`] = `"192.58327"`; exports[`闭合多段线判断精度和重复交点参数导致偏移丢失 1`] = `54789.24964851234`; diff --git a/__test__/Polyline/offset.test.ts b/__test__/Polyline/offset.test.ts index a997ad9ec..9f6050931 100644 --- a/__test__/Polyline/offset.test.ts +++ b/__test__/Polyline/offset.test.ts @@ -2,6 +2,8 @@ import { Factory } from "../../src/DatabaseServices/CADFactory"; import { Curve } from "../../src/DatabaseServices/Entity/Curve"; import { Polyline } from "../../src/DatabaseServices/Entity/Polyline"; import { LoadEntityFromFileData } from "../Utils/LoadEntity.util"; +import "../Utils/jest.util"; + Factory(Polyline); function loadFile(data) @@ -14,7 +16,7 @@ function EntityToMatchSnapshot(ens: Curve[]) expect(ens.length).toMatchSnapshot(); for (let c of ens) { - expect(c.Length).toMatchSnapshot(); + expect(c.Length).toMatchNumberSnapshot(); } } diff --git a/src/Add-on/Fillet.ts b/src/Add-on/Fillet.ts index 9d16b11f7..1dea22b2d 100644 --- a/src/Add-on/Fillet.ts +++ b/src/Add-on/Fillet.ts @@ -63,9 +63,16 @@ export class CommandFillet implements Command res2.Entity.UpdateJigMaterial(); lastCu = res2.Entity as Curve; let fres = this.m_FilletUtils.Fillet(enRes1, res2); - for (let v in fres) - if (fres[v]) - JigUtils.Draw(fres[v]) + + if (fres) + { + if (fres.arc) + JigUtils.Draw(fres.arc); + if (fres.cu1) + JigUtils.Draw(fres.cu1); + if (fres.cu2) + JigUtils.Draw(fres.cu2); + } app.Editor.UpdateScreen(); } let keydownUpdateRadius = (e: KeyboardEvent) => diff --git a/src/Add-on/FilletUtils.ts b/src/Add-on/FilletUtils.ts index d07dbdcf4..e6fd52704 100644 --- a/src/Add-on/FilletUtils.ts +++ b/src/Add-on/FilletUtils.ts @@ -1,5 +1,5 @@ import { Matrix4, Vector3 } from "three"; -import { curveLinkGroup, GetPointAtCurveDir } from "../Common/CurveUtils"; +import { GetPointAtCurveDir } from "../Common/CurveUtils"; import { Arc } from "../DatabaseServices/Entity/Arc"; import { Board } from "../DatabaseServices/Entity/Board"; import { Circle } from "../DatabaseServices/Entity/Circle"; @@ -8,9 +8,9 @@ import { Ellipse } from "../DatabaseServices/Entity/Ellipse"; import { Line } from "../DatabaseServices/Entity/Line"; import { Polyline } from "../DatabaseServices/Entity/Polyline"; import { Spline } from "../DatabaseServices/Spline"; -import { JigUtils } from "../Editor/JigUtils"; import { PromptEntityResult, PromptPointResult } from "../Editor/PromptResult"; -import { angle, AsVector2, equalv3, isParallelTo, midPoint } from "../Geometry/GeUtils"; +import { angle, AsVector2, equalv3, isIntersect2, isParallelTo, midPoint } from "../Geometry/GeUtils"; +import { Orbit } from "../Geometry/Orbit"; import { IntersectOption } from "../GraphicsSystem/IntersectWith"; function Encode(res: PromptEntityResult, enMap: (PromptEntityResult[])[]) @@ -57,7 +57,7 @@ function CircleEnResToArc(enRes: PromptEntityResult) } } -function GetFilletCurve(enRes: PromptEntityResult): any[] +function GetFilletCurve(enRes: PromptEntityResult): [Curve, number] { if (enRes.Entity instanceof Polyline) { @@ -67,7 +67,7 @@ function GetFilletCurve(enRes: PromptEntityResult): any[] return [pl.GetCurveAtParam(param), paramF]; } else - return [enRes.Entity, NaN]; + return [enRes.Entity as Curve, NaN]; } enum ExtendType @@ -79,7 +79,9 @@ enum ExtendType export interface FilletRes { cu1?: Curve; + cu1Extend?: ExtendType; cu2?: Curve; + cu2Extend?: ExtendType; arc?: Arc; } @@ -193,6 +195,10 @@ export class FilletUtils this.ExtendPt(splitedCu1, arcP1); this.ExtendPt(splitedCu2, arcP2); } + + res.cu1Extend = splitedCu1.ExtType; + res.cu2Extend = splitedCu2.ExtType; + return res; } FilletPolyLineSelf(enRes1: PromptEntityResult, enRes2: PromptEntityResult): FilletRes @@ -241,14 +247,14 @@ export class FilletUtils if (fres.cu2 instanceof Arc) pln.SetBulgeAt(parF2, fres.cu2.Bul); - let splitType1 = equalv3(c1.StartPoint, fres.cu1.StartPoint); - let splitType2 = equalv3(c2.StartPoint, fres.cu2.StartPoint); + let splitType1 = fres.cu1Extend; + let splitType2 = fres.cu2Extend; if (splitType1 === splitType2) return; if (!fres.arc) { - if (splitType1) + if (splitType1 === ExtendType.End) { let ep = AsVector2(fres.cu1.EndPoint.applyMatrix4(pln.OCSInv)); pln.SetPointAt(parF1 + 1, ep); @@ -275,7 +281,7 @@ export class FilletUtils } } - if (splitType1)//没有经过起点 + if (splitType1 === ExtendType.End)//没有经过起点 { let sp = AsVector2(fres.cu1.EndPoint.applyMatrix4(pln.OCSInv)); if (parF2 - parF1 === 1) @@ -334,24 +340,42 @@ export class FilletUtils let fres = this.Fillet(es1, es2); if (fres) { - let pln: Polyline; - let isFirst = false; let cus: Curve[] = []; + + let isFirst = false; + if (fres.cu1) { if (enRes1.Entity instanceof Polyline) { isFirst = true; - pln = enRes1.Entity.Clone(); + let pln = enRes1.Entity.Clone(); + pln.DigestionCloseMark(); - let xcus = enRes1.Entity.Explode(); - xcus[paramF1] = fres.cu1; - cus.push(...xcus); + if (fres.cu1 instanceof Arc) + pln.SetBulgeAt(paramF1, fres.cu1.Bul); + + if (fres.cu1Extend === ExtendType.End) + { + pln.LineData.splice(paramF1 + 2); + + let ep = AsVector2(fres.cu1.EndPoint.applyMatrix4(pln.OCSInv)); + pln.SetPointAt(paramF1 + 1, ep); + } + else + { + pln.LineData.splice(0, paramF1); + let sp = AsVector2(fres.cu1.StartPoint.applyMatrix4(pln.OCSInv)); + pln.SetPointAt(0, sp); + } + + cus.push(pln); } //@ts-ignore else if (!enRes1.IsCircle) cus.push(fres.cu1); } + if (fres.arc) cus.push(fres.arc); @@ -359,34 +383,49 @@ export class FilletUtils { if (enRes2.Entity instanceof Polyline) { - if (!pln) - pln = enRes2.Entity.Clone(); + let pln = enRes2.Entity.Clone(); + pln.DigestionCloseMark(); + + if (fres.cu2 instanceof Arc) + pln.SetBulgeAt(paramF2, fres.cu2.Bul); - let xcus = enRes2.Entity.Explode(); - xcus[paramF2] = fres.cu2; - cus.push(...xcus); + if (fres.cu2Extend === ExtendType.End) + { + pln.LineData.splice(paramF2 + 2); + + let ep = AsVector2(fres.cu2.EndPoint.applyMatrix4(pln.OCSInv)); + pln.SetPointAt(paramF2 + 1, ep); + } + else + { + pln.LineData.splice(0, paramF2); + let sp = AsVector2(fres.cu2.StartPoint.applyMatrix4(pln.OCSInv)); + pln.SetPointAt(0, sp); + } + + cus.push(pln); + cus.reverse(); } //@ts-ignore else if (!enRes2.IsCircle) cus.push(fres.cu2); } - let groups = curveLinkGroup(cus); - for (let g of groups) + if (cus.length > 0) { - if (g.includes(fres.cu1) || g.includes(fres.cu2)) - { - pln.LineData = []; - pln.ApplyMatrix(pln.OCSInv); - pln.CloseMark = false; - for (let cu of g) - pln.Join(cu); - if (isFirst) - return { cu1: pln, cu2: undefined, arc: undefined }; - else - return { cu1: undefined, cu2: pln, arc: undefined }; - } + let pl = cus[0] as Polyline; + if (!(pl instanceof Polyline)) + return; + + for (let i = 1; i < cus.length; i++) + pl.Join(cus[i]); + + if (isFirst) + return { cu1: pl }; + else + return { cu2: pl }; } + } return undefined; @@ -501,9 +540,6 @@ export class FilletUtils /** * 平行线倒角 - * @param enRes1 - * @param enRes2 - * @returns parallel line */ private FilletParallelLine(enRes1: PromptEntityResult, enRes2: PromptEntityResult): FilletRes { @@ -514,9 +550,15 @@ export class FilletUtils if (!isParallelTo(l1Derv, l2.GetFistDeriv(0))) return; + let vec = l2.StartPoint.sub(l1.StartPoint); + if (isParallelTo(vec, l1Derv)) + return; + + let planeNormal = vec.cross(l1Derv).normalize(); + let par1 = l2.GetClosestAtPoint(l1.StartPoint, true).param; let par2 = l2.GetClosestAtPoint(l1.EndPoint, true).param; - if (!l1.ParamOnCurve(par1) && !l1.ParamOnCurve(par2)) + if (!isIntersect2(0, 1, par1, par2)) return; let lineClone1 = l1.Clone(); @@ -527,27 +569,56 @@ export class FilletUtils let parFix = Math.round(par); let ptFix = lineClone1.GetPointAtParam(parFix); let ptL2Fix = lineClone2.GetClosestAtPoint(ptFix, true).closestPt; + + let cu1Extend = parFix === 0 ? ExtendType.Start : ExtendType.End; + let cu2Extend: ExtendType; if ((par1 > par2) === (parFix === 1)) + { lineClone2.StartPoint = ptL2Fix; + cu2Extend = ExtendType.Start; + } else + { lineClone2.EndPoint = ptL2Fix; + cu2Extend = ExtendType.End; + } + + let radius = ptFix.distanceTo(ptL2Fix) / 2; + if (radius < 1e-3) + return; let arcCenter = midPoint(ptFix, ptL2Fix); - let sv = ptFix.sub(arcCenter).applyMatrix4(l1.OCSInv); - let ev = ptL2Fix.sub(arcCenter).applyMatrix4(l2.OCSInv); + let sv = ptFix.sub(arcCenter); + let ev = ptL2Fix.sub(arcCenter); if (parFix === 0) l1Derv.negate(); - let arc = new Arc(new Vector3(), ptFix.distanceTo(ptL2Fix) / 2, angle(sv), angle(ev), ev.cross(l1Derv.applyMatrix4(l1.OCSInv)).z > 0); - arc.ApplyMatrix(l1.OCS); + //平面矩阵 + let xVec = new Vector3(); + let yVec = new Vector3(); + Orbit.ComputUpDirection(planeNormal, yVec, xVec); + let mtx = new Matrix4().makeBasis(xVec, yVec, planeNormal.negate()); + let mtxInv = new Matrix4().getInverse(mtx); + //变换 + sv.applyMatrix4(mtxInv); + ev.applyMatrix4(mtxInv); + l1Derv.applyMatrix4(mtxInv); + + let sa = angle(sv); + let ea = angle(ev); + let clockwise = ev.cross(l1Derv).z > 0; + let arc = new Arc(new Vector3(), radius, sa, ea, clockwise); + arc.ApplyMatrix(mtx); arc.Center = arcCenter; return { cu1: lineClone1, + cu1Extend, cu2: lineClone2, - arc + cu2Extend, + arc, }; } diff --git a/src/DatabaseServices/Entity/Polyline.ts b/src/DatabaseServices/Entity/Polyline.ts index 8d6645cc9..f2f8b9826 100644 --- a/src/DatabaseServices/Entity/Polyline.ts +++ b/src/DatabaseServices/Entity/Polyline.ts @@ -354,7 +354,8 @@ export class Polyline extends Curve //闭合且起点不等于终点 if (this.m_ClosedMark && - !this.m_LineData[0].pt.equals(arrayLast(this.m_LineData).pt)) + !equalv2(this.m_LineData[0].pt, arrayLast(this.m_LineData).pt) + ) return this.m_LineData.length; return this.m_LineData.length - 1; } @@ -405,6 +406,19 @@ export class Polyline extends Curve this.m_ClosedMark = v; this.Update() } + + DigestionCloseMark() + { + if (this.m_ClosedMark && this.m_LineData.length > 1) + { + this.WriteAllObjectRecord(); + this.m_ClosedMark = false; + + if (!equalv2(this.m_LineData[0].pt, arrayLast(this.m_LineData).pt)) + this.m_LineData.push({ pt: AsVector2(this.m_LineData[0].pt), bul: 0 }); + } + } + get Length() { return this.Explode().reduce((l, cu) => l + cu.Length, 0); diff --git a/src/Geometry/GeUtils.ts b/src/Geometry/GeUtils.ts index 3290ca7c1..2086978e7 100644 --- a/src/Geometry/GeUtils.ts +++ b/src/Geometry/GeUtils.ts @@ -23,6 +23,13 @@ export function isIntersect(amin: number, amax: number, bmin: number, bmax: numb return Math.max(amin, bmin) < Math.min(amax, bmax) + eps; } +export function isIntersect2(a1: number, a2: number, b1: number, b2: number, eps = 0) +{ + if (a1 > a2) [a1, a2] = [a2, a1]; + if (b1 > b2) [b1, b2] = [b2, b1]; + return Math.max(a1, b1) < Math.min(a2, b2) + eps; +} + /** * 旋转一个点,旋转中心在原点 * @param {Vector3} p 点