从 Eclipse 内部处理创建 DXF

Processing create DXF from inside Eclipse

这在处理中有效,它是 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 的正确方法是什么?

很奇怪,因为我没有评论

import processing.dxf.*;

它很管用。不知道为什么,但它完成了工作