From cc505355b3c2181c2f881ff88e4edfafb8444bc9 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 22 Dec 2020 12:08:49 +0100 Subject: [PATCH] Tussenpunten van anchorpoints --- www/js/svg.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/www/js/svg.js b/www/js/svg.js index 2b73143..ea637ee 100644 --- a/www/js/svg.js +++ b/www/js/svg.js @@ -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 = "";