1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2025-01-03 20:50:15 +02:00

cameo: "area" now also adds the outline cuts

"offset" wasn't suitable for alternating inside and outside anyway.
This commit is contained in:
Werner Almesberger 2012-03-18 17:01:10 -03:00
parent 8c4dfc55b6
commit 35c0624dc5
3 changed files with 15 additions and 7 deletions

View File

@ -267,6 +267,18 @@ printf(" x=%g\n", x);
}
static void add_outline(const struct path *path, int inside, struct path **res)
{
struct path *new;
int left;
left = path_tool_is_left(path);
new = path_offset(path, inside ? !left : left, 0);
new->next = *res;
*res = new;
}
static void fill_path(const struct path *paths, const struct path *path,
double r_tool, double overlap, struct path **res)
{
@ -292,8 +304,10 @@ printf("x[%g:%g] y[%g:%g] n=%d\n", xa, xb, ya, yb, n);
for (s2 = sub2; *s2; s2++)
fill_path(paths, *s2, r_tool, overlap, res);
free(sub2);
add_outline(*s, 0, res);
}
free(sub);
add_outline(path, 1, res);
}

View File

@ -1,10 +1,6 @@
#!/bin/sh
../cameo <<EOF
gnuplot 3 in.gp
offset inside
write out.gp
clear
gnuplot 3 in.gp
area 3 0
append out.gp
write out.gp
EOF

View File

@ -16,14 +16,12 @@
10 100 0
0 0 0
#%outside
50 40 0
80 40 0
80 70 0
50 70 0
50 40 0
#%outside
10 30 0
30 30 0
30 50 0