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.
IndexSuggestions & BugsSoftware Bugs › Duplicate 3d faces in beginRaw() export
Page Index Toggle Pages: 1
Duplicate 3d faces in beginRaw() export (Read 1623 times)
Duplicate 3d faces in beginRaw() export
Feb 23rd, 2008, 5:07pm
 
I've already posted this in the bugs database, but thought I'd also post it here so people can see it.

It looks lik beginRaw() incorrectly exports the result of the last beginShape()/endShape() command twice, resulting in duplicate 3D faces that can cause problems for some 3D software. The code below should produce 12 3D faces (3 sets of 2 quads == 12 triangles), but in fact produces 16 because the last two quads are exported twice.

A possible workaround would be to explicitly instantiate a processing.dxf.RawDXF or similar exporter class and make beginShape() and vertex() calls directly.

Code:
void setup() {
size(400,400,P3D);
noLoop();
}

void draw() {
beginRaw(DXF,"test.dxf");

noStroke();
for(int i=0; i<3; i++) {
beginShape(QUAD_STRIP);
vertex(0,i*100,0);
vertex(0,(i+1)*100,0);
vertex(100,i*100,0);
vertex(100,(i+1)*100,0);
vertex(200,i*100,0);
vertex(200,(i+1)*100,0);
endShape();
}

endRaw();
}
Page Index Toggle Pages: 1