summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-09-08 04:54:50 (GMT)
committerMarius Kintel <marius@kintel.net>2011-09-08 04:54:50 (GMT)
commit673d73cf31fdafa0dc03876cde0db5b4aab10d1c (patch)
tree38ab65f89207183bd4f9c0a52e6558465e358faf /src
parent90f7e4f82ed7b3c94875493f9e6354833878509e (diff)
Don't try exporting a non-3D object to stl or off
Diffstat (limited to 'src')
-rw-r--r--src/openscad.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/openscad.cc b/src/openscad.cc
index c5933f3..c3ee389 100644
--- a/src/openscad.cc
+++ b/src/openscad.cc
@@ -320,7 +320,11 @@ int main(int argc, char **argv)
}
if (stl_output_file) {
- if (root_N.dim == 3 && !root_N.p3->is_simple()) {
+ if (root_N.dim != 3) {
+ fprintf(stderr, "Current top level object is not a 3D object.\n");
+ exit(1);
+ }
+ if (!root_N.p3->is_simple()) {
fprintf(stderr, "Object isn't a valid 2-manifold! Modify your design.\n");
exit(1);
}
@@ -335,7 +339,11 @@ int main(int argc, char **argv)
}
if (off_output_file) {
- if (root_N.dim == 3 && !root_N.p3->is_simple()) {
+ if (root_N.dim != 3) {
+ fprintf(stderr, "Current top level object is not a 3D object.\n");
+ exit(1);
+ }
+ if (!root_N.p3->is_simple()) {
fprintf(stderr, "Object isn't a valid 2-manifold! Modify your design.\n");
exit(1);
}
contact: Jan Huwald // Impressum