Exploratory scripts for laser cutter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

  1. #!/usr/bin/env python3
  2. import svgturtle
  3. print('<svg viewBox="0 0 2000 2000" xmlns="http://www.w3.org/2000/svg">')
  4. turtle_tl = svgturtle.SvgTurtle(500, 750)
  5. turtle_tr = svgturtle.SvgTurtle(1500, 750)
  6. turtle_bl = svgturtle.SvgTurtle(500, 1000)
  7. turtle_br = svgturtle.SvgTurtle(1500, 1000)
  8. ANGLE=0
  9. for i in range(7):
  10. turtle_tl.home()
  11. turtle_tl.left(ANGLE)
  12. turtle_tl.circle(110+i*50, (i+1)*45, 50)
  13. turtle_bl.home()
  14. turtle_bl.right(ANGLE)
  15. turtle_bl.circle(-(110+i*50), (i+1)*45, 50)
  16. turtle_tr.home()
  17. turtle_tr.right(ANGLE)
  18. turtle_tr.circle(140+i*50, (i+1)*45, 50)
  19. turtle_br.home()
  20. turtle_br.left(ANGLE)
  21. turtle_br.circle(-(140+i*50), (i+1)*45, 50)
  22. print('<path fill="none" stroke="black" d="%s %s %s %s"/>' % (turtle_tl.to_s(), turtle_tr.to_s(), turtle_bl.to_s(), turtle_br.to_s()))
  23. turtle_tl.reset()
  24. turtle_tr.reset()
  25. turtle_bl.reset()
  26. turtle_br.reset()
  27. for i in range(8):
  28. turtle_tl.home()
  29. turtle_tl.left(ANGLE)
  30. turtle_tl.circle(100+i*50, (i+1)*45)
  31. turtle_bl.home()
  32. turtle_bl.right(ANGLE)
  33. turtle_bl.circle(-(100+i*50), (i+1)*45)
  34. turtle_tr.home()
  35. turtle_tr.right(ANGLE)
  36. turtle_tr.circle(130+i*50, (i+1)*45)
  37. turtle_br.home()
  38. turtle_br.left(ANGLE)
  39. turtle_br.circle(-(130+i*50), (i+1)*45)
  40. print('<path fill="none" stroke="blue" d="%s %s %s %s"/>' % (turtle_tl.to_s(), turtle_tr.to_s(), turtle_bl.to_s(), turtle_br.to_s()))
  41. print('</svg>')