|
|
@ -10,7 +10,8 @@ function loadFile(data)
|
|
|
|
let file = new CADFile();
|
|
|
|
let file = new CADFile();
|
|
|
|
file.Data = data;
|
|
|
|
file.Data = data;
|
|
|
|
let cus: Curve[] = [];
|
|
|
|
let cus: Curve[] = [];
|
|
|
|
for (let i = 0; i < file.Data.length; i++)
|
|
|
|
let count = file.Read();
|
|
|
|
|
|
|
|
for (let i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cus.push(file.ReadObject(undefined) as Curve);
|
|
|
|
cus.push(file.ReadObject(undefined) as Curve);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -57,8 +58,8 @@ test('IKKGK圆与直线补圆弧', () =>
|
|
|
|
|
|
|
|
|
|
|
|
test('多段线偏移测试1', () =>
|
|
|
|
test('多段线偏移测试1', () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let data = [["Polyline", 1, 1, 3, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 4, [6.059716713881022, 3.983456090651555], 1.1217395195062214, [6.383002832861191, 4.064022662889515], 0, [4.929178470254959, 8.399433427762037], 1.2642365052895204, [5.750708215297452, 4.050991501416427], 0.7171789779484218, true]];
|
|
|
|
let data =
|
|
|
|
|
|
|
|
[1, ["Polyline", 1, 1, 3, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 4, [6.059716713881022, 3.983456090651555], 1.1217395195062214, [6.383002832861191, 4.064022662889515], 0, [4.929178470254959, 8.399433427762037], 1.2642365052895204, [5.750708215297452, 4.050991501416427], 0.7171789779484218, true]]
|
|
|
|
let cus = loadFile(data);
|
|
|
|
let cus = loadFile(data);
|
|
|
|
for (let i = 0; i < 10; i += 0.01)
|
|
|
|
for (let i = 0; i < 10; i += 0.01)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -75,7 +76,8 @@ test('多段线偏移测试1', () =>
|
|
|
|
})
|
|
|
|
})
|
|
|
|
test('多段线偏移测试2', () =>
|
|
|
|
test('多段线偏移测试2', () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let data = [["Polyline", 1, 1, 734, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 4, [8.176442643449754, 4.003694129881114], 0.6482011490054378, [8.554554536583165, 4.090460859042256], 0, [7.7292787370841225, 8.733182129315965], 0, [7.8227800907745895, 4.037582052934876], 1.223388515290821, true]];
|
|
|
|
let data =
|
|
|
|
|
|
|
|
[1, ["Polyline", 1, 1, 734, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 4, [8.176442643449754, 4.003694129881114], 0.6482011490054378, [8.554554536583165, 4.090460859042256], 0, [7.7292787370841225, 8.733182129315965], 0, [7.8227800907745895, 4.037582052934876], 1.223388515290821, true]]
|
|
|
|
|
|
|
|
|
|
|
|
let cus = loadFile(data);
|
|
|
|
let cus = loadFile(data);
|
|
|
|
expect(cus[0].GetOffsetCurves(-0.1799).length).toBe(2);
|
|
|
|
expect(cus[0].GetOffsetCurves(-0.1799).length).toBe(2);
|
|
|
@ -99,7 +101,8 @@ test('多段线偏移测试2', () =>
|
|
|
|
})
|
|
|
|
})
|
|
|
|
test('多段线偏移测试3', () =>
|
|
|
|
test('多段线偏移测试3', () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let data = [["Polyline", 1, 1, 1172, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 5, [12.52535684411379, 4.512623511896158], 0.39558516940595195, [13.121416971132648, 4.487590129452889], 0, [12.414545456418505, 8.796498405316765], 0, [12.015990240675425, 8.743859037199755], 0, [12.015990240675425, 4.4951100391838885], 0.8508932598252141, true]];
|
|
|
|
let data =
|
|
|
|
|
|
|
|
[1, ["Polyline", 1, 1, 1172, false, 7, -1, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 5, [12.52535684411379, 4.512623511896158], 0.39558516940595195, [13.121416971132648, 4.487590129452889], 0, [12.414545456418505, 8.796498405316765], 0, [12.015990240675425, 8.743859037199755], 0, [12.015990240675425, 4.4951100391838885], 0.8508932598252141, true]]
|
|
|
|
|
|
|
|
|
|
|
|
let cus = loadFile(data);
|
|
|
|
let cus = loadFile(data);
|
|
|
|
for (let i = 0; i < 10; i += 1)
|
|
|
|
for (let i = 0; i < 10; i += 1)
|
|
|
|