MCPcopy Index your code
hub / github.com/XingangPan/DragGAN / _setup_rect

Function _setup_rect

gui_utils/gl_utils.py:394–400  ·  view source on GitHub ↗
(rx, ry)

Source from the content-addressed store, hash-verified

392
393@functools.lru_cache(maxsize=10000)
394def _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

Callers 1

draw_rectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected