From 673d73cf31fdafa0dc03876cde0db5b4aab10d1c Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Thu, 8 Sep 2011 06:54:50 +0200 Subject: Don't try exporting a non-3D object to stl or off 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); } -- cgit v0.10.1