Digital Embroidery with PEmbroider
PEmbroider is an open-source library for embroidery design, maintained by CMU's Studio for Creative Enquiry. It is designed for use with Processing, particularly the Processing Drawing API which can be used to generate embroidery designs computationally. It is well-documented online;online -- this tutorial page is here to point you to existing resources, and explain a couple of foibles with the software.
Setup
Setup instructions are here. When running an example sketch, if you would like to use the design, make sure that it exports in the .PES file format, as this is the form used by the machine.
In the PEmbroider example files, the file format is always declared in the variable outputFilePath
, normally in the setup()
section of the code. So, to change this (e.g. in the example file PEmbroider_shape_hatching_experimental), from:
...
E = new PEmbroiderGraphics(this, width, height);
String outputFilePath = sketchPath("PEmbroider_shapes_hatching_experimental.vp3");
...
to:
...
E = new PEmbroiderGraphics(this, width, height);
String outputFilePath = sketchPath("PEmbroider_shapes_hatching_experimental.pes");
...
If you create a file in the wrong format, you can always re-run the code, but it is also possible to convert between different embroidery file formats online here.
Using PEmbroider
The full API for PEmbroider is documented here.
Stitch size and spacing
Because of how Processing generates images, measurements are in pixels, not in mm -- this can make it a bit trickier to compare with other pieces of software.
In my experexperience, the default stitches used in PEmbroider are very small and very dense, much moreso than the defaults used by Brother software. Partly, this is a matter of taste, however, when using finer or stretchier fabrics, such tight and dense stitches can cause puckering (and these designs also take a lot longer).
This is something that's best to test out yourself and adjust, but I have included the presets I use below as a guide:
PEmbroiderGraphics E;
...
void setup() {
...
E.strokeSpacing(2.0) # this spaces the stitches by 2 pixels
E.setStitch(5, 15, 0.0) # this sets minimum stitch to be 5px
# desirable stitch length to be 15px
# resample noise to be 0.0
...
}
(note: you set both the minimum and desired stitch length, as when )
Of course, like anything in
Type
PEmbroider has quite a lovely way of dealing with type, and it's worth experimenting with the library if you're interested in creating text
Creating pixellated designs
One thing that programs like PEmbroider are particularly well adapted for