MCPcopy Create free account
hub / github.com/microsoft/SandDance / modifyPolygonWindingDirection

Function modifyPolygonWindingDirection

docs/app/js/sanddance-app.js:101626–101633  ·  view source on GitHub ↗
(points, direction, options = {})

Source from the content-addressed store, hash-verified

101624 WINDING1[WINDING1["COUNTER_CLOCKWISE"] = -1] = "COUNTER_CLOCKWISE";
101625})(WINDING || (WINDING = {}));
101626function modifyPolygonWindingDirection(points, direction, options = {}) {
101627 const windingDirection = getPolygonWindingDirection(points, options);
101628 if (windingDirection !== direction) {
101629 reversePolygon(points, options);
101630 return true;
101631 }
101632 return false;
101633}
101634function getPolygonWindingDirection(points, options = {}) {
101635 return Math.sign(getPolygonSignedArea(points, options));
101636}

Callers

nothing calls this directly

Calls 2

reversePolygonFunction · 0.70

Tested by

no test coverage detected