summaryrefslogtreecommitdiff
path: root/src/openscad.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/openscad.cc')
-rw-r--r--src/openscad.cc39
1 files changed, 33 insertions, 6 deletions
diff --git a/src/openscad.cc b/src/openscad.cc
index 35da4d7..494d41b 100644
--- a/src/openscad.cc
+++ b/src/openscad.cc
@@ -318,14 +318,41 @@ int main(int argc, char **argv)
fclose(fp);
}
- if (stl_output_file)
- export_stl(&root_N, stl_output_file, NULL);
+ if (stl_output_file) {
+ QFile file(stl_output_file);
+ if (!file.open(QIODevice::ReadWrite)) {
+ PRINTA("Can't open file \"%1\" for export", stl_output_file);
+ }
+ else {
+ QTextStream fstream(&file);
+ export_stl(&root_N, fstream, NULL);
+ file.close();
+ }
+ }
- if (off_output_file)
- export_off(&root_N, off_output_file, NULL);
+ if (off_output_file) {
+ QFile file(stl_output_file);
+ if (!file.open(QIODevice::ReadWrite)) {
+ PRINTA("Can't open file \"%1\" for export", stl_output_file);
+ }
+ else {
+ QTextStream fstream(&file);
+ export_off(&root_N, fstream, NULL);
+ file.close();
+ }
+ }
- if (dxf_output_file)
- export_dxf(&root_N, dxf_output_file, NULL);
+ if (dxf_output_file) {
+ QFile file(stl_output_file);
+ if (!file.open(QIODevice::ReadWrite)) {
+ PRINTA("Can't open file \"%1\" for export", stl_output_file);
+ }
+ else {
+ QTextStream fstream(&file);
+ export_dxf(&root_N, fstream, NULL);
+ file.close();
+ }
+ }
delete root_node;
#else
contact: Jan Huwald // Impressum