(arcSegments, vertices, center, radius, startVertex, endVertex, isPaddingBoundary)
| 67 | }; |
| 68 | } |
| 69 | function appendArc(arcSegments, vertices, center, radius, startVertex, endVertex, isPaddingBoundary) { |
| 70 | var startAngle = Math.atan2(startVertex.y - center.y, startVertex.x - center.x); |
| 71 | var endAngle = Math.atan2(endVertex.y - center.y, endVertex.x - center.x); |
| 72 | if (startAngle < 0) { |
| 73 | startAngle += TWO_PI; |
| 74 | } |
| 75 | if (endAngle < 0) { |
| 76 | endAngle += TWO_PI; |
| 77 | } |
| 78 | const angle = startAngle > endAngle ? startAngle - endAngle : startAngle + TWO_PI - endAngle; |
| 79 | const angleStep = (isPaddingBoundary ? -angle : TWO_PI - angle) / arcSegments; |
| 80 | vertices.push(startVertex); |
| 81 | for (let i = 1; i < arcSegments; ++i) { |
| 82 | const angle2 = startAngle + angleStep * i; |
| 83 | const vertex = { |
| 84 | x: center.x + Math.cos(angle2) * radius, |
| 85 | y: center.y + Math.sin(angle2) * radius |
| 86 | }; |
| 87 | vertices.push(vertex); |
| 88 | } |
| 89 | vertices.push(endVertex); |
| 90 | } |
| 91 | function createOffsetEdge(edge, dx, dy) { |
| 92 | return { |
| 93 | vertex1: { |
no outgoing calls
no test coverage detected