1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2025-04-21 12:27:27 +03:00

ptrude/: changed extrusion from xy path to xz path; variable number of faces

This commit is contained in:
Werner Almesberger
2011-07-31 09:57:51 -03:00
parent 7ef626988c
commit ee634458dc
3 changed files with 83 additions and 74 deletions

View File

@@ -64,12 +64,13 @@ static void do_face(void *data, struct point a, struct point b, struct point c)
}
static void do_extrude(const struct path *path, const struct path *shape)
static void do_extrude(const struct path *path, const struct path *shape,
double r, double d)
{
FILE *file = stdout;
fprintf(file, "solid ptrude\n");
extrude(path, shape, do_face, file);
extrude(path, shape, r, d, do_face, file);
fprintf(file, "endsolid ptrude\n");
}
@@ -87,7 +88,8 @@ static void usage(const char *name)
int main(int argc, char **argv)
{
FILE *file;
const struct path *path = NULL, *shape;
struct path *path = NULL;
const struct path *shape;
double r, d;
char *end;
int c;
@@ -128,9 +130,9 @@ int main(int argc, char **argv)
/*
* We split the error budget evenly between path and shape.
*/
path = round_path(path, r, sqrt(d));
path_set_length(path);
shape = round_path(shape, r, sqrt(d));
do_extrude(path, shape);
do_extrude(path, shape, r, sqrt(d));
} else {
shape = round_path(shape, r, d);
save_path(stdout, shape);