|
|
|
@ -132,7 +132,7 @@ describe("闭合多段线", () =>
|
|
|
|
|
}
|
|
|
|
|
//变换曲线顺序
|
|
|
|
|
data =
|
|
|
|
|
[1,"Polyline",1,1,0,false,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],2,5,[22.178278439318607,-1.9155229050126357],0,[22.83746943877066,-1.800164480108526],0,[23.79329638797614,-6.11786552651948],-0.871731137783436,[23.348342463346004,-6.282663276382493],-0.7430788314178012,[22.903388538715866,-6.267501883395095],0,true]
|
|
|
|
|
[1, "Polyline", 1, 1, 0, false, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 5, [22.178278439318607, -1.9155229050126357], 0, [22.83746943877066, -1.800164480108526], 0, [23.79329638797614, -6.11786552651948], -0.871731137783436, [23.348342463346004, -6.282663276382493], -0.7430788314178012, [22.903388538715866, -6.267501883395095], 0, true]
|
|
|
|
|
cus = loadFile(data);
|
|
|
|
|
for (let i = 0.01; i <= 0.33; i += 0.03)
|
|
|
|
|
{
|
|
|
|
@ -567,16 +567,16 @@ describe("不规则不闭合多段线测试", () =>
|
|
|
|
|
cus[0].Reverse();
|
|
|
|
|
expect(cus[0].GetOffsetCurves(-18).length).toBe(2);
|
|
|
|
|
data =
|
|
|
|
|
[1,"Polyline",1,1,0,false,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],2,7,[21.944751443449043,-31.01626057276902],0,[38.129771973149346,-31.016260572769028],0,[32.85929640135194,-26.50707591689791],0,[47.440945483324754,-26.50707591689791],0,[45.33685543194063,-31.016260572769028],0,[61.52187596164093,-31.016260572769035],0,[70.31099992504923,-35.88209931313313],0,false]
|
|
|
|
|
[1, "Polyline", 1, 1, 0, false, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 7, [21.944751443449043, -31.01626057276902], 0, [38.129771973149346, -31.016260572769028], 0, [32.85929640135194, -26.50707591689791], 0, [47.440945483324754, -26.50707591689791], 0, [45.33685543194063, -31.016260572769028], 0, [61.52187596164093, -31.016260572769035], 0, [70.31099992504923, -35.88209931313313], 0, false]
|
|
|
|
|
cus = loadFile(data);
|
|
|
|
|
expect(cus[0].GetOffsetCurves(11.4).length).toBe(1);
|
|
|
|
|
data =
|
|
|
|
|
[1,"Polyline",1,1,0,false,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,-56.21146708819905,-48.62279820279199,0,1],2,7,[26.333787338902418,-31.01626057276902],0,[35.05226039203026,-31.016260572769013],0,[32.85929640135194,-26.50707591689791],0,[47.440945483324754,-26.50707591689791],0,[41.54871106124796,-31.016260572769013],0,[61.52187596164093,-31.016260572769035],0,[70.31099992504923,-35.88209931313313],0,false]
|
|
|
|
|
[1, "Polyline", 1, 1, 0, false, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, -56.21146708819905, -48.62279820279199, 0, 1], 2, 7, [26.333787338902418, -31.01626057276902], 0, [35.05226039203026, -31.016260572769013], 0, [32.85929640135194, -26.50707591689791], 0, [47.440945483324754, -26.50707591689791], 0, [41.54871106124796, -31.016260572769013], 0, [61.52187596164093, -31.016260572769035], 0, [70.31099992504923, -35.88209931313313], 0, false]
|
|
|
|
|
cus = loadFile(data);
|
|
|
|
|
expect(cus[0].GetOffsetCurves(5.2).length).toBe(1);
|
|
|
|
|
|
|
|
|
|
data =
|
|
|
|
|
[1,"Polyline",1,1,0,false,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],2,6,[-3.158640226628895,-0.9915014164305944],0,[-1.0906515580736538,-0.991501416430595],0,[-1.983002832861189,0.18413597733711037],0,[1.0906515580736549,0.3966005665722377],0,[0.2974504249291776,-0.9915014164305944],0,[3.966005665722378,-0.9915014164305953],0,false]
|
|
|
|
|
[1, "Polyline", 1, 1, 0, false, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], 2, 6, [-3.158640226628895, -0.9915014164305944], 0, [-1.0906515580736538, -0.991501416430595], 0, [-1.983002832861189, 0.18413597733711037], 0, [1.0906515580736549, 0.3966005665722377], 0, [0.2974504249291776, -0.9915014164305944], 0, [3.966005665722378, -0.9915014164305953], 0, false]
|
|
|
|
|
cus = loadFile(data);
|
|
|
|
|
expect(cus[0].GetOffsetCurves(2.01133).length).toBe(1);
|
|
|
|
|
})
|
|
|
|
|