Skip to content
Snippets Groups Projects
Commit 0d3e8093 authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

move origin

parent 531d9cdd
Branches
No related tags found
No related merge requests found
...@@ -197,13 +197,13 @@ def LoadFile(): ...@@ -197,13 +197,13 @@ def LoadFile():
scale = (plotsize-2)/(xmax-xmin) scale = (plotsize-2)/(xmax-xmin)
else: else:
scale = (plotsize-2)/(ymax-ymin) scale = (plotsize-2)/(ymax-ymin)
xold = plotsize-1 xold = 0
yold = 0 yold = plotsize-1
for segment in range(len(points)): for segment in range(len(points)):
type = points[segment][0] type = points[segment][0]
for point in range(1,len(points[segment]),2): for point in range(1,len(points[segment]),2):
xnew = (plotsize-1)-scale*(xmax-points[segment][point]) xnew = 1+scale*(points[segment][point]-xmin)
ynew = 1+scale*(ymax-points[segment][point+1]) ynew = (plotsize-1)-scale*(points[segment][point+1]-ymin)
if (type == 'PU'): if (type == 'PU'):
Plot.create_line(xold,yold,xnew,ynew,width=1,fill="#FF0000") Plot.create_line(xold,yold,xnew,ynew,width=1,fill="#FF0000")
else: else:
...@@ -315,6 +315,16 @@ Entry(root,textvariable=JogAngleVar,width=15).grid(column=1,row=row,padx=pad,pad ...@@ -315,6 +315,16 @@ Entry(root,textvariable=JogAngleVar,width=15).grid(column=1,row=row,padx=pad,pad
Button(root,text='Jog Angle',command=JogAngle,bg='white').grid(column=2,columnspan=2,row=row,padx=pad,pady=pad) Button(root,text='Jog Angle',command=JogAngle,bg='white').grid(column=2,columnspan=2,row=row,padx=pad,pady=pad)
# #
row += 1 row += 1
Label(root,text='R0 (mm):',bg='white').grid(column=0,row=row,padx=pad)
R0Var = StringVar(root,'100')
Entry(root,textvariable=R0Var,width=15).grid(column=1,row=row,padx=pad,pady=pad)
#
row += 1
Label(root,text='R1 (mm):',bg='white').grid(column=0,row=row,padx=pad)
R1Var = StringVar(root,'100')
Entry(root,textvariable=R1Var,width=15).grid(column=1,row=row,padx=pad,pady=pad)
#
row += 1
Button(root,text='Load HPGL File',command=LoadFile,bg='white').grid(column=0,row=row,padx=pad,pady=pad) Button(root,text='Load HPGL File',command=LoadFile,bg='white').grid(column=0,row=row,padx=pad,pady=pad)
FileNameVar = StringVar(root,'') FileNameVar = StringVar(root,'')
Button(root,text='Draw',command=DrawFile,bg='white').grid(column=1,row=row,padx=pad,pady=pad) Button(root,text='Draw',command=DrawFile,bg='white').grid(column=1,row=row,padx=pad,pady=pad)
...@@ -325,13 +335,13 @@ FileLimits = Label(root,text='',bg='white') ...@@ -325,13 +335,13 @@ FileLimits = Label(root,text='',bg='white')
FileLimits.grid(column=1,row=row,padx=pad,pady=pad) FileLimits.grid(column=1,row=row,padx=pad,pady=pad)
# #
row += 1 row += 1
Label(root,text='origin',bg='white').grid(column=2,row=row,padx=pad,pady=pad,sticky='e')
#
row += 1
Plot = Canvas(root,width=plotsize,height=plotsize,background='white') Plot = Canvas(root,width=plotsize,height=plotsize,background='white')
Plot.grid(column=0,row=row,columnspan=4,padx=pad,pady=pad) Plot.grid(column=0,row=row,columnspan=4,padx=pad,pady=pad)
# #
row += 1 row += 1
Label(root,text='origin',bg='white').grid(column=0,row=row,padx=pad,pady=pad,sticky='e')
#
row += 1
Label(root,text='todo:',bg='white').grid(column=1,row=row,padx=pad,pady=pad) Label(root,text='todo:',bg='white').grid(column=1,row=row,padx=pad,pady=pad)
row += 1 row += 1
Label(root,text='polar geometry transformation',bg='white').grid(column=1,row=row,padx=pad,pady=pad,sticky='w') Label(root,text='polar geometry transformation',bg='white').grid(column=1,row=row,padx=pad,pady=pad,sticky='w')
......
IN;SP1;PU4667,2348;PD4662,2346,4658,2343,4657,2337,4659,2332,4663,2329,4667,2328,4664,2212,4663,2212,4655,2098,4654,2098,4640,1984,4620,1872,4595,1761,4594,1761,4564,1651,4563,1651,4528,1543,4527,1543,4486,1438,4440,1334,4439,1334,4388,1233,4332,1134,4331,1134,4270,1038,4204,944,4204,945,4134,854,4133,855,4058,768,3978,684,3978,685,3894,605,3807,530,3806,531,3716,460,3716,461,3622,395,3526,334,3525,335,3426,279,3325,228,3324,229,3221,183,3220,183,3114,142,3114,143,3006,107,2897,77,2896,78,2785,52,2785,53,2673,33,2673,34,2559,20,2444,12,2329,9,2329,10,2213,13,2099,22,1985,36,1985,37,1872,56,1873,57,1761,82,1652,113,1544,149,1438,190,1439,191,1335,237,1233,288,1234,289,1135,345,1038,406,1039,406,945,472,946,473,855,543,768,618,769,619,685,698,685,699,606,782,606,783,531,870,461,961,396,1054,396,1055,335,1151,336,1151,280,1250,229,1352,230,1352,184,1456,143,1562,144,1562,108,1670,78,1780,53,1891,54,1891,34,2004,35,2004,20,2118,21,2118,12,2232,13,2232,10,2348,11,2348,13,2463,14,2463,22,2578,23,2578,37,2692,38,2692,57,2804,58,2804,83,2915,114,3025,150,3132,191,3238,192,3238,238,3342,289,3443,290,3443,346,3542,407,3638,473,3731,544,3821,619,3908,620,3908,699,3991,700,3991,783,4071,784,4070,871,4145,961,4215,962,4215,1055,4281,1055,4280,1152,4341,1251,4397,1251,4396,1353,4447,1457,4493,1563,4533,1671,4569,1671,4568,1781,4599,1781,4598,1892,4623,2005,4642,2118,4656,2119,4656,2233,4664,2349,4666,2468,4663,2468,4662,2587,4653,2703,4638,2818,4617,2930,4591,2930,4590,3041,4559,3041,4558,3149,4522,3149,4521,3254,4480,3254,4479,3357,4432,3457,4381,3457,4380,3555,4324,3554,4324,3649,4263,3740,4198,3740,4197,3828,4128,3827,4128,3912,4055,3911,4054,3992,3977,4069,3896,4142,3811,4211,3723,4210,3723,4275,3632,4275,3631,4335,3537,4391,3439,4442,3338,4488,3235,4529,3129,4566,3021,4565,3021,4596,2910,4622,2797,4621,2797,4642,2683,4641,2683,4656,2566,4665,2448,4664,2448,4667,2328,4666,2288,4667,2348;PU;SP0;IN; IN;SP1;PU4667,2348;PD4662,2346,4658,2343,4657,2337,4659,2332,4663,2329,4667,2328,4664,2212,4663,2212,4655,2098,4654,2098,4640,1984,4620,1872,4595,1761,4594,1761,4564,1651,4563,1651,4528,1543,4527,1543,4486,1438,4440,1334,4439,1334,4388,1233,4332,1134,4331,1134,4270,1038,4204,944,4204,945,4134,854,4133,855,4058,768,3978,684,3978,685,3894,605,3807,530,3806,531,3716,460,3716,461,3622,395,3526,334,3525,335,3426,279,3325,228,3324,229,3221,183,3220,183,3114,142,3114,143,3006,107,2897,77,2896,78,2785,52,2785,53,2673,33,2673,34,2559,20,2444,12,2329,9,2329,10,2213,13,2099,22,1985,36,1985,37,1872,56,1873,57,1761,82,1652,113,1544,149,1438,190,1439,191,1335,237,1233,288,1234,289,1135,345,1038,406,1039,406,945,472,946,473,855,543,768,618,769,619,685,698,685,699,606,782,606,783,531,870,461,961,396,1054,396,1055,335,1151,336,1151,280,1250,229,1352,230,1352,184,1456,143,1562,144,1562,108,1670,78,1780,53,1891,54,1891,34,2004,35,2004,20,2118,21,2118,12,2232,13,2232,10,2348,11,2348,13,2463,14,2463,22,2578,23,2578,37,2692,38,2692,57,2804,58,2804,83,2915,114,3025,150,3132,191,3238,192,3238,238,3342,289,3443,290,3443,346,3542,407,3638,473,3731,544,3821,619,3908,620,3908,699,3991,700,3991,783,4071,784,4070,871,4145,961,4215,962,4215,1055,4281,1055,4280,1152,4341,1251,4397,1251,4396,1353,4447,1457,4493,1563,4533,1671,4569,1671,4568,1781,4599,1781,4598,1892,4623,2005,4642,2118,4656,2119,4656,2233,4664,2349,4666,2468,4663,2468,4662,2587,4653,2703,4638,2818,4617,2930,4591,2930,4590,3041,4559,3041,4558,3149,4522,3149,4521,3254,4480,3254,4479,3357,4432,3457,4381,3457,4380,3555,4324,3554,4324,3649,4263,3740,4198,3740,4197,3828,4128,3827,4128,3912,4055,3911,4054,3992,3977,4069,3896,4142,3811,4211,3723,4210,3723,4275,3632,4275,3631,4335,3537,4391,3439,4442,3338,4488,3235,4529,3129,4566,3021,4565,3021,4596,2910,4622,2797,4621,2797,4642,2683,4641,2683,4656,2566,4665,2448,4664,2448,4667,2328,4666,2288,4667,2348;PU0,0;SP0;IN;
IN;SP1;PU1712,2778;PD1707,2777,1703,2773,1702,2768,1704,2762,1708,2759,1712,2758,1711,2616,1707,2476,1702,2338,1701,2338,1694,2202,1684,2069,1673,1938,1659,1810,1644,1685,1627,1563,1626,1563,1608,1444,1607,1444,1587,1328,1565,1216,1564,1216,1541,1108,1540,1108,1515,1004,1488,904,1460,809,1430,717,1399,631,1366,549,1333,472,1332,472,1298,401,1297,401,1262,334,1261,335,1225,274,1224,274,1186,219,1147,170,1107,127,1107,128,1066,90,1066,91,1024,60,1024,61,982,37,981,38,939,21,938,22,895,12,895,13,851,10,851,11,807,15,807,16,764,27,765,28,722,46,723,47,681,71,681,72,640,103,641,104,600,141,601,142,562,185,562,186,523,235,524,235,486,291,487,291,450,352,415,418,415,419,381,490,381,491,348,567,348,568,316,649,316,650,285,736,286,736,256,828,228,923,228,924,202,1024,177,1128,153,1236,131,1348,111,1463,92,1582,75,1705,76,1705,60,1830,47,1958,36,2089,26,2222,27,2222,19,2358,14,2496,11,2636,10,2778,11,2915,14,3051,20,3185,27,3319,36,3450,48,3580,61,3708,76,3833,93,3956,112,4076,132,4194,133,4194,155,4308,179,4418,205,4525,233,4629,233,4628,262,4728,262,4727,293,4822,325,4911,325,4910,358,4994,359,4994,393,5072,393,5071,428,5143,429,5143,465,5210,465,5209,502,5270,503,5269,541,5324,580,5372,581,5371,620,5414,621,5413,661,5449,662,5448,702,5478,703,5477,744,5500,744,5499,786,5516,786,5515,828,5525,829,5523,871,5526,871,5525,913,5521,913,5520,955,5510,954,5508,996,5492,995,5491,1036,5467,1036,5466,1076,5437,1076,5436,1116,5400,1115,5399,1155,5357,1154,5356,1193,5308,1192,5308,1230,5253,1267,5192,1266,5192,1303,5126,1302,5125,1337,5053,1371,4975,1404,4892,1435,4803,1466,4708,1465,4708,1495,4609,1494,4609,1522,4506,1521,4506,1547,4399,1571,4288,1593,4174,1613,4057,1632,3936,1648,3813,1663,3688,1676,3560,1687,3430,1696,3299,1703,3165,1708,3031,1711,2895,1712,2758,1711,2718,1712,2778;PU;SP0;IN; IN;SP1;PU1712,2778;PD1707,2777,1703,2773,1702,2768,1704,2762,1708,2759,1712,2758,1711,2616,1707,2476,1702,2338,1701,2338,1694,2202,1684,2069,1673,1938,1659,1810,1644,1685,1627,1563,1626,1563,1608,1444,1607,1444,1587,1328,1565,1216,1564,1216,1541,1108,1540,1108,1515,1004,1488,904,1460,809,1430,717,1399,631,1366,549,1333,472,1332,472,1298,401,1297,401,1262,334,1261,335,1225,274,1224,274,1186,219,1147,170,1107,127,1107,128,1066,90,1066,91,1024,60,1024,61,982,37,981,38,939,21,938,22,895,12,895,13,851,10,851,11,807,15,807,16,764,27,765,28,722,46,723,47,681,71,681,72,640,103,641,104,600,141,601,142,562,185,562,186,523,235,524,235,486,291,487,291,450,352,415,418,415,419,381,490,381,491,348,567,348,568,316,649,316,650,285,736,286,736,256,828,228,923,228,924,202,1024,177,1128,153,1236,131,1348,111,1463,92,1582,75,1705,76,1705,60,1830,47,1958,36,2089,26,2222,27,2222,19,2358,14,2496,11,2636,10,2778,11,2915,14,3051,20,3185,27,3319,36,3450,48,3580,61,3708,76,3833,93,3956,112,4076,132,4194,133,4194,155,4308,179,4418,205,4525,233,4629,233,4628,262,4728,262,4727,293,4822,325,4911,325,4910,358,4994,359,4994,393,5072,393,5071,428,5143,429,5143,465,5210,465,5209,502,5270,503,5269,541,5324,580,5372,581,5371,620,5414,621,5413,661,5449,662,5448,702,5478,703,5477,744,5500,744,5499,786,5516,786,5515,828,5525,829,5523,871,5526,871,5525,913,5521,913,5520,955,5510,954,5508,996,5492,995,5491,1036,5467,1036,5466,1076,5437,1076,5436,1116,5400,1115,5399,1155,5357,1154,5356,1193,5308,1192,5308,1230,5253,1267,5192,1266,5192,1303,5126,1302,5125,1337,5053,1371,4975,1404,4892,1435,4803,1466,4708,1465,4708,1495,4609,1494,4609,1522,4506,1521,4506,1547,4399,1571,4288,1593,4174,1613,4057,1632,3936,1648,3813,1663,3688,1676,3560,1687,3430,1696,3299,1703,3165,1708,3031,1711,2895,1712,2758,1711,2718,1712,2778;PU0,0;SP0;IN;
IN;SP1;PU4153,549;PD4147,548,4144,544,4143,539,4144,534,4148,530,4152,529,4149,502,4147,502,4139,475,4137,476,4124,450,4123,450,4105,424,4104,425,4081,399,4080,400,4052,375,4051,376,4019,351,4018,352,3981,328,3940,305,3939,305,3894,282,3893,283,3844,261,3843,261,3789,240,3732,219,3670,199,3670,200,3536,162,3536,163,3389,129,3229,98,3229,99,3059,72,3059,73,2878,50,2878,51,2687,33,2489,20,2283,12,2283,13,2071,10,1866,13,1665,21,1469,34,1279,51,1096,74,922,100,922,101,759,132,607,167,607,168,536,187,469,207,407,227,407,228,349,249,294,271,295,272,245,294,245,295,200,318,159,342,123,366,123,367,92,391,92,392,65,417,66,418,43,443,44,444,27,469,28,470,16,496,17,496,10,523,11,523,9,549,11,549,13,575,15,575,23,601,24,600,37,626,38,626,56,651,57,650,79,676,80,675,107,700,107,699,139,724,140,723,176,747,217,770,263,793,263,792,313,815,367,836,426,857,488,878,489,877,555,897,626,916,778,951,778,950,942,981,1116,1008,1116,1007,1298,1029,1299,1029,1489,1046,1685,1059,1685,1058,1886,1066,2091,1068,2303,1065,2509,1057,2707,1044,2897,1026,3078,1003,3249,976,3409,946,3409,945,3556,911,3555,911,3689,873,3751,853,3750,852,3808,832,3808,831,3862,810,3862,809,3912,787,3911,787,3957,764,3998,740,4035,716,4035,715,4067,690,4095,665,4094,664,4117,638,4116,638,4134,612,4133,611,4146,584,4145,584,4153,557,4151,556,4154,529,4152,529,4149,502,4147,502,4143,490,4153,549;PU;SP0;IN; IN;SP1;PU4153,549;PD4147,548,4144,544,4143,539,4144,534,4148,530,4152,529,4149,502,4147,502,4139,475,4137,476,4124,450,4123,450,4105,424,4104,425,4081,399,4080,400,4052,375,4051,376,4019,351,4018,352,3981,328,3940,305,3939,305,3894,282,3893,283,3844,261,3843,261,3789,240,3732,219,3670,199,3670,200,3536,162,3536,163,3389,129,3229,98,3229,99,3059,72,3059,73,2878,50,2878,51,2687,33,2489,20,2283,12,2283,13,2071,10,1866,13,1665,21,1469,34,1279,51,1096,74,922,100,922,101,759,132,607,167,607,168,536,187,469,207,407,227,407,228,349,249,294,271,295,272,245,294,245,295,200,318,159,342,123,366,123,367,92,391,92,392,65,417,66,418,43,443,44,444,27,469,28,470,16,496,17,496,10,523,11,523,9,549,11,549,13,575,15,575,23,601,24,600,37,626,38,626,56,651,57,650,79,676,80,675,107,700,107,699,139,724,140,723,176,747,217,770,263,793,263,792,313,815,367,836,426,857,488,878,489,877,555,897,626,916,778,951,778,950,942,981,1116,1008,1116,1007,1298,1029,1299,1029,1489,1046,1685,1059,1685,1058,1886,1066,2091,1068,2303,1065,2509,1057,2707,1044,2897,1026,3078,1003,3249,976,3409,946,3409,945,3556,911,3555,911,3689,873,3751,853,3750,852,3808,832,3808,831,3862,810,3862,809,3912,787,3911,787,3957,764,3998,740,4035,716,4035,715,4067,690,4095,665,4094,664,4117,638,4116,638,4134,612,4133,611,4146,584,4145,584,4153,557,4151,556,4154,529,4152,529,4149,502,4147,502,4143,490,4153,549;PU0,0;SP0;IN;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment