DXFExport - 3D DXF?
Posted: 29 Aug 2005, 07:02
Using the following code snippet to create a simple 3D DXF does not appear to work correctly in that the DXF file will not be 3D when viewing inside a DXF viewer like Volo View (it will flatten the 3D by apparently ignoring the Z-coordinates):
Maybe I'm missing something here? Any help appreciated...
Code: Select all
void TestAngledFaces()
{
DXFExport export = new DXFExport();
DXFData data = new DXFData();
// front face
data.point = new DXFPoint(0,0,0);
data.point1 = new DXFPoint(40,0,0);
export.AddLine(data);
data.Clear();
data.point = new DXFPoint(40,0,0);
data.point1 = new DXFPoint(40,80,0);
export.AddLine(data);
data.point = new DXFPoint(40,80,0);
data.point1 = new DXFPoint(0,80,0);
export.AddLine(data);
data.point = new DXFPoint(0,80,0);
data.point1 = new DXFPoint(0,0,0);
export.AddLine(data);
// side face at an angle
data.point = new DXFPoint(40,0,0);
data.point1 = new DXFPoint(70,0,-40);
export.AddLine(data);
data.point = new DXFPoint(70,0,-40);
data.point1 = new DXFPoint(70,80,-40);
export.AddLine(data);
data.point = new DXFPoint(70,80,-40);
data.point1 = new DXFPoint(40,80,0);
export.AddLine(data);
export.SaveToFile(@"C:\simple.dxf");
}