diff --git a/cameo/path.c b/cameo/path.c index be3b37e..17789a0 100644 --- a/cameo/path.c +++ b/cameo/path.c @@ -88,6 +88,12 @@ static int path_is_closed(const struct path *path) static void path_add_point(struct path *path, struct point *p) { + if (path->last && + path->last->x == p->x && path->last->y == p->y && + path->last->z == p->z) { + free(p); + return; + } p->next = NULL; if (path->last) path->last->next = p;