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

Added override (in gnuplot file) for inside/outside path detection.

- cameo/cameo.c (process_paths): explain the inside/outside path detection
  heuristics
- cameo/path.h (struct path), cameo/path.c (path_new): added attribute
  "outside" to explicitly mark paths as outside edges
- cameo/path.c (path_from): new function to make a path that takes the
  attributes of another path
- cameo/path.c (path_reverse, path_offset): use path_from instead of
  path_new
- cameo/gnuplot.c (gnuplot_read, gnuplot_do_write): read and write the
  #%outside hint
This commit is contained in:
Werner Almesberger
2010-11-01 18:50:24 -03:00
parent 17afa3e2bb
commit d77b4c8570
4 changed files with 37 additions and 3 deletions

View File

@@ -45,12 +45,23 @@ struct path *path_new(double r_tool)
path = alloc_type(struct path);
path->r_tool = r_tool;
path->outside = 0;
path->first = path->last = NULL;
path->next = NULL;
return path;
}
static struct path *path_from(const struct path *old)
{
struct path *new;
new = path_new(old->r_tool);
new->outside = old->outside;
return new;
}
static struct point *clone_point(struct point *p)
{
struct point *n;
@@ -113,7 +124,7 @@ struct path *path_reverse(const struct path *path)
const struct point *p;
struct point *n;
new = path_new(path->r_tool);
new = path_from(path);
for (p = path->first; p; p = p->next) {
n = alloc_type(struct point);
n->x = p->x;
@@ -275,7 +286,7 @@ struct path *path_offset(const struct path *path, int left, int notch)
int dog;
assert(path_is_closed(path));
new = path_new(path->r_tool);
new = path_from(path);
prev = path->first;
for (p = path->first->next; p; p = p->next) {
next = p->next ? p->next : path->first->next;