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 & HelpOpenGL and 3D Libraries › dxf export inaccuracy
Page Index Toggle Pages: 1
dxf export inaccuracy (Read 450 times)
dxf export inaccuracy
Jun 30th, 2008, 10:30pm
 
running processing 135 on winxp macbook pro

Hi everyone,

I've been doing some quick bas relief construction using processing to automate it using photography and noticed massive inaccuracies in the way processing generates DXF file coordinates.

first off notes!:

processing's origin point, (0,0) is at upper left. however in Autocad, it's lower left.

when creating shapes using beginShape(), use noStroke() and fill(). This way it will only generate planes and makes importing into 3D Studio Max or other 3D programs much much faster!

ok, here is some results of tests:

anytime when z coordinate = 0 in processing using beginShape() and vertex(), the actual output comes to some weird negative inaccurate number

i.e:

coordinates 0,0,0

after dxf export gives

-149.85,-199.85,-346.41016

weird right?

it looks like the canvas size determines the shift in Z and X and Y

the X and Y are shifted so that 0,0 really equals -width/2 and -height/2

so true center of the object on processing screen is really center of the applet window. but still, it doesn't give you a perfect number.

if your applet window is 600 by 600, and you draw at 0,0
the coordinate exported should be at -300,-300 but many times it's off by 0.15 and you get -299.85,-299.85

weird!

but what about z?!?!?!

an applet window that is 600 by 600, a z coordinate of 0 is exported as -519.61523.

so z is effected by the applet height. the more you reduce height, the closer z becomes to 0. but still, -519.61523 at 600 is still a very weird number.

the imprecision of the dxf export causes many problems afterward.

note: this does not happen if no Z is set in vertex

i hope this makes sense





Re: dxf export inaccuracy
Reply #1 - Jun 30th, 2008, 10:32pm
 
here is the test code i used to generate the dxf problems

import processing.dxf.*;

void setup() {
 size(600, 600, P3D);
 noStroke();
 beginRaw(DXF, "output.dxf");
 beginShape();
  vertex(0,0,0);
  vertex(0,50,0);
  vertex(50,50,0);
  vertex(50,0,0);
 endShape();
 endRaw();
}

void draw() {

}
Re: dxf export inaccuracy
Reply #2 - Jul 18th, 2008, 9:21am
 
bump. ok, sorry, but i think this is kinda serious, just wanted to confirm with others....
Page Index Toggle Pages: 1