summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkintel <kintel@cb376a5e-1013-0410-a455-b6b1f9ac8223>2008-12-16 10:15:25 +0000
committerkintel <kintel@cb376a5e-1013-0410-a455-b6b1f9ac8223>2008-12-16 10:15:25 +0000
commit7d1ce68434a5a6be28cf0550e47d52bde5932a68 (patch)
tree7563439717a84f66b44a04658bd0a9124a70a489
parent91aad67af4e0177869529a15fa558bd733ae8332 (diff)
downloadreprap-backup-7d1ce68434a5a6be28cf0550e47d52bde5932a68.tar.gz
reprap-backup-7d1ce68434a5a6be28cf0550e47d52bde5932a68.zip
some more test glasses
git-svn-id: https://reprap.svn.sourceforge.net/svnroot/reprap@2290 cb376a5e-1013-0410-a455-b6b1f9ac8223
-rwxr-xr-xtrunk/users/metalab/python/spiralglass/bigglass.py80
-rw-r--r--trunk/users/metalab/python/spiralglass/newspiral.py85
-rwxr-xr-xtrunk/users/metalab/python/spiralglass/spiralglass2.py82
-rwxr-xr-xtrunk/users/metalab/python/spiralglass/test2.py88
4 files changed, 335 insertions, 0 deletions
diff --git a/trunk/users/metalab/python/spiralglass/bigglass.py b/trunk/users/metalab/python/spiralglass/bigglass.py
new file mode 100755
index 00000000..3f77f81c
--- /dev/null
+++ b/trunk/users/metalab/python/spiralglass/bigglass.py
@@ -0,0 +1,80 @@
+#!/usr/bin/python
+
+from math import pi, cos, sin
+
+def layerStart(z):
+ print "(<layerStart> %(Z)f)\n" % {'Z':z}
+
+def moveTo(x, y, z, f):
+ print "G1 X%(X)f Y%(Y)f Z%(Z)f F%(F)f" % {'X':x,'Y':y, 'Z':z, 'F':f}
+
+def spiral(x, y, z, f, r, roh, outward):
+ phimax = (2*pi*r)/roh
+ if outward==1:
+ phi = 0.0
+ while (phi < phimax):
+ r = (phi*roh)/(2*pi)
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi += 0.2
+ else:
+ phi = phimax
+ while (phi > 0):
+ r = (phi*roh)/(2*pi)
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi -= 0.2
+
+def circle(x, y, z, f, r, outward):
+ if outward==1:
+ phi = 0.0
+ while (phi < 2*pi):
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi += 0.2
+ else:
+ phi = 2*pi
+ while (phi > 0):
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi -= 0.2
+
+
+
+feedrate = 180
+layerheight = 0.7
+density = 1.2
+radius = 20
+radius1 = 15
+radius2 = 5
+
+layer = layerheight / 2.0
+
+print "G21"
+print "G90"
+print "G28"
+print "M103"
+print "M108 S130.0"
+print "M101"
+
+play = 0
+
+for i in range(5):
+ layerStart(layer);
+ spiral(radius+play, radius+play, layer, feedrate, radius1, density, (i+1)%2)
+ layer += layerheight
+
+for i in range(0, 30):
+ layerStart(layer);
+ circle(radius+play, radius+play, layer, feedrate, radius2, 1)
+ layer += layerheight
+for i in range(0, 60):
+ layerStart(layer);
+ circle(radius+play, radius+play, layer, feedrate, radius2 + i*(radius-radius2)/30.0, 1)
+ layer += layerheight
+
+print "M103"
diff --git a/trunk/users/metalab/python/spiralglass/newspiral.py b/trunk/users/metalab/python/spiralglass/newspiral.py
new file mode 100644
index 00000000..c165918a
--- /dev/null
+++ b/trunk/users/metalab/python/spiralglass/newspiral.py
@@ -0,0 +1,85 @@
+#!/usr/bin/python
+
+from math import pi, cos, sin
+
+def layerStart(z):
+ print "(<layerStart> %(Z)f)\n" % {'Z':z}
+
+def moveTo(x, y, z, f):
+ print "G1 X%(X)f Y%(Y)f Z%(Z)f F%(F)f" % {'X':x,'Y':y, 'Z':z, 'F':f}
+
+def spiral(x, y, z, f, r, roh, outward):
+ phimax = (2*pi*r)/roh
+ if outward==1:
+ phi = 0.0
+ while (phi < phimax):
+ r = (phi*roh)/(2*pi)
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi += 0.2
+ else:
+ phi = phimax
+ while (phi > 0):
+ r = (phi*roh)/(2*pi)
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi -= 0.2
+
+def circle(x, y, z, f, r, outward):
+ if outward==1:
+ phi = 0.0
+ while (phi < 2*pi):
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi += 0.2
+ else:
+ phi = 2*pi
+ while (phi > 0):
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi -= 0.2
+
+
+
+feedrate = 180
+layerheight = 0.7
+density = 1.2
+radius = 12
+
+layer = layerheight / 2.0
+
+print "G21"
+print "G90"
+print "G28"
+print "M103"
+print "M108 S130.0"
+print "M101"
+
+play = 5
+
+layerStart(layer);
+spiral(radius+play, radius+play, layer, feedrate, radius, density, 1)
+layer += layerheight
+
+layerStart(layer);
+spiral(radius+play, radius+play, layer, feedrate, radius, density, 0)
+layer += layerheight
+
+layerStart(layer);
+spiral(radius+play, radius+play, layer, feedrate, radius, density, 1)
+layer += layerheight
+
+for i in range(0, 40):
+ layerStart(layer);
+ circle(radius+play, radius+play, layer, feedrate, radius+sin(i/30.0)*5, 1)
+ layer += layerheight
+
+print "M103"
+
+
+
+
diff --git a/trunk/users/metalab/python/spiralglass/spiralglass2.py b/trunk/users/metalab/python/spiralglass/spiralglass2.py
new file mode 100755
index 00000000..d9278fee
--- /dev/null
+++ b/trunk/users/metalab/python/spiralglass/spiralglass2.py
@@ -0,0 +1,82 @@
+#!/usr/bin/python
+
+from math import pi, cos, sin
+
+def layerStart(z):
+ print "(<layerStart> %(Z)f)\n" % {'Z':z}
+
+def moveTo(x, y, z, f):
+ print "G1 X%(X)f Y%(Y)f Z%(Z)f F%(F)f" % {'X':x,'Y':y, 'Z':z, 'F':f}
+
+def spiral(x, y, z, f, r, roh, outward):
+ phimax = (2*pi*r)/roh
+ if outward==1:
+ phi = 0.0
+ while (phi < phimax):
+ r = (phi*roh)/(2*pi)
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi += 0.2
+ else:
+ phi = phimax
+ while (phi > 0):
+ r = (phi*roh)/(2*pi)
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi -= 0.2
+
+def circle(x, y, z, f, r, outward):
+ if outward==1:
+ phi = 0.0
+ while (phi < 2*pi):
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi += 0.2
+ else:
+ phi = 2*pi
+ while (phi > 0):
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi -= 0.2
+
+
+
+feedrate = 180
+layerheight = 0.7
+density = 1.2
+radius = 12
+
+layer = layerheight / 2.0
+
+print "G21"
+print "G90"
+print "G28"
+print "M103"
+print "M108 S130.0"
+print "M101"
+
+play = 5
+
+layerStart(layer);
+spiral(radius+play, radius+play, layer, feedrate, radius, density, 1)
+layer += layerheight
+layerStart(layer);
+spiral(radius+play, radius+play, layer, feedrate, radius, density, 0)
+layer += layerheight
+layerStart(layer);
+spiral(radius+play, radius+play, layer, feedrate, radius, density, 1)
+layer += layerheight
+for i in range(0, 40):
+ layerStart(layer);
+ circle(radius+play, radius+play, layer, feedrate, radius+sin(i/30.0)*5, 1)
+ layer += layerheight
+
+print "M103"
+
+
+
+
diff --git a/trunk/users/metalab/python/spiralglass/test2.py b/trunk/users/metalab/python/spiralglass/test2.py
new file mode 100755
index 00000000..2123ecc9
--- /dev/null
+++ b/trunk/users/metalab/python/spiralglass/test2.py
@@ -0,0 +1,88 @@
+#!/usr/bin/python
+
+from math import pi, cos, sin
+
+def layerStart(z):
+ print "(<layerStart> %(Z)f)\n" % {'Z':z}
+
+def moveTo(x, y, z, f):
+ print "G1 X%(X)f Y%(Y)f Z%(Z)f F%(F)f" % {'X':x,'Y':y, 'Z':z, 'F':f}
+
+def spiral(x, y, z, f, r, roh, outward):
+ phimax = (2*pi*r)/roh
+ if outward==1:
+ phi = 0.0
+ while (phi < phimax):
+ r = (phi*roh)/(2*pi)
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi += 0.2
+ else:
+ phi = phimax
+ while (phi > 0):
+ r = (phi*roh)/(2*pi)
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi -= 0.2
+
+def circle(x, y, z, f, r, outward):
+ if outward==1:
+ phi = 0.0
+ while (phi < 2*pi):
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi += 0.2
+ else:
+ phi = 2*pi
+ while (phi > 0):
+ nextx= x+cos(phi)*r
+ nexty= y+sin(phi)*r
+ moveTo(nextx, nexty, z, f)
+ phi -= 0.2
+
+
+
+feedrate = 180
+layerheight = 0.7
+density = 1.2
+radius = 12
+radius1 = 7
+radius2 = 3
+
+layer = layerheight / 2.0
+
+print "G21"
+print "G90"
+print "G28"
+print "M103"
+print "M108 S130.0"
+print "M101"
+
+play = 5
+
+layerStart(layer);
+spiral(radius+play, radius+play, layer, feedrate, radius1, density, 1)
+layer += layerheight
+layerStart(layer);
+spiral(radius+play, radius+play, layer, feedrate, radius1, density, 0)
+layer += layerheight
+layerStart(layer);
+spiral(radius+play, radius+play, layer, feedrate, radius1, density, 1)
+layer += layerheight
+layerStart(layer);
+spiral(radius+play, radius+play, layer, feedrate, radius1, density, 0)
+layer += layerheight
+
+for i in range(0, 15):
+ layerStart(layer);
+ circle(radius+play, radius+play, layer, feedrate, radius2, 1)
+ layer += layerheight
+for i in range(0, 30):
+ layerStart(layer);
+ circle(radius+play, radius+play, layer, feedrate, radius2 + i*(radius-radius2)/30.0, 1)
+ layer += layerheight
+
+print "M103"