We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › .DXF library question
Page Index Toggle Pages: 1
.DXF library question (Read 234 times)
.DXF library question
Aug 18th, 2009, 10:35am
 
Hi,

I tried using the .DXF export for the first time with a very simple drawing program. When I insert the lines of code to make import the .dxf library, my linetypes suddenly change. Now, I'm occasionally getting dashed lines being drawn. Why would inserting the .DXF related code cause this change?

Thanks.

import processing.dxf.*;
boolean record;
int frame = 0;

void setup () {
 size (3000,2800,P3D);
 smooth ();
 fill (0);
 background (random(210,255));
 frameRate (100);
}

void keyPressed() {
 // use a key press so that it doesn't make a million files
 if (key == 'r') record = true;
}

void draw () {
 if (record) {
   beginRaw(DXF, "output.dxf");
 }
strokeWeight (random (.05,.2));
 println(frameCount);
 line (10, random (10,2990), 2990, random (10,2990));
 if ((frameCount % 1000)==0) {
 saveFrame("biglinez-####.tif");
 }
 if (frameCount>=10000) {
   stroke (255,0,0);
   }
 if (frameCount>=20000) {
   stroke (255,255,255);
}
if (frameCount>=30000) {
 stroke (250,255,0);
}
if (record) {
   endRaw();
   record = false;
 }
}
 
void mousePressed () {
 background (random(210,255));
}
Page Index Toggle Pages: 1