diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-08 01:31:59 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-08 01:31:59 (GMT) |
commit | 80afa32ae94a1d33f4c7864bd5a3d92da00b3809 (patch) | |
tree | 3d23e877e9e9721b0115521738bf7b52e34b496f | |
parent | 4f7051412bc43d3ad372dd88e898d38e26ecbcf4 (diff) | |
parent | 072d7170e62fea76f54cca66d2f6667c4374b1a0 (diff) |
merged with master
-rw-r--r-- | RELEASE_NOTES | 2 | ||||
-rw-r--r-- | src/cgaladv_minkowski2.cc | 2 | ||||
-rw-r--r-- | src/export.cc | 16 | ||||
-rw-r--r-- | src/openscad.cc | 8 |
4 files changed, 27 insertions, 1 deletions
diff --git a/RELEASE_NOTES b/RELEASE_NOTES index eca6813..7b9a000 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -6,6 +6,8 @@ o The MCAD library is now bundled with OpenSCAD o Added import and export of the OFF file format o New import() statement reads the correct file format based on the filename extension (.stl, .dxf and .off is supported) +o The color() statement now supports an alpha parameter, e.g. color(c=[1,0,0], alpha=0.4) +o The color() statement now supports specifying colors as strings, e.g. color("Red") Bugfixes: o square() crashed if any of the dimensions were zero diff --git a/src/cgaladv_minkowski2.cc b/src/cgaladv_minkowski2.cc index 2d64d16..f08e7d6 100644 --- a/src/cgaladv_minkowski2.cc +++ b/src/cgaladv_minkowski2.cc @@ -91,7 +91,7 @@ CGAL_Poly2 nef2p2(CGAL_Nef_polyhedron2 p) } //if (fit != E.faces_begin()) { if (points.size() != 0) { - PRINT("WARNING: minkowski() is not implemented for 2d objects with holes!"); + PRINT("WARNING: minkowski() and hull() is not implemented for 2d objects with holes!"); break; } 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 } diff --git a/src/openscad.cc b/src/openscad.cc index 7ecf988..c4b0d5f 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -319,6 +319,10 @@ int main(int argc, char **argv) } if (stl_output_file) { + if (root_N->dim == 3 && !root_N->p3.is_simple()) { + fprintf(stderr, "Object isn't a valid 2-manifold! Modify your design.\n"); + exit(1); + } std::ofstream fstream(stl_output_file); if (!fstream.is_open()) { PRINTF("Can't open file \"%s\" for export", stl_output_file); @@ -330,6 +334,10 @@ int main(int argc, char **argv) } if (off_output_file) { + if (root_N->dim == 3 && !root_N->p3.is_simple()) { + fprintf(stderr, "Object isn't a valid 2-manifold! Modify your design.\n"); + exit(1); + } std::ofstream fstream(stl_output_file); if (!fstream.is_open()) { PRINTF("Can't open file \"%s\" for export", stl_output_file); |