MCPcopy Create free account
hub / github.com/Stanko/offset-polygon / offsetPolygon

Function offsetPolygon

lib/offset-polygon.js:157–164  ·  view source on GitHub ↗
(vertices, offset, arcSegments = 0)

Source from the content-addressed store, hash-verified

155 return paddingPolygon;
156}
157function offsetPolygon(vertices, offset, arcSegments = 0) {
158 const polygon = createPolygon(vertices);
159 if (offset > 0) {
160 return createMarginPolygon(polygon, offset, arcSegments).vertices;
161 } else {
162 return createPaddingPolygon(polygon, -offset, arcSegments).vertices;
163 }
164}
165export {
166 offsetPolygon as default
167};

Callers

nothing calls this directly

Calls 3

createPolygonFunction · 0.70
createMarginPolygonFunction · 0.70
createPaddingPolygonFunction · 0.70

Tested by

no test coverage detected