13
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Processing3.0.1でSVG出力

Last updated at Posted at 2016-01-14

ProcessingからSVG形式で出力する為のメモ

ExportSVG.pde
//SVG用のライブラリをインポート
import processing.svg.PGraphicsSVG;

//まず通常のPAppletに描画して出力する例
beginRecord(SVG, "PApplet.svg");
size(640, 480);
noStroke();
fill(0, 200, 250);
ellipse(width/2, height/2, 100, 100);
endRecord();

//次にPGraphicsに描画して出力する例
PGraphics pg;
pg = createGraphics(640, 480, SVG, "PGraphics.svg");
pg.beginDraw();
pg.ellipse(pg.width/2, pg.height/2, 100, 100);
pg.endDraw();

SketchフォルダにSVG形式で出力されている

13
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?