All Projects → pixelpusher → liveprinter

pixelpusher / liveprinter

Licence: AGPL-3.0 license
Livecoding for 3D printers

Programming Languages

G-code
73 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
python
139335 projects - #7 most used programming language
HTML
75241 projects
Max
122 projects

Projects that are alternatives of or similar to liveprinter

FABlin
The FABtotum Personal Fabricator Firmware, a Marlin derivate made to support hybrid manufacturing and digital acquisition
Stars: ✭ 19 (-36.67%)
Mutual labels:  marlin, 3d-printing
BCN3DSigma-Firmware
Custom Marlin version for the brand new BCN3D Sigma from BCN3D Technologies
Stars: ✭ 81 (+170%)
Mutual labels:  marlin, 3d-printing
PrntrBoardV2
32-bit 3D Printer controller board using STM32F407 and replaceable TMC2660/2209 stepper drivers.
Stars: ✭ 31 (+3.33%)
Mutual labels:  marlin, 3d-printing
tilt
Live coding bytebeat-style language for the web
Stars: ✭ 30 (+0%)
Mutual labels:  livecoding
vasaro
Vasaro let you create 3d printable vases in a snap.
Stars: ✭ 30 (+0%)
Mutual labels:  3d-printing
TheMiniIndex
Crowd-sourced library of 3d models (minis, terrain, scatter, etc.) for D&D, Pathfinder, and other tabletop games.
Stars: ✭ 17 (-43.33%)
Mutual labels:  3d-printing
hydra-antlia
A collection of functions for Hydra
Stars: ✭ 45 (+50%)
Mutual labels:  livecoding
OctoPrint-MultiColors
Inject GCODE at specified layers to allow multi color printing via filament change
Stars: ✭ 20 (-33.33%)
Mutual labels:  3d-printing
desktop-duplication-cpp
Windows Desktop Duplication Tool for live coding presentations in C++2a
Stars: ✭ 51 (+70%)
Mutual labels:  livecoding
openscad-rpi-library
OpenSCAD library of various objects to use in Raspberry Pi-based projects
Stars: ✭ 30 (+0%)
Mutual labels:  3d-printing
improviz
A live-coded visual performance tool
Stars: ✭ 85 (+183.33%)
Mutual labels:  livecoding
sonic-pi.el
Emacs running SonicPi
Stars: ✭ 79 (+163.33%)
Mutual labels:  livecoding
threedy
Home Assistant card for 3D printer status and management.
Stars: ✭ 159 (+430%)
Mutual labels:  3d-printing
U8glib-HAL
Customized U8glib for use in Marlin 2.0
Stars: ✭ 40 (+33.33%)
Mutual labels:  3d-printing
tronxy-xy100
Working with an inexpensive 3D printer, Other names: STARTT (from imakr.com) or Anet A8
Stars: ✭ 22 (-26.67%)
Mutual labels:  3d-printing
mini-map-maker
A tool for automatically generating 3D printable STLs from freely available lidar scan data.
Stars: ✭ 51 (+70%)
Mutual labels:  3d-printing
Sand-Table
An open-source platform for building DIY sand tables (like the Sisyphus or ZenXY)
Stars: ✭ 99 (+230%)
Mutual labels:  marlin
perl-live
perl live coding
Stars: ✭ 13 (-56.67%)
Mutual labels:  livecoding
SmartSpin2k
Transform your spin bike into a Smart Trainer!
Stars: ✭ 88 (+193.33%)
Mutual labels:  3d-printing
boombeastic
A Raspberry Pi based smart connected speaker with support for airplay, spotify, mpd and local playback
Stars: ✭ 206 (+586.67%)
Mutual labels:  3d-printing

LivePrinter: Livecoding meets 3D printing

Experiments in live computational sculpting

LivePrinter is an open source system for live, intuitive, immediate drawing and fabrication with 3D printers. It allows people to directly draw shapes, lines, and complex objects using only code. The system serves as an introduction to the basics of 3D printing, as well as platform for experimenting with new techniques that are not allowed by current software. It also allows users to create physical forms using different functions that take into account physical properties like speed and temperature, instead of the usual visual modelling techniques. As a live performance system, LivePrinter blends mechanical music, sculpture and moving image together. It allows musical concepts and visual aesthetics to directly influence digital manufacturing toolpaths and vice versa. It demonstrates a possible future path where humans play a direct, creatively-rewarding part in a system of semi-automated, digital manufacturing.

Getting involved

There's a forum on https://talk.lurk.org/channel/liveprinter

You can join our email list to keep up to date with performances, demonstrations, workshops, and important updates.

Evan is on Twitter at @evanraskob and can answer questions, etc.

We can create a Reddit forum or YouTube channel if there is demand for it.

Installing and Running

A quickstart document can be found here -- this needs an update! It is fairly out of date.

The server front-end is coded in JavaScript using NodeJS's npm build system. You will need to compile it first (or download a pre-compiled release) so download and unzip the project using the link in the above right. Then, in your project folder, open a command prompt. Make sure you have npm installed.

  1. Run npm install to install required modules
    • On OS X, it's recommended to use the 'official' NodeJS from https://nodejs.org/en/download/ instead of brew because there might be an error with building node-gyp. Then, when nodejs is installed, install node-gyp using sudo npm install node-gyp -g before running npm install.
  2. For production, build streamlined javascript by running npm run build and following the instructions below to get the python server up and running.
  3. For development, run npm run watch to have any saved changed automatically re-compiled.
  4. Open a second terminal and run npm run run to run the server, or

The web server (tornado 6) runs on Python 3 (3.6, 3.7 and 3.8+ tested) so you will need that installed. Then, use pip (the Python package manager) to install supporting libraries python3 -m pip pyserial tornado tornado-jsonrpc2:

  • pyserial (tested with 3.4+)
  • tornado (tested with 6.0.1+)
  • tornado-jsonrpc2 (tested with 0.5+)

Run the server using your Python environment of choice. The server script is in the liveprinter subfolder and is called LivePrinterServer.py, so change to that folder using cd liveprinter and run:

python LivePrinterServer.py

By default, the server runs on port 8888 so open a web browser to http://localhost:8888 (or change it). It can be run without an actual 3D printer using a "fake" serial port, check the videos or look for the dummy printer in the drop down menu when you've got it running.

Here is a short (old!) video demonstrating the python installation on Windows (on OS X it's the same, just use Terminal instead of Command Prompt): https://youtu.be/ejlaQhOCUHw

Using LivePrinter

A short video to get up and running in 2 minutes (assuming you've plugged your printer into your computer via USB and turned it on!)

video of LivePrinter in action

Try these instructions for using the livecoding editor and controlling the printer.

About

LivePrinter is an open source system for live, immediate drawing and fabrication with 3D printers. It’s particularly useful for:

  • Textile artists who want to print onto fabrics and make new shapes and textures; for artists who want to use a printer like a 3D plotter and draw new forms
  • Product and industrial designers who want to understand more about how 3D printing works and fine-tune their materials and tool paths
  • Materials scientists who want to study 3D printing materials in more controlled, repeatable ways
  • Computational and computer artists, either looking for new tools or making generative works
  • Educators who teach fabrication
  • HackSpace and MakerSpace staff who need more tools to fine-tune their machines

LivePrinter combines the design and 3D printing of objects into a single, iterative process. Livecoding is used to control manufacturing precisely and procedurally with real-time flexibility. It brings improvisation and intuition to the act of making new computational forms. The system extends digital printing and CNC machining into the realm of performance and also has potential in design and science pedagogy.

The current software toolchains of 3D printing place the artist and designer at a difficult distance from the physical process of making. There is little space for live improvisation and experimentation, especially with key properties that directly affect printing materials, like temperature and print speeds.

You can watch a video of LivePrinter in action, running experimental tests, creating generative shapes, and exploring printing in air: video of LivePrinter in action

Design Principles

LivePrinter is designed to be:

  • Flexible in deployment: it should run on as many platforms as possible (Raspberry PI and other Linux and RTOS systems as well as standard computers such as desktops and laptops)
  • Easy to hack: the system architecture itself should not have too many dependencies or be generally too elaborate and complex. It should stick to minimal, necessary features. It should favor less code files that do more over many files that interact in complex ways. Important code that will edited often should be foregrounded. This goes for the livecoding mini-languages as well.
  • Allow for as little lag as possible: physically making things happens in realtime, and even milliseconds count when you have melted plastic cooling.
  • Be quick and intuitive to code: the livecoding system should be as minimally-verbose as possible so it can be typed quickly. It should also provide enough core, useful functions so that common making actions are supported.
  • Be as honest as possible with physical states: the code should not try and cache physical properties like temperature and print head position, for example. These relate to instantaneous reality and should be treated as such. A query/response system is one such solution.
  • Be understandable and appropriate for artists, designers, and non-technical people: This is a (fun!) tool for making intuitively, and the language should reflect that, even at the expense of technical accuracy (of language).
  • Be collaborative, social, performative: Allow for others to take part in the making process, whether that's contributing directly to the livecoding or spectating as audience.

How It Works / Developing

Overview of the system: liveprinter architecture

LivePrinter is part web client and server for livecoding and part 3D printer host application on the back end. On the front end, a user will livecode in a web browser (or other web client). Their code is compiled into machine-appropriate G-Code, packaged into JSON-ROPC calls and sent via AJAX (http) to the back end, where it is sent to the printer via a serial connection. Responses from the printer are sent back to the web client. This whole process is asynchronous, for speed and for tracking which messages successfully were send (and responses received).

More than one person might be involved: the system is designed to support collaborative livecoding and potentially many 3D printers, as complex as that is! (Look at the Max/MSP example in the misc folder for an example of this)

JSON-RPC API

Testing

If you fire up the server and then navigate a browser to http://localhost:8888/jsontest you can play with the API in a hands-on web page.

API Documentation

This is what the API looks like, currently:

get list of serial ports

  • send (no params): { "jsonrpc": "2.0", "id": 6, "method": "get-serial-ports","params": []}
  • receive back array of port names: {"jsonrpc":"2.0","id":6,"result":{"ports":["COM3","dummy"],"time":1568371926204.6528}}

set printer serial port and connection speed

  • send parameters array with port name (e.g. "COM3") and speed (e.g. 25000): { "jsonrpc": "2.0", "id": 5, "method": "set-serial-port","params": [ "COM3", 250000]}
  • receive back connection results from printer (if any): {"jsonrpc":"2.0","id":5,"result":[{"time":1568375167280.751,"port":["COM3",250000],"messages":["start","echo:Marlin 1.0.0","echo: Last Updated: Dec 8 2018 13:25:37 | Author: Version DEV","Compiled: Dec 8 2018","echo: Free Memory: 2123 PlannerBufferBytes: 1232","echo:Stored settings retrieved","echo:Steps per unit:","echo: M92 X80.00 Y80.00 Z200.00 E282.00","echo:Maximum feedrates (mm/s):","echo: M203 X300.00 Y300.00 Z40.00 E45.00","echo:Maximum Acceleration (mm/s2):","echo: M201 X9000 Y9000 Z100 E10000","echo:Acceleration: S=acceleration, T=retract acceleration","echo: M204 S3000.00 T3000.00","echo:Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)","echo: M205 S0.00 T0.00 B20000 X20.00 Z0.40 E5.00","echo:Home offset (mm):","echo: M206 X0.00 Y0.00 Z-12.15","echo:PID settings:","echo: M301 P10.00 I2.50 D100.00"]}]}

send arbitrary GCODE (must be connected first otherwise get exception back)

  • send any line of GCode (e.g. "G28") in the parameters as a string. NOTE: only send one command so you receive the proper response for that command. For multiple commands, send multiple jsonrpc requests: { "jsonrpc": "2.0", "id": 4, "method": "send-gcode","params": ["G28"]}
  • receive back results from printer (e.g. "ok"): {"jsonrpc":"2.0","id":4,"result":["ok"]}

get printer connection state (port name and state e.g. closed or connected)

  • send: { "jsonrpc": "2.0", "id": 3, "method": "get-printer-state","params": []}
  • receive back: {"jsonrpc":"2.0","id":3,"result":[{"time":1568371930335.6362,"port":null,"state":"closed"}]} or {"jsonrpc":"2.0","id":3,"result":[{"time":1571916551445.2378,"port":"/dev/null","state":"connected"}]}

close printer serial port

  • send (no params): { "jsonrpc": "2.0", "id": 2, "method": "close-serial-port","params": []}
  • receive back: {"jsonrpc":"2.0","id":2,"result":["closed"]}

Key files

  • liveprinter.js: handles the user interface and communication with server (sends GCode, handles events)
  • printer.js: the 3D printer API (outputs GCode to be sent to the printer)
  • LivePrinterServer.py: The back-end web server (uses tornado and websockets), implements the JSON-RPC API
  • USBPrinterOutputDevice.py: the Marlin driver that handles serial communication

The back-end web server and websockets service uses a Tornado server written in Python and a very-adapted version of Cura's 3D printing driver that connects to a Marlin Firmware based 3D printer (currently tested on an Ultimaker 2+) and on various Prusa printers, as well as homebrew Marlin-based ones.

A more complicated architecture diagram: liveprinter architecture

Getting Involved / Contributing

If you want to get involved, please give us a shout! The more the better.

There is an API and function reference for the client end which needs formatting work.

An aside on Python Virtual Environments

It makes sense (in general, not just for this project) to do Python development using isolated virtual environments, to prevent contamination or clashes between modules and utilities by keeping all configuration sandboxed. This requires a global installation of virtualenv. After that we can do (on macOS and Linux at least):

    cd LIVEPRINTER_MAIN_FOLDER
    cd liveprinter
    virtualenv --python=python3 ./venv3
            # create a Python 3 virtual environment
    . /venv3/bin/activate
            # activate the environment
    pip install --upgrade pip
            # get the latest pip in the virtual environment (probably not essential)
    pip install tornado pyserial tornado_jsonrpc2
            # get the libraries we need
    python LivePrinterServer.py
            # launch the server in the Python 3 sandbox  

For Windows:

    virtualenv --python=AppData\Local\Programs\Python\Python37\python.exe Desktop\venv3
    Desktop\venv3x\Scripts\activate

Then when all is done:

    deactivate
            # wind down the environment

License and Dependencies

LivePrinter is completely open source (AGPL 3.0). To summarise, it is built on and inspired by other open source projects:

Similar Projects

  • OpenGB has been an inspiration
  • Fabrica, a front-end for Smoothieware looks interesting. Smoothieware integration might be nice, someday.

Who is behind this

This project was started by Evan Raskob, artist, livecoder and Lecturer at Goldsmiths University (previously at the Royal College of Art in London), and part-time PhD student in arts and Computational Technology also at Goldsmiths. This project is the main practice part of his ongoing PhD study. If you'd like to get in touch, please email him at [email protected].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].