PLOT YOUR DRAWING
This is about how you could plot your drawings via https://1milliondrawings.com
From the artwork → drawings
If you have a AxiDrawer-Machine you could plot your drawings from terminal using a python script.
Why should you use it?
Well, because this empowers you to draw online picture you could remote plot out. I'm sure you figure out how to change the script to automatic plot your ideas
If you need help just write me.
And on the other hand just because its possible and a really cool way to interact with your axibot.
- save the code in a .py script (and yeah install axi / json and requests)
- now go and draw some lines @ https://1milliondrawings.com/drawing
- after you saved your drawing, remember or write down your DRAWING-ID
- now open a terminal and load your script
1. you will be asked for a drawing-ID
2. confirm your plot - fun
This is the code you need to connect to 1 million drawings:
from axi import Device, Drawing import json import requests ################################################ ### by 1milliondrawings.com ### ### ### ### 1. go to 1milliondrawings.com/drawing ### ### 2. save your drawing ### ### 3. plot your DRAWING-ID ### ### ### ################################################ def printer(PATH): drawing = Drawing(PATH) d = Device() d.enable_motors() d.run_drawing(drawing) d.disable_motors() def bildprinter(image): try: url = "https://1milliondrawings.com/axipath?nr="+str(image) result = requests.get(url).json() resultat = [] for pfad in result["CORD"]: resu = [(piece['x'], piece['y']) for piece in pfad] resultat.append(resu) print resultat plot = raw_input("PLOT IMAGE ID: "+ str(image) +" OR NOT(y/n)") if(plot == "y"): printer(resultat) else: Anfang() except TypeError: print 'PROBLEM: PLEASE TRY AGAIN OR USE OTHER ID' Anfang() def Anfang(): bildnummer = raw_input("DRAWING NUMBER (#/n): ") if(bildnummer == "n"): exit() else: try: bildprinter(bildnummer) except IOError: print 'oops!' Anfang()
Q:axi for terminal use
Q: how to install Inkscape
Q: how to start axidraw from terminal
sed "s/XYZwrzlprmftXYZ/useful text/g" dummy.svg > useful.svg