Fixes #10324. (cherry picked from commit 71a496803c6c8cd840a88644529f12d93f2603fc)
@@ -646,7 +646,8 @@ debug path
break;
}
- path.push_back(begin_point);
+ if (path[path.size() - 1].distance_to(begin_point) > CMP_EPSILON)
+ path.push_back(begin_point);
path.invert();