这适用于处理,它是 2.2 版的 IDE。将其移至 Eclipse 并且绘图部分有效
import processing.core.*;
import processing.dxf.*;
public class ShowCameraParts extends PApplet {
/**
*
*/
private static final long serialVersionUID = 1L;
boolean record = false;
QuadWith2EarsAttached[] tp = new QuadWith2EarsAttached[1];
public void setup() {
size(Settings.WINDOW_X, Settings.WINDOW_Y);
// lights(); lights() is not available with this renderer.
background(200);
noFill();
stroke(0);
tp[0] = new QuadWith2EarsAttached(this);
}
public void draw() {
if (record == true) {
beginRaw(DXF,"CameraPart.dxf"); // Start recording to the file
}
tp[0].draw();
if (record == true) {
endRaw();
record = false; // Stop recording to the file
}
}
public void keyPressed() {
if (key == 'R' || key == 'r') { // Press R to save the file
record = true;
println("DXF Done");
}
}
}
但是当我在 Eclipse 中运行它时,按下“r”时会出现此错误
DXF Done
beginRaw() is not available with this renderer.
endRaw() is not available with this renderer.
从处理中创建的图形创建 dxf 的正确方法是什么?