X-Git-Url: https://git.draconx.ca/gitweb/slotifier.git/blobdiff_plain/4e70965948424923dcf71edd99c08cc83c9daedb..5c9f3276505a9cbe000842401cbf7dd132b48ccb:/src/slotifier.c diff --git a/src/slotifier.c b/src/slotifier.c index 0165931..b74a9ec 100644 --- a/src/slotifier.c +++ b/src/slotifier.c @@ -221,7 +221,7 @@ static int combine_holes(gerbv_image_t *drill, gerbv_net_t *hole, hole->aperture = -hole->aperture; for (i = 0; i < CVectorSize(group); i++) { - double xy[2], dia; + double xy[2], dia, r; CVectorGetElement(group, &hole, i); tool = drill->aperture[abs(hole->aperture)]; @@ -230,10 +230,13 @@ static int combine_holes(gerbv_image_t *drill, gerbv_net_t *hole, xy[0] = hole->start_x; xy[1] = hole->start_y; dia = tool->parameter[0]; + /* Half a mil slop to decisively include points on boundary. */ + r = dia/2 + 0.0005; + if (drill->aperture[biggest_tool]->parameter[0] < dia) biggest_tool = abs(hole->aperture); - if (CNearTreeFindInSphere(t, dia, 0, tmp, xy, 1) != 0) { + if (CNearTreeFindInSphere(t, r, 0, tmp, xy, 1) != 0) { /* We should always should find at least one hole! */ fprintf(stderr, _("%s: fatal error searching holes\n"), progname);