From 91ff6420e4cd06f38fedb519f9d7049a1b055a66 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Fri, 24 Jan 2014 00:59:02 -0500 Subject: [PATCH] OFF export workaround. Convert to Nef polyhedron for now --- src/export.cc | 11 +++++++++++ src/export.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/export.cc b/src/export.cc index 34315252..00ebf06d 100644 --- a/src/export.cc +++ b/src/export.cc @@ -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()) { diff --git a/src/export.h b/src/export.h index 28c1c07d..7c137683 100644 --- a/src/export.h +++ b/src/export.h @@ -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);