gp2rml/gp2rml.c: new option "-t top" to manually set z_max

This commit is contained in:
Werner Almesberger 2015-05-22 11:27:56 -03:00
parent efe5f38eb4
commit d3bccb6bfc
1 changed files with 8 additions and 2 deletions

View File

@ -189,6 +189,7 @@ static void usage(const char *name)
fprintf(stderr,
"usage: %s [-s z_scale] z_clear[mm] xy_speed z_speed [file]\n\n"
" -s z_scale scale Z axis by z_scale (default: 1.0)\n"
" -t top set the top elevation, in mm (default: auto-detect)\n"
" z_clear clearance above the highest peak, in mm (must be > 0)\n"
" Unit (\"mm\") can optionally be specified\n"
" xy_speed cutting speed, in mm/s\n"
@ -206,13 +207,18 @@ int main(int argc, char *const *argv)
double p[3];
int c;
while ((c = getopt(argc, argv, "s:")) != EOF)
while ((c = getopt(argc, argv, "s:t:")) != EOF)
switch (c) {
case 's':
z_scale = strtod(optarg &end);
z_scale = strtod(optarg, &end);
if (*end)
usage(*argv);
break;
case 't':
z_max = strtod(optarg, &end);
if (*end && !strcmp(end, "mm"))
usage(*argv);
break;
default:
usage(*argv);
}