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

cameo: new command "reverse" to reverse all paths

Experimentally used to reverse tool direction in the smoothing pass.
This commit is contained in:
Werner Almesberger
2012-03-21 20:31:29 -03:00
parent c422be5543
commit c59e39356b
5 changed files with 36 additions and 6 deletions

View File

@@ -1,8 +1,8 @@
/*
* ops.c - Higher-level toolpath operations
*
* Written 2010-2011 by Werner Almesberger
* Copyright 2010-2011 Werner Almesberger
* Written 2010-2012 by Werner Almesberger
* Copyright 2010-2012 Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -140,3 +140,16 @@ struct path *optimize_paths(struct path *paths)
}
return res;
}
struct path *reverse_paths(const struct path *paths)
{
const struct path *path;
struct path *res = NULL, **last = &res;
for (path = paths; path; path = path->next) {
*last = path_reverse(path);
last = &(*last)->next;
}
return res;
}