mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 13:49:18 +01:00
simple svg exporter
This commit is contained in:
32
java/libraries/svg/src/WriteSVG.java
Normal file
32
java/libraries/svg/src/WriteSVG.java
Normal file
@@ -0,0 +1,32 @@
|
||||
import processing.core.PApplet;
|
||||
|
||||
public class WriteSVG extends PApplet {
|
||||
|
||||
public String sketchRenderer() {
|
||||
return "processing.svg.PGraphicsSVG";
|
||||
}
|
||||
|
||||
|
||||
public String sketchOutputPath() {
|
||||
return "/Users/fry/Desktop/frame-####.svg";
|
||||
}
|
||||
|
||||
|
||||
public void setup() {
|
||||
size(600, 400, "processing.svg.PGraphicsSVG", "/Users/fry/Desktop/frame-####.svg");
|
||||
// frameRate(1);
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
background(random(255));
|
||||
stroke(random(255));
|
||||
strokeWeight(20);
|
||||
line(random(width), random(height), random(width), random(height));
|
||||
if (frameCount == 5) exit();
|
||||
// exit();
|
||||
}
|
||||
|
||||
static public void main(String[] args) {
|
||||
PApplet.main(new String[] { "WriteSVG" });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user