emit_path();
}
+/* Join together two points each at the end of a path */
+static void
+join_ends(point *a, point *b)
+{
+ assert(a->next == NULL);
+ assert(a->prev != NULL);
+ assert(b->prev == NULL);
+ assert(b->next != NULL);
+ a->next = b;
+ b->prev = a;
+ fix_identical(a); /* Will delete a */
+ fix_collinear(b); /* Will delete b */
+}
+
+static bool
+point_endp(point *p)
+{
+ return p->next == NULL || p->prev == NULL;
+}
+
+static void
+clean_skeleton()
+{
+ int i, j;
+
+ for (i = 0; i < nextpoint; i++) {
+ if (points[i].prev == NULL && points[i].next == NULL)
+ continue;
+ for (j = 0; j < nextpoint; j++) {
+ if (points[j].prev == NULL && points[j].next == NULL)
+ continue;
+ if (vec_eqp(points[i].v, points[j].v) &&
+ points[i].next == NULL && points[j].prev == NULL &&
+ vec_inline3(points[i].prev->v, points[i].v,
+ points[j].next->v))
+ join_ends(&points[i], &points[j]);
+ if (points[i].prev == NULL && points[i].next == NULL)
+ break;
+ }
+ }
+}
+
static void
dochar_plotter(char const data[YSIZE], unsigned flags)
{
}
}
}
+ clean_skeleton();
emit_path();
}