summaryrefslogtreecommitdiff
path: root/trunk/users/metalab/python/gCalibrator/generate_spiketest.py
blob: c0495bf4ea35af8c84add1d41f7eb8b9a0dc144e (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python

from gcodegen import *
import math

feedrate = 42.0*60
layerHeight = 0.25

testRuns = 10
testHeight = 4.0
testLength = 40.0

rafts = 5 # should  be an odd number :)
raftHeight = (testRuns+2)*testHeight
raftWidth = 5.0
raftParts = int(math.ceil((testLength)/raftWidth))


print "G21"
print "G90"
print "G28"
print "M103"
print "M108 S255.0"


startExtruder()


(x,y,z)=(0,0,layerHeight/2.0)

moveTo(x,y,z,feedrate);

for j in range(0, rafts):
    if (j%2==0):
        for i in range(0, raftParts):
            (x, y) = raftPartX(x, y, raftWidth, raftHeight) 
    else:
        for i in range(0, raftParts):
            (x, y) = raftPartX(x, y, -raftWidth, raftHeight) 
    z += layerHeight
    moveTo(x,y,z,feedrate);


(x,y) = moveToXY(x,y+raftHeight-testHeight)


z += layerHeight
layerStart(z);
moveTo(x,y,z,feedrate);

testStartX = x

for i in range(0, testRuns):
    (x,y) =  moveToXY(0,y)
    (x,y) = sCurveYAbs(x,y,testStartX,y-testHeight)

z += 10
moveTo(x,y,z,feedrate)
print "M103"