(rx, ry)
| 392 | |
| 393 | @functools.lru_cache(maxsize=10000) |
| 394 | def _setup_rect(rx, ry): |
| 395 | t = np.linspace(0, np.pi / 2, 1 if max(rx, ry) == 0 else 64) |
| 396 | s = 1 - np.sin(t); c = 1 - np.cos(t) |
| 397 | x = [c * rx, 1 - s * rx, 1 - c * rx, s * rx] |
| 398 | y = [s * ry, c * ry, 1 - s * ry, 1 - c * ry] |
| 399 | v = np.stack([x, y], axis=-1).reshape(-1, 2) |
| 400 | return v.astype('float32') |
| 401 | |
| 402 | #---------------------------------------------------------------------------- |
| 403 |