|
|
@ -777,3 +777,40 @@ test('土偏移因为点在圆弧切线上错误导致的丢失', () =>
|
|
|
|
cus = pl.GetOffsetCurves(801);
|
|
|
|
cus = pl.GetOffsetCurves(801);
|
|
|
|
expect(cus.length).toBe(1);
|
|
|
|
expect(cus.length).toBe(1);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//ISSUE #IKSMH
|
|
|
|
|
|
|
|
test('闭合多段线判断精度和重复交点参数导致偏移丢失', () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let f = new CADFile();
|
|
|
|
|
|
|
|
f.Data =
|
|
|
|
|
|
|
|
[1, ["Polyline", 1, 1, 3, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0.042016806722689815, 0.028011204481792618, 0, 1], 2, 11, [15758.920914649752, -1642.832074394305], 1.1432358165627696, [15758.920914649756, -3551.5797508523133], 0.010240353549940432, [20850.68748853413, -2761.478041111637], 0.39873042440013945, [23564.17781148077, 901.7338948663096], 0.029927117999965277, [22452.27083112051, 6973.8467189556395], 0, [31778.947378692996, 6973.846718955635], 0, [31327.636369627562, 7575.594679533537], 0, [31646.066893308867, 7787.881806674935], 0, [20955.832135358123, 7787.881806674936], 0, [21703.795934364476, 5637.485884531684], -0.559029831351755, [15758.920914649752, -1642.832074394304], 0, false]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
f.Read();
|
|
|
|
|
|
|
|
let pl = f.ReadObject() as Polyline;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let d of [40, 50, 100, 200, 300])
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let cus = pl.GetOffsetCurves(d);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(cus.length).toBe(1);
|
|
|
|
|
|
|
|
expect(cus[0].Length).toMatchSnapshot();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
//ISSUE #IKSMH
|
|
|
|
|
|
|
|
test('简单图形因为点在线内算法错误导致的丢失', () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let f = new CADFile();
|
|
|
|
|
|
|
|
f.Data =
|
|
|
|
|
|
|
|
[1, ["Polyline", 1, 1, 3, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -0.01400560224089542, 0.37815126050420145, 0, 1], 2, 7, [2.075848303393214, 0.09193367302761479], -3.109533447960064, [2.8332320619106284, 1.1077844311377247], 0, [3.542914171656688, 1.1077844311377247], 0, [3.542914171656688, -0.4890219560878247], 0, [2.0758483033932134, -0.4890219560878247], 0, [2.0758483033932134, -0.4890219560878247], 0, [2.0758483033932134, 0.09193367302761501], 0, false]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
f.Read();
|
|
|
|
|
|
|
|
let pl = f.ReadObject() as Polyline;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let d of [0.2, 0.3, 0.4, 0.5])
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
let cus = pl.GetOffsetCurves(d);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(cus.length).toBe(1);
|
|
|
|
|
|
|
|
expect(cus[0].Length).toMatchSnapshot();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|