diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-06 02:04:49 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-06 02:04:49 (GMT) |
commit | 255826eeb598081ab65c4a339d818bf8d8709934 (patch) | |
tree | 909507085a6ccf91313eaec3ae3b79b909e5ee08 /openscad.cc | |
parent | e71c3ce4c9ac506a1138c87df829bb0b187fe056 (diff) |
Clifford Wolf:
Added DXF export for 2d data (command line and GUI)
git-svn-id: http://svn.clifford.at/openscad/trunk@208 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'openscad.cc')
-rw-r--r-- | openscad.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/openscad.cc b/openscad.cc index c22a083..edc94b4 100644 --- a/openscad.cc +++ b/openscad.cc @@ -35,7 +35,7 @@ static void help(const char *progname) { - fprintf(stderr, "Usage: %s [ { -s stl_file | -o off_file } [ -d deps_file ] ]\\\n" + fprintf(stderr, "Usage: %s [ { -s stl_file | -o off_file | -x dxf_file } [ -d deps_file ] ]\\\n" "%*s[ -m make_command ] [ -D var=val [..] ] filename\n", progname, strlen(progname)+8, ""); exit(1); @@ -90,24 +90,30 @@ int main(int argc, char **argv) const char *filename = NULL; const char *stl_output_file = NULL; const char *off_output_file = NULL; + const char *dxf_output_file = NULL; const char *deps_output_file = NULL; int opt; - while ((opt = getopt(argc, argv, "s:o:d:m:D:")) != -1) + while ((opt = getopt(argc, argv, "s:o:x:d:m:D:")) != -1) { switch (opt) { case 's': - if (stl_output_file || off_output_file) + if (stl_output_file || off_output_file || dxf_output_file) help(argv[0]); stl_output_file = optarg; break; case 'o': - if (stl_output_file || off_output_file) + if (stl_output_file || off_output_file || dxf_output_file) help(argv[0]); off_output_file = optarg; break; + case 'x': + if (stl_output_file || off_output_file || dxf_output_file) + help(argv[0]); + dxf_output_file = optarg; + break; case 'd': if (deps_output_file) help(argv[0]); @@ -134,7 +140,7 @@ int main(int argc, char **argv) help(argv[0]); #endif - if (stl_output_file || off_output_file) + if (stl_output_file || off_output_file || dxf_output_file) { if (!filename) help(argv[0]); @@ -209,6 +215,9 @@ int main(int argc, char **argv) if (off_output_file) export_off(root_N, off_output_file, NULL); + if (dxf_output_file) + export_dxf(root_N, dxf_output_file, NULL); + delete root_node; delete root_N; #else |