Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 119 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,120 @@
# DrawingMachines
Code and instructions for operating the drawing machines at Foulab, mainly the plotters.
This repository contains code and instructions for operating the drawing machines at Foulab, mainly the plotters.


# TL;DR

Long instructions are boring, and my attention span is short. I want to plot something right now.

- Prequisite
- A working python 3. Can be a conda, or a system python.

- Plot a precreated file
- Linux
- check if you are in the dialout group
```
groups
```
- if dialout is not listed, add it with
```
sudo usermod -a -G dialout user
```
logout login may be required
- git clone this repo
```
git clone git@github.com:FOULAB/DrawingMachines.git
```
- Build a python environment with the necessary code
```
./build_environment.sh <environment_name>
```
- Activate this environment
```
. <environment_name>/bin/activate
```
- Connect the plotter

Most plotters are driven over serial, using an interface wired in a nonstandard way. For the large HP at Foulab, this is prepared for you.

INSERT PHOTOGRAPH

- Probe the plotter
```
chiplotle3
```
- Load paper and pen

INSERT PHOTOGRAPHS

- Run the test and plot the test file
```
plot_hpgl_file
```
- Rejoice, you have plotted a drawing!
- Create a file and plot it
- Run this notebook, download the resulting file
- Plot the resulting file
- Rejoice more, you have algorithmically created, and then plotted a drawing!

# Detailed Discussion

In the following discussion, we will work from closest to the paper to greater and greater levels of abs

## Driving the plotter

The plotter understands HPGL, and it has to be fed this HPGL over a serial port. You can probably achieve this with most serial port communication programs, but a piece of software especially useful for this is Chiplotle.

Create a python3 virtual environment, and pip install Chiplotle3 (note that pip can also find the chiplotle package, but that is python 2 only)

Testing

Loading paper

Choosing paper

Choosing pens

## Making HPGL

A HPGL file for a specific drawing is plotter specific. The software vpype can be used to generate it, but it needs a configuration file specific to your plotter. You can get this file here.

Most plotters support 5-8 different pens. In general, registration is good so long as the paper is left in place, so an alternative method of changing pens is to just send separate drawing files.

Plot requests outside the paper area will be ignored by the plotter – performing this geometric trimming is quite slow, so it is best not to rely on it, but it is a nice safety feature.

The efficiency of carrying out a plot is related to the geometric instructions given to the plotter. For example, if it is instructed to jump repeatedly from one side of the paper to the other, this will make the plot slower, than if the lines are organized to minimized pen movement.

Remember this is a physical drawing. You may wish to consider ink and pen effects – e.g. the point where the pen started and ended is often slightly visible. If drawing many circles, and they all start from the same angle, this will be apparent in the final drawing. These effects may or may not be desirable depending on your artistic goal.

Vpype can be used to draw directly, but this is a bit clunky. It also reads SVG as input.

## Basic SVG manipulation - VPYPE

Vpype can be used to perform various simple manipulations which can be used to prepare a file for plotting. These include

### Sizing
### Layer manipulation
### Framing
### Adding text
### Assembling a page
### Optimizing plot paths

## Other SVG tools

### Inkscape

### Shapely

### Processing

## Plotter art – Case studies

### A postcard, including text

### Some geometry

### A map

### Rendering images 1: Simple Shading

### Rendering images 2: Single line drawings (TSP)
24 changes: 24 additions & 0 deletions build_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -e
if [[ -z "$1" ]]
then
echo "Usage: build_environment.sh environment_name"
echo "Expects to find a workable python3 as 'python'"
exit 1
elif [[ -e "$1" ]]
then
read -p "$1 exists, delete it? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
rm -rf "$1"
else
echo "Not creating env"
exit 1
fi
fi

python -m venv "$1"
. "$1"/bin/activate
pip install --upgrade pip
pip install git+https://github.com/cyprienh/chiplotle3.git vpype vpype-ttf
3 changes: 3 additions & 0 deletions fonts/Cantarell-Thin.readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Original download somehow vanished from the web and only distributed as variable now.
Font family designer and license https://cantarell.gnome.org/#download

Binary file added fonts/Cantarell-Thin.ttf
Binary file not shown.
29 changes: 29 additions & 0 deletions plotter_configs/dxy885.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[device.dxy885]
name = "Roland DXY-885"
plotter_unit_length = "0.02489mm"
pen_count = 8

[[device.dxy885.paper]]
name = "b"
aka_names = ["tabloid", "ansi_b"]
info = "The switch must be in ansi mode. The drawing offset is from bottom left."
paper_size = ["17in", "258mm"]
x_range = [0, 16640]
y_range = [0, 10365]
y_axis_up = true
origin_location = ["0mm", "0mm"]
origin_location_reference = "botleft"
final_pu_params = "16000,10000"

[[device.dxy885.paper]]
name = "a3"
aka_names = ["A3"]
info = "The switch must be in iso mode. The drawing offset is from bottom left."
paper_size = ["420mm", "297mm"]
x_range = [0, 16800]
y_range = [0, 11880]
y_axis_up = true
origin_location = ["0mm", "0mm"]
origin_location_reference = "botleft"
final_pu_params = "1r67000,11000"

22 changes: 22 additions & 0 deletions plotter_configs/hp7595.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

########################################################################################################################
# HPGL output devices
########################################################################################################################

[device.hp7595a]
name = "hp7595a"
plotter_unit_length = "0.02488mm"
pen_count = 8

[[device.hp7595a.paper]]
name = "letter"
aka_names = ["Letter"]
info = "Letter mode is assumed landscape"
paper_size = ["11in", "8.5in"]
x_range = [-4844, 4844]
y_range = [-3177, 3177]
y_axis_up = true
origin_location = ["5.5in", "4.25in"]
final_pu_params = "0,0"
set_ps = 4