OFF export workaround. Convert to Nef polyhedron for now

customizer
Marius Kintel 2014-01-24 00:59:02 -05:00
parent df3137ce13
commit 91ff6420e4
2 changed files with 12 additions and 0 deletions

View File

@ -61,6 +61,9 @@ void exportFile(const class Geometry *root_geom, std::ostream &output, FileForma
case OPENSCAD_STL:
export_stl(*ps, output);
break;
case OPENSCAD_OFF:
export_off(*ps, output);
break;
default:
assert(false && "Unsupported file format");
}
@ -208,6 +211,14 @@ void export_stl(const CGAL_Nef_polyhedron *root_N, std::ostream &output)
}
}
void export_off(const class PolySet &ps, std::ostream &output)
{
// FIXME: Implement this without creating a Nef polyhedron
CGAL_Nef_polyhedron *N = createNefPolyhedronFromGeometry(ps);
export_off(N, output);
delete N;
}
void export_off(const CGAL_Nef_polyhedron *root_N, std::ostream &output)
{
if (!root_N->p3->is_simple()) {

View File

@ -19,6 +19,7 @@ void export_png(const class Geometry *root_geom, Camera &c, std::ostream &output
void export_stl(const class CGAL_Nef_polyhedron *root_N, std::ostream &output);
void export_stl(const class PolySet &ps, std::ostream &output);
void export_off(const CGAL_Nef_polyhedron *root_N, std::ostream &output);
void export_off(const class PolySet &ps, std::ostream &output);
void export_dxf(const class Polygon2d &poly, std::ostream &output);
void export_png(const CGAL_Nef_polyhedron *root_N, Camera &c, std::ostream &output);
void export_png_with_opencsg(Tree &tree, Camera &c, std::ostream &output);