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

Function createOffsetEdge

lib/offset-polygon.js:91–102  ·  view source on GitHub ↗
(edge, dx, dy)

Source from the content-addressed store, hash-verified

89 vertices.push(endVertex);
90}
91function createOffsetEdge(edge, dx, dy) {
92 return {
93 vertex1: {
94 x: edge.vertex1.x + dx,
95 y: edge.vertex1.y + dy
96 },
97 vertex2: {
98 x: edge.vertex2.x + dx,
99 y: edge.vertex2.y + dy
100 }
101 };
102}
103function createMarginPolygon(polygon, offset, arcSegments) {
104 const offsetEdges = [];
105 for (let i = 0; i < polygon.edges.length; i++) {

Callers 2

createMarginPolygonFunction · 0.70
createPaddingPolygonFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected