Skip to content

Commit

Permalink
Fix num of circle points
Browse files Browse the repository at this point in the history
  • Loading branch information
casperlamboo committed Dec 18, 2017
1 parent 0c4e410 commit 0e6fd5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shape/shapeToPoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 0e6fd5f

Please sign in to comment.