MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / cleanUpShape

Function cleanUpShape

TheForceEngine/TFE_Polygon/polygon.cpp:1151–1163  ·  view source on GitHub ↗

Make sure a drawn shape is clean and not self-intersecting.

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 5

buildPathFromShapeFunction · 0.85
SimplifyPolygonFunction · 0.85
ReversePathFunction · 0.85
buildShapeFromPathFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected