gfx.patch.frame

gfx.patch

frame(c, e1) -> frame

The orthonormal frame the primitive reads a patch in

c is the patch's centre and e1 its along direction, in the object frame: +y the pole, +x the zero meridian. Each is {x, y, z} or {x=, y=, z=}, and need not be unit length.

Returns { c = {x, y, z}, e1 = {x, y, z}, e2 = {x, y, z} }: c normalised; e1 with its component along c removed, normalised; and e2 = c × e1. Map columns run along e1, rows along e2. frame.c and frame.e1 can go into a window entry as they are.

Returns nil for a zero-length centre, an along within a microradian of the centre or its opposite, or a non-finite component. The primitive refuses such a window too.