-# define PUSH(PR,PTH) \
- points[npoints].x = cos(TH+th[(PTH)]) * r[(PR)]; \
- points[npoints].y = sin(TH+th[(PTH)]) * r[(PR)]; \
- npoints++
-
- /* start1 = npoints; */
-
- PUSH(3, 0); /* tooth left 1 */
- PUSH(2, 1); /* tooth left 2 */
- PUSH(1, 2); /* tooth left 3 */
- PUSH(0, 3); /* tooth top 1 */
- PUSH(0, 5); /* tooth top 2 */
- PUSH(1, 6); /* tooth right 1 */
- PUSH(2, 7); /* tooth right 2 */
- PUSH(3, 8); /* tooth right 3 */
- PUSH(3, 10); /* gap top */
-
- /* end1 = npoints; */
-
- PUSH(4, 8); /* gap interior */
-
- /* start2 = npoints; */
-
- PUSH(4, 10); /* tooth interior 1 */
- PUSH(4, 8); /* tooth interior 2 */
- PUSH(4, 4); /* tooth bottom 1 */
- PUSH(4, 0); /* tooth bottom 2 */
-
- /* end2 = npoints; */
-
- PUSH(3, 4); /* midpoint */
-
- /* mid = npoints-1; */
-
- if (i == 0 && npoints != ppt) abort(); /* go update "ppt"! */
+# define PUSH(OPR,IPR,PTH) \
+ orim->points[orim->npoints].x = cos(TH+th[(PTH)]) * r[(OPR)]; \
+ orim->points[orim->npoints].y = sin(TH+th[(PTH)]) * r[(OPR)]; \
+ orim->npoints++; \
+ irim->points[irim->npoints].x = cos(TH+th[(PTH)]) * r[(IPR)]; \
+ irim->points[irim->npoints].y = sin(TH+th[(PTH)]) * r[(IPR)]; \
+ irim->npoints++
+
+ if (g->size == SMALL)
+ {
+ PUSH(3, 4, 0); /* tooth left 1 */
+ PUSH(0, 4, 4); /* tooth top middle */
+ }
+ else if (g->size == MEDIUM)
+ {
+ PUSH(3, 4, 0); /* tooth left 1 */
+ PUSH(0, 4, 3); /* tooth top left */
+ PUSH(0, 4, 5); /* tooth top right */
+ PUSH(3, 4, 8); /* tooth right 3 */
+ }
+ else if (g->size == LARGE)
+ {
+ PUSH(3, 4, 0); /* tooth left 1 */
+ PUSH(2, 4, 1); /* tooth left 2 */
+ PUSH(1, 4, 2); /* tooth left 3 */
+ PUSH(0, 4, 3); /* tooth top left */
+ PUSH(0, 4, 5); /* tooth top right */
+ PUSH(1, 4, 6); /* tooth right 1 */
+ PUSH(2, 4, 7); /* tooth right 2 */
+ PUSH(3, 4, 8); /* tooth right 3 */
+ PUSH(3, 4, 9); /* gap top */
+ }
+ else
+ abort();