Ejemplo n.º 1
0
  public void setup() {
    size(600, 600);

    build();
    export();
    UMB.setPApplet(this);
  }
Ejemplo n.º 2
0
  public void export() {
    String filename = sketchPath("test.pdf");

    // create PGraphicsPDF canvas
    PGraphicsPDF pdf = (PGraphicsPDF) createGraphics(500, 500, PDF, filename);

    // get pdf ready to draw
    pdf.beginDraw();
    pdf.translate(pdf.width / 2, pdf.height / 2);

    // tell Modelbuilder to draw to our PDF
    UMB.setGraphics(pdf);
    vl.draw();

    // end draw, close and flush the PDF file
    pdf.endDraw();
    pdf.flush();
    pdf.dispose();
  }