From bd33a24d74ce7454d514fc6212c433880c6e164b Mon Sep 17 00:00:00 2001 From: ChenX Date: Fri, 20 Jul 2018 11:47:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E7=94=A8?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __test__/Polyline/__snapshots__/offset.test.ts.snap | 8 ++++++++ __test__/Polyline/offset.test.ts | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/__test__/Polyline/__snapshots__/offset.test.ts.snap b/__test__/Polyline/__snapshots__/offset.test.ts.snap index 598e8f59f..0f505651d 100644 --- a/__test__/Polyline/__snapshots__/offset.test.ts.snap +++ b/__test__/Polyline/__snapshots__/offset.test.ts.snap @@ -96,6 +96,14 @@ exports[`简单图形因为点在线内算法错误导致的丢失 3`] = `6.8026 exports[`简单图形因为点在线内算法错误导致的丢失 4`] = `6.045609380056393`; +exports[`纯圆生成的多段线偏移 1`] = `1`; + +exports[`纯圆生成的多段线偏移 2`] = `7585.215254159188`; + +exports[`纯圆生成的多段线偏移 3`] = `1`; + +exports[`纯圆生成的多段线偏移 4`] = `6328.578192723271`; + exports[`补充bug测试 1`] = `7385.123391644447`; exports[`补充bug测试 2`] = `7455.861403941378`; diff --git a/__test__/Polyline/offset.test.ts b/__test__/Polyline/offset.test.ts index 855da0bee..7760390e7 100644 --- a/__test__/Polyline/offset.test.ts +++ b/__test__/Polyline/offset.test.ts @@ -889,3 +889,14 @@ test('多段线存在0长度线段导致偏移错误', () => testOffset(pl, 400); testOffset(pl, -400); }); + + +test('纯圆生成的多段线偏移', () => +{ + let pl = loadFile( + [1, ["Polyline", 1, 1, 710, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1904.6173097681894, -4.547473508864641e-13, 0, 1], 2, 2, [18361.211643461193, 495.8146231175723], 0.7691548555148293, [18910.40925296759, 2564.4589522583397], 1.3001283068422635, true]] + )[0]; + + testOffset(pl, 100); + testOffset(pl, -100); +});