-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcurl_test_version5
56 lines (37 loc) · 1.51 KB
/
curl_test_version5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
output = file("C:\Users\Alec\Desktop\python\curltest_ver5.gcode",'w') #write this fil
laserpower = 18
output.write('M649 S' + str(laserpower)+ '\n')
output.write('G21'+ '\n') #set units to mm
output.write('G90'+ '\n') # use absolute coordinates
output.write('M83'+ '\n') # turn on motor for powder feeder
startx = 20
endx= 50
starty = 20
endy = 16
movespeed = 7800
scanspeed = 500
startlayer = 0
finallayer = 9
feedlayer =.45
partlayer=.15
plowspeed=3000
#first loop is for layer changes, 2nd is for scanning horizontal lines
for z in range (startlayer, finallayer):
output.write('G0 X-100 F3000; end of layer' +'\n')
output.write('T0 ' +'\n') # partbed piston
output.write('G0 E' + str(partlayer) +' F200' +'\n')
output.write('T1' +'\n') #feeder piston
output.write('G0 E' + str(feedlayer) +' F200' +'\n')
output.write('G0 Z-244 F' +str(plowspeed) +'\n') #moving plow
output.write('G0 Z0 F' +str(plowspeed) +'\n') #bring plow back
#drange2 is used to change Y increments,
def drange2(start, stop, step):
numelements = int((stop-start)/float(step))
for y in range(numelements+1):
yield start + y*step
#this for loop is for scanning the horizontal lines
for y in drange2(starty,endy+starty, 0.5):
output.write('G0 X' + str(startx) + ' Y' + str(y)+' F' + str(movespeed)+'\n')
output.write('G1 X' + str(endx) + ' Y' + str(y)+' F' + str(scanspeed)+'\n')
output.write('G0 X-200 F3000; turn off laser, done with build')
output.close()