Tussenpunten van anchorpoints

This commit is contained in:
Ruben van de Ven 2020-12-22 12:08:49 +01:00
parent 7329f8e7ae
commit cc505355b3
1 changed files with 11 additions and 0 deletions

View File

@ -51,6 +51,17 @@ function getPathShapeBetweenPoints(p1, p2, corners) {
}
// teken punten tussen alle punten
let allCornerPoints = [];
for (let index = 0; index < cornerPoints.length; index++) {
const c = cornerPoints[index];
const nextC = cornerPoints[(index+1)%cornerPoints.length];
allCornerPoints.push(c);
allCornerPoints.push([.5*(nextC[0]+c[0]), .5*(nextC[1]+c[1])]);
}
cornerPoints = allCornerPoints;
// create d:
let d = "";