Skip to content

Commit 0e6fd5f

Browse files
committed
Fix num of circle points
1 parent 0c4e410 commit 0e6fd5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shape/shapeToPoints.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ function shapeToPointsRaw(shapeData) {
8383
const { radius, segment } = shapeData.circle;
8484
const points = [];
8585
const circumference = 2 * radius * Math.PI;
86-
const numSegments = Math.min(circumference * 2, 64);
87-
for (let rad = 0; rad <= segment; rad += Math.PI * 2 / numSegments) {
86+
const numSegments = Math.max(3, Math.min(circumference * 2, 32));
87+
for (let rad = 0; rad < segment; rad += Math.PI * 2 / numSegments) {
8888
const x = Math.sin(rad) * radius;
8989
const y = -Math.cos(rad) * radius;
9090
points.push(new Vector(x, y));

0 commit comments

Comments
 (0)