Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
mikegarcia84
mikegarcia84's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Why cant I export to dxf?
[2 Replies]
26-Jan-2013 08:34 PM
Forum:
Programming Questions
I followed the sample dxf from processing library but cant get it to work when i apply it to code. The code has two keypresses and i dont know how to fix them. Any ideas? The error is in line 39 below
/* OpenProcessing Tweak of *@*
http://www.openprocessing.org/sketch/8168*@*
*/
/* !do not delete the line above, required for linking your tweak if you re-upload */
// a processing remake of the web mode in mr doob's "harmony" procedural drawing app
//
http://mrdoob.com/lab/javascript/harmony/#web
ArrayList history = new ArrayList();
float distthresh = 60;
import processing.dxf.*;
boolean record = false;
void setup(){
size(900,600);
background(255);
stroke(0,50);
smooth();
}
void draw(){
if (record == true) {
beginRaw(DXF, "output.dxf"); // Start recording to the file
}
}
void mouseDragged(){
PVector d = new PVector(mouseX,mouseY,0);
history.add(0,d);
for (int p=0; p<history.size(); p++){
PVector v = (PVector) history.get(p);
float joinchance = p/history.size() + d.dist(v)/distthresh;
if (joinchance < random(0.4)) line(d.x,d.y,v.x,v.y);
}
}
void keyPressed(){
if (key == ' ') {
background(255);
history.clear();
}
if (record == true) {
endRaw();
record = false; // Stop recording to the file
}
}
void keyPressed() {
if (key == 'R' || key == 'r') { // Press R to save the file
record = true;
}
}
«Prev
Next »
Moderate user : mikegarcia84
Forum