|
@@ -31,14 +31,14 @@ int make_arc(int offset, /* offset into array of points */
|
|
|
xpnts[arr_size] = radius * cos(alpha) + centerx;
|
|
|
ypnts[arr_size] = radius * sin(alpha) + centery;
|
|
|
zpnts[arr_size] = zcoor;
|
|
|
+ arr_size++;
|
|
|
theta -= RSTEP;
|
|
|
- if (arr_size >= arr_max - 1) {
|
|
|
+ if (arr_size == arr_max) {
|
|
|
arr_max += ARR_INCR;
|
|
|
xpnts = (double *)G_realloc(xpnts, arr_max * sizeof(double));
|
|
|
ypnts = (double *)G_realloc(ypnts, arr_max * sizeof(double));
|
|
|
zpnts = (double *)G_realloc(zpnts, arr_max * sizeof(double));
|
|
|
}
|
|
|
- arr_size++;
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
@@ -48,14 +48,14 @@ int make_arc(int offset, /* offset into array of points */
|
|
|
xpnts[arr_size] = radius * cos(alpha) + centerx;
|
|
|
ypnts[arr_size] = radius * sin(alpha) + centery;
|
|
|
zpnts[arr_size] = zcoor;
|
|
|
+ arr_size++;
|
|
|
theta += RSTEP;
|
|
|
- if (arr_size >= arr_max - 1) {
|
|
|
+ if (arr_size == arr_max) {
|
|
|
arr_max += ARR_INCR;
|
|
|
xpnts = (double *)G_realloc(xpnts, arr_max * sizeof(double));
|
|
|
ypnts = (double *)G_realloc(ypnts, arr_max * sizeof(double));
|
|
|
zpnts = (double *)G_realloc(zpnts, arr_max * sizeof(double));
|
|
|
}
|
|
|
- arr_size++;
|
|
|
}
|
|
|
}
|
|
|
/* this insures that the last point will be correct */
|
|
@@ -63,13 +63,13 @@ int make_arc(int offset, /* offset into array of points */
|
|
|
xpnts[arr_size] = radius * cos(alpha) + centerx;
|
|
|
ypnts[arr_size] = radius * sin(alpha) + centery;
|
|
|
zpnts[arr_size] = zcoor;
|
|
|
- if (arr_size >= arr_max - 1) {
|
|
|
+ arr_size++;
|
|
|
+ if (arr_size == arr_max) {
|
|
|
arr_max += ARR_INCR;
|
|
|
xpnts = (double *)G_realloc(xpnts, arr_max * sizeof(double));
|
|
|
ypnts = (double *)G_realloc(ypnts, arr_max * sizeof(double));
|
|
|
zpnts = (double *)G_realloc(zpnts, arr_max * sizeof(double));
|
|
|
}
|
|
|
- arr_size++;
|
|
|
|
|
|
return arr_size - offset;
|
|
|
}
|
|
@@ -88,13 +88,13 @@ int make_arc_from_polyline(int arr_size, double bulge, double prev_bulge)
|
|
|
arc_tan = (-1.0) * prev_bulge;
|
|
|
|
|
|
if (arc_tan == 0.0) { /* straight line segment */
|
|
|
- if (arr_size >= arr_max - 1) {
|
|
|
+ arr_size++;
|
|
|
+ if (arr_size == arr_max) {
|
|
|
arr_max += ARR_INCR;
|
|
|
xpnts = (double *)G_realloc(xpnts, arr_max * sizeof(double));
|
|
|
ypnts = (double *)G_realloc(ypnts, arr_max * sizeof(double));
|
|
|
zpnts = (double *)G_realloc(zpnts, arr_max * sizeof(double));
|
|
|
}
|
|
|
- arr_size++;
|
|
|
}
|
|
|
else if (!(xpnts[arr_size - 1] == xpnts[arr_size] &&
|
|
|
ypnts[arr_size - 1] == ypnts[arr_size]))
|