diff --git a/cameo/README b/cameo/README index 6e3216b..72ea427 100644 --- a/cameo/README +++ b/cameo/README @@ -138,9 +138,41 @@ changes this to cutting a "dogbone" hole such that material is also removed up to the corner point. -Drill/mill substitution: +Drill/mill conversion: drill mill remainder empty + +"drill" and "mill" search for paths that can be processed with the +specified tool and generate the corresponding toolpaths. After "drill" +or "mill", only the toolpaths for this tool remain. The paths that +have been converted are removed and the paths for which the tool is +unsuitable are moved to a separate list, the remainder list. + +"remainder" clears the list of paths and sets the list of paths to +the remainder list. Note that "clear" does not affect the remainder +list. + +"empty" does nothing if the list of paths is empty and makes cameo +exit with an error if there are paths in the list. This can be used +to ensure that all paths in a file have been converted. + +Example: + + excellon example.drl + drill 7mil 13mil + write drill.gp + remainder + mill 0.8mm 0.01mm + write mill.gp + remainder + empty + +In this example, we first load a drill file. Then we generate drill +commands for all simple holes with a diameter between 7 mil and 13 mil +and write the toolpaths to the file "drill.gp". Next, we retrieve the +remaining paths, generate toolpaths for a 0.8 mm endmill, and write +them to the file "mill.gp". Finally, we check that all paths have been +processed. diff --git a/cameo/lang.y b/cameo/lang.y index a960996..029a79e 100644 --- a/cameo/lang.y +++ b/cameo/lang.y @@ -247,7 +247,7 @@ command: remain = paths; paths = NULL; - walk = &paths; + walk = &remain; while (*walk) walk = classify(walk, try_drill(*walk, $2, $3)); @@ -258,7 +258,7 @@ command: remain = paths; paths = NULL; - walk = &paths; + walk = &remain; while (*walk) walk = classify(walk, try_mill(*walk, $2, $3)); } diff --git a/cameo/shape.c b/cameo/shape.c index e8c1819..61879a6 100644 --- a/cameo/shape.c +++ b/cameo/shape.c @@ -39,7 +39,7 @@ static void half_circle(double cx, double cy, double rx, double ry, double z, m[3] = m[0]; for (a = 0; a < M_PI; a += s) { - path_add(path, cx+x, cy+x, z); + path_add(path, cx+x, cy+y, z); tmp = x*m[0]+y*m[1]; y = x*m[2]+y*m[3]; x = tmp;