Workshop: Using Data in PEmbroider
comingPEmbroider soon....Cheat Sheet
Below is the standard startup, drawing, and export for a sketch which we will add to.
// Example PEmbroider program
import processing.embroider.*;
PEmbroiderGraphics E;
void setup() {
// Starting up:
noLoop();
size(800, 600);
E = new PEmbroiderGraphics(this, width, height);
String outputFilePath = sketchPath("filename.dst");
E.setPath(outputFilePath);
E.beginDraw();
E.clear();
//-------
// Content goes here:
E.fill(0, 0, 0);
E.circle(200, 200, 200);
//----------
// Visualization and export:
// NOTE: Leave optimize() and endDraw() commented out,
// until you are ready to export the embroidery file!
// Don't forget to un-comment them when you want to export!
//
// E.optimize(); // VERY SLOW, but essential for file output!
E.visualize(); // Display the embroidery path on-screen.
// E.endDraw(); // Actually writes out the embroidery file.
}
1. Import .csv file
To do this, there are only two lines of code that we need to add. First, we need to set up our table variable before the setup function.
Table table;
Then, within setup(), we can import our data.
table = loadTable("wind.csv", "header");
For this to work, the .csv file must be saved in the same folder as the processing file you are working in.
2.
-->