Make sure a drawn shape is clean and not self-intersecting.
| 1149 | |
| 1150 | // Make sure a drawn shape is clean and not self-intersecting. |
| 1151 | void cleanUpShape(std::vector<Vec2f>& shape) |
| 1152 | { |
| 1153 | ClipperLib::Path path; |
| 1154 | ClipperLib::Paths outPath; |
| 1155 | buildPathFromShape(shape, path); |
| 1156 | ClipperLib::SimplifyPolygon(path, outPath); |
| 1157 | ClipperLib::ReversePath(path); |
| 1158 | |
| 1159 | if (!outPath.empty()) |
| 1160 | { |
| 1161 | buildShapeFromPath(outPath[0], shape); |
| 1162 | } |
| 1163 | } |
| 1164 | |
| 1165 | void removeDegeneratePaths(ClipperLib::Paths& paths) |
| 1166 | { |
nothing calls this directly
no test coverage detected