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

cameo: cleaned up and documented the tool compensation

- README, lang.l, lang.y: renamed the "tool" command to "offset"
- README: documented "offset"
- ops.h, ops.c (tool_comp_paths), cameo.c (main), lang.y: added
  parameter to tool_comp_paths to treat all paths as internal
- lang.l, lang.y: added option "inside" to the "offset" command
- lang.y: "offset" can now take multiple options in any order
This commit is contained in:
Werner Almesberger
2010-12-14 23:37:31 -03:00
parent 68d5eff7cd
commit 3ae3d6cdd3
6 changed files with 55 additions and 18 deletions

View File

@@ -29,7 +29,7 @@ static void tool_comp_1(struct path *path, int inside, int dog_bone)
}
void tool_comp_paths(struct path *paths, int dog_bone)
void tool_comp_paths(struct path *paths, int dog_bone, int all_inside)
{
struct path *leftmost, *path;
@@ -46,10 +46,11 @@ void tool_comp_paths(struct path *paths, int dog_bone)
leftmost = path_find_leftmost(paths);
for (path = paths; path; path = path->next)
if (path != leftmost && !path->outside)
if (path != leftmost && (all_inside || !path->outside))
tool_comp_1(path, 1, dog_bone);
for (path = paths; path; path = path->next)
if (path != leftmost && path->outside)
tool_comp_1(path, 0, dog_bone);
tool_comp_1(leftmost, 0, dog_bone);
if (!all_inside)
for (path = paths; path; path = path->next)
if (path != leftmost && path->outside)
tool_comp_1(path, 0, dog_bone);
tool_comp_1(leftmost, !all_inside, dog_bone);
}