diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-08 04:54:50 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-08 04:54:50 (GMT) |
commit | 673d73cf31fdafa0dc03876cde0db5b4aab10d1c (patch) | |
tree | 38ab65f89207183bd4f9c0a52e6558465e358faf /src/openscad.cc | |
parent | 90f7e4f82ed7b3c94875493f9e6354833878509e (diff) |
Don't try exporting a non-3D object to stl or off
Diffstat (limited to 'src/openscad.cc')
-rw-r--r-- | src/openscad.cc | 12 |
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); } |