(N, R)
| 95 | # https://rufat.be/triangle/examples.html |
| 96 | # effective: qpa0.1 |
| 97 | def circle(N, R): |
| 98 | i = np.arange(N) |
| 99 | theta = i * 2 * np.pi / N |
| 100 | pts = np.stack([np.cos(theta), np.sin(theta)], axis=1) * R |
| 101 | seg = np.stack([i, i + 1], axis=1) % N |
| 102 | return pts, seg |
| 103 | |
| 104 | pts0, seg0 = circle(30, 1.4) |
| 105 | pts1, seg1 = circle(16, 0.6) |