use less points in circle

This commit is contained in:
casperlamboo 2017-12-11 11:47:39 +01:00
parent 03e3780a6f
commit 2973f9b9b2

View File

@ -83,7 +83,7 @@ function shapeToPointsRaw(shapeData) {
const { radius, segment } = shapeData.circle;
const points = [];
const circumference = 2 * radius * Math.PI;
const numSegments = circumference;
const numSegments = Math.max(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;