Loading...
Logo
Processing Forum
When exporting a dxf to Rhino I noticed that drawing one triangle counter clockwise and another clockwise does not make any difference regarding the direction of their normals. Like this:

import processing.dxf.*;

void setup(){
  size(500,500, P3D); 
}

void draw(){
  beginRaw(DXF, "output.dxf");
 
  beginShape();
  vertex(0,0,0);
  vertex(100,100,-10);
  vertex(0,100,0);
  endShape(CLOSE);
 
  beginShape();
  vertex(100,0,0);
  vertex(100,100,0);
  vertex(200,100,-10);
  endShape(CLOSE);

  endRaw();
  exit();
}

Any way to get control over the normals? Another lib maybe? (I am trying to draw something for a 3D printer)


Replies(4)

See normal() in reference, that might help.
i often use meshlab to solve problems like that and optimize generated models for 3d printing.
in your case there is a useful option for inverting normals.
definitely worth taking a look. http://meshlab.sourceforge.net/
processing may "re-wind" your triangles internally during render, and normal() isn't used during dxf export.  if ALL of your normals seem inverted (and another symptom is if "front" view doesn't match what you see in processing, if it seems "mirrored") then you might try this (provided as is of course - if it works, great; if not, no support)
Hi there, 

Does anybody have a copy of davbols file?

It doesn't seem to be online any more and I can't get hold of him through a PM.

Many thanks


______________________
www.curveaudio.com