Marco Spitzbarth

The End of the F***ing Internet

Benutzer-Werkzeuge

Webseiten-Werkzeuge


art:drawing

1MILLIONDRAWINGS.COM

https://1milliondrawings.com/

! under constructions !

1milliondrawings exhibited

photos: Angela Osterwalder


2017, MuDa, Zürich


2017, ZHdK, Zürich



PLOT YOUR DRAWING

This is about how you could plot your drawings via https://1milliondrawings.com
From the artwork → drawings

If you have an AxiDrawer-Machine you could plot your drawings from the terminal using a python script.
Why should you use it?

Well, because this empowers you to draw an 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 it's possible and a really cool way to interact with your axibot.

  1. save the code in a .py script (and yeah install axi / json and requests)
  2. now go and draw some lines @ https://1milliondrawings.com/drawing
  3. after you saved your drawing, remember or write down your DRAWING-ID
  4. now open a terminal and load your script
    1. you will be asked for a drawing-ID
    2. confirm your plot
  5. 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

art/drawing.txt · Zuletzt geändert: 2019/09/02 15:47 von spitz