We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi I ma trying to export a 3d he_mesh object to a dxf file for use with autocad later. I get an error when triggering dxf export. Any help would be depreciated... im working on a school project and dont have much experience with processing. Here is the code:
import wblut.math.*; import wblut.processing.*; import wblut.hemesh.*; import wblut.geom.*; import processing.dxf.*;
boolean record;
HE_Mesh mesh; WB_Render3D render; WB_DebugRender3D drender; WB_Point[] points; int num; void setup() { size(1280, 720, P3D); smooth(8); WB_RandomOnSphere rs=new WB_RandomOnSphere(); HEC_ConvexHull creator=new HEC_ConvexHull(); num=137; points =new WB_Point[num]; for (int i=0;i<num;i++) {
points[i]=rs.nextPoint().mulSelf(300.0);
}
creator.setPoints(points);
creator.setN(num);
mesh=new HE_Mesh(creator);
mesh=new HE_Mesh(new HEC_Dual(mesh));
mesh.modify(new HEM_PunchHoles().setWidth(10));
mesh.modify(new HEM_Shell().setThickness(7));
HET_Diagnosis.validate(mesh);
render=new WB_Render3D(this); drender=new WB_DebugRender3D(this); }
void draw() { if (record) { beginRaw(DXF, "output.dxf"); } background(255); directionalLight(255, 255, 255, 1, 1, -1); directionalLight(127, 127, 127, -1, -1, 1); translate(width/2, height/2, 0); rotateY(mouseX0.7f/widthTWO_PI); rotateX(mouseY0.7f/heightTWO_PI); stroke(0);
render.drawEdges(mesh); // drender.drawFaceNormals(50,mesh); for (int i=0;i<num;i++) { render.drawPoint(points[i]); } noStroke(); render.drawFaces(mesh);
if (record) { endRaw(); record = false; } }
void keyPressed() { // Use a key press so that it doesn't make a million files if (key == 'r') { record = true; } }
Answers
import wblut.math.*;
import wblut.processing.*;
import wblut.hemesh.*;
import wblut.geom.*;
import processing.dxf.*;
boolean record;
HE_Mesh mesh;
WB_Render3D render;
WB_DebugRender3D drender;
WB_Point[] points;
int num;
void setup() {
size(1280, 720, P3D);
smooth(8);
WB_RandomOnSphere rs=new WB_RandomOnSphere();
HEC_ConvexHull creator=new HEC_ConvexHull();
num=137;
points =new WB_Point[num];
for (int i=0;i<num;i++) {
}
creator.setPoints(points);
creator.setN(num);
mesh=new HE_Mesh(creator);
mesh=new HE_Mesh(new HEC_Dual(mesh));
mesh.modify(new HEM_PunchHoles().setWidth(10));
mesh.modify(new HEM_Shell().setThickness(7));
HET_Diagnosis.validate(mesh);
render=new WB_Render3D(this);
drender=new WB_DebugRender3D(this);
}
void draw() {
if (record)
{
}
background(255);
directionalLight(255, 255, 255, 1, 1, -1);
directionalLight(127, 127, 127, -1, -1, 1);
translate(width/2, height/2, 0);
rotateY(mouseX0.7f/widthTWO_PI);
rotateX(mouseY0.7f/heightTWO_PI);
stroke(0);
render.drawEdges(mesh);
// drender.drawFaceNormals(50,mesh);
for (int i=0;i<num;i++) {
}
noStroke();
render.drawFaces(mesh);
if (record) {
}
}
void keyPressed() {
// Use a key press so that it doesn't make a million files
if (key == 'r') {
}
}