summaryrefslogtreecommitdiff
path: root/meme/meme.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2015-03-14 19:35:58 (GMT)
committerWerner Almesberger <werner@almesberger.net>2015-03-14 19:35:58 (GMT)
commit6b7491bd5298dd31c09c63bf08adbc1f7013345d (patch)
tree436ff9e7866b8da6f95db6108e2d9284f8c99a3a /meme/meme.c
parent21d686b4c66f725ddf76e9e5fa6a416e7028fe77 (diff)
downloadmisc-6b7491bd5298dd31c09c63bf08adbc1f7013345d.zip
misc-6b7491bd5298dd31c09c63bf08adbc1f7013345d.tar.gz
misc-6b7491bd5298dd31c09c63bf08adbc1f7013345d.tar.bz2
meme/: new option -n to select outline calculation based on needle shape
Diffstat (limited to 'meme/meme.c')
-rw-r--r--meme/meme.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/meme/meme.c b/meme/meme.c
index aab8736..4480f3f 100644
--- a/meme/meme.c
+++ b/meme/meme.c
@@ -11,6 +11,7 @@
*/
+#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -55,7 +56,7 @@ static void usage(const char *name)
{
fprintf(stderr,
"usage: %s [-l logfile] [-o overlay.gp ...] [file.stl]\n"
-" %s -s plane.gp [file.stl]\n",
+" %s -s plane.gp [-n] [file.stl]\n",
name, name);
exit(1);
}
@@ -66,15 +67,19 @@ int main(int argc, char **argv)
int c;
const char *logfile = NULL;
const char *slice = NULL;
+ bool needle = 0;
const struct overlay *overlays[N_OVERLAYS];
unsigned n_overlays = 0;
struct time t_load;
- while ((c = getopt(argc, argv, "l:o:s:")) != EOF)
+ while ((c = getopt(argc, argv, "l:no:s:")) != EOF)
switch (c) {
case 'l':
logfile = optarg;
break;
+ case 'n':
+ needle = 1;
+ break;
case 'o':
if (n_overlays == N_OVERLAYS) {
fprintf(stderr, "too many overlays\n");
@@ -110,7 +115,7 @@ int main(int argc, char **argv)
if (slice) {
slice_load(slice);
- slice_run(slice_out, 0);
+ slice_run(slice_out, needle);
exit(1);
}