Skip to content

Instantly share code, notes, and snippets.

@cassiel
Created December 28, 2018 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cassiel/23aaa3d827fc6a764d409644524afd4d to your computer and use it in GitHub Desktop.
Save cassiel/23aaa3d827fc6a764d409644524afd4d to your computer and use it in GitHub Desktop.
# start coding here or load an example from the dropdown above!
lp.start()
gcode('M105')
lp.dist(50).go(1)
lp.turn(180).dist(50).go(1)
lp.extrude({'e': 5, 'speed': 5})
lp.moveto({'x': lp.minx + 20, 'y': lp.maxy - 20, 'speed': 80})
lp.angle(0)
lp.moveto({'x': lp.minx + 60, 'y': lp.maxy - 60})
lp.dist(30).go(1).turn(180).dist(30).go(1)
lp.turn(10).dist(30).go(1).turn(180).dist(30).go(1)
lp.turn(5).dist(30).go(1, False).turn(180).dist(30).go(1, False)
# GO:
gcode("G28")
lp.moveto({'x': lp.minx + 60, 'y': lp.maxy - 60})
for i in range(90 // 5):
lp.turn(5).dist(30).go(1, False).turn(180).dist(30).go(1, False)
lp.retract()
lp.move({'z': 50})
lp.moveto({'z': 0.2})
lp.lh(0.15)
print(lp._heading)
lp.wait(500)
# >>>>>
import math
lp.layerHeight = 0.15
def foo():
d = 10
lp.extrude({'z': d, 'speed' : 10, 'retract': True})
lp.wait(2000)
lp.extrude({'z': -d, 'x': d * math.cos(lp._heading), 'y': d * math.sin(lp._heading), 'speed': 10, 'retract': True})
lp.unretract()
lp.dist(5).go(1, False)
foo()
foo()
lp.retract()
# <<<<<
lp.turn(180)
lp.moveto({'z': 80})
lp.moveto({'z': 0.25, 'x': lp.maxx/2, 'y': lp.maxy / 2})
lp.moveto({'z': 0.25, 'x': lp.minx+90, 'y': lp.maxy - 90})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment