diff options
Diffstat (limited to 'src/export.cc')
-rw-r--r-- | src/export.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/export.cc b/src/export.cc index 6c427dd..862e82b 100644 --- a/src/export.cc +++ b/src/export.cc @@ -32,6 +32,7 @@ #include <QApplication> #include <QProgressDialog> #include <errno.h> +#include <fstream> #ifdef ENABLE_CGAL #include "CGAL_Nef_polyhedron.h" @@ -53,6 +54,17 @@ void export_stl(CGAL_Nef_polyhedron *root_N, std::ostream &output, QProgressDial setlocale(LC_NUMERIC, "C"); // Ensure radix is . (not ,) in output +<<<<<<< HEAD +======= + std::ofstream output(filename.toUtf8()); + if (!output.is_open()) { + PRINTA("Can't open STL file \"%1\" for STL export: %2", + filename, QString(strerror(errno))); + set_output_handler(NULL, NULL); + return; + } + +>>>>>>> master output << "solid OpenSCAD_Model\n"; int facet_count = 0; @@ -111,6 +123,10 @@ void export_stl(CGAL_Nef_polyhedron *root_N, std::ostream &output, QProgressDial } output << "endsolid OpenSCAD_Model\n"; +<<<<<<< HEAD +======= + output.close(); +>>>>>>> master setlocale(LC_NUMERIC, ""); // Set default locale } |