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:
17
cameo/ops.c
17
cameo/ops.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user