0
0
mirror of https://github.com/Doodle3D/Doodle3D-Core.git synced 2025-05-10 01:13:23 +02:00

fix num segments of circle

This commit is contained in:
casperlamboo 2017-12-11 12:52:48 +01:00
parent e99ca6af58
commit dbe9dff274

@ -83,7 +83,7 @@ function shapeToPointsRaw(shapeData) {
const { radius, segment } = shapeData.circle;
const points = [];
const circumference = 2 * radius * Math.PI;
const numSegments = Math.max(circumference * 2, 32);
const numSegments = Math.min(circumference * 2, 64);
for (let rad = 0; rad <= segment; rad += Math.PI * 2 / numSegments) {
const x = Math.sin(rad) * radius;
const y = -Math.cos(rad) * radius;