DXF library not exporting?

Hi, I'm using the computational geometry library and am trying to export to DXF. I set a keyPress for the export but I'm hitting the key and nothing is being generated in the sketch folder. Any help would be very appreciated, thanks!

import processing.dxf.*;
import ComputationalGeometry.*;
IsoSurface iso;

boolean record = false;

void setup(){

  size(640,640, P3D);

  iso = new IsoSurface(this, new PVector(0,0,0), new PVector(200,200,200), 15);

  for(int i=0; i<20; i++){
    PVector pt = new PVector( random(100), random(100), random(100) );
    iso.addPoint(pt);
  }
}
void draw(){

    if (record) {
    beginRaw(DXF, "output.dxf");
  }

  camera(150,150,150,50,50,40,0,0,-1);
  lights();
  background(220);

  noFill();
  noStroke();
  iso.plotVoxels();

  fill(255,0,255);
  iso.plot(mouseX/10000.0);

  if (record == true) {
    endRaw();
    record = false;
  }
}

void KeyPressed() {
  if (key == 'R' || key == 'r') {
    record = true;
  }
}

Running Processing 2.2.1 Windows 8

Answers

  • Answer ✓

    Not sure how this IsoSurface class draws things on screen. The DXF library captures regular Processing calls, nothing else.

    Have you tried with a simpler sketch, one of the 3D examples of Processing, to see if pure DXF recording is working for you?

  • Ah right, thanks for letting me know. I'll try with a simpler sketch to check this out. Do you have any idea how I'd go about exporting the 3D vector information from whatever is generated using the computational geometry library?

Sign In or Register to comment.