From 0e6fd5fb1c1121f9af7b431d37ee90b552753724 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Mon, 18 Dec 2017 17:05:24 +0100 Subject: [PATCH] Fix num of circle points --- src/shape/shapeToPoints.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shape/shapeToPoints.js b/src/shape/shapeToPoints.js index e82d355..730e0af 100644 --- a/src/shape/shapeToPoints.js +++ b/src/shape/shapeToPoints.js @@ -83,8 +83,8 @@ function shapeToPointsRaw(shapeData) { const { radius, segment } = shapeData.circle; const points = []; const circumference = 2 * radius * Math.PI; - const numSegments = Math.min(circumference * 2, 64); - for (let rad = 0; rad <= segment; rad += Math.PI * 2 / numSegments) { + const numSegments = Math.max(3, Math.min(circumference * 2, 32)); + for (let rad = 0; rad < segment; rad += Math.PI * 2 / numSegments) { const x = Math.sin(rad) * radius; const y = -Math.cos(rad) * radius; points.push(new Vector(x, y));