Generic alignment functions

align v aligns a boundable object along the edge in the
direction of v. That is, it moves the local origin in the
direction of v until it is on the boundary. (Note that if the
local origin is outside the boundary to begin, it may have to
move "backwards".)

align v d a moves the origin of a along the vector v. If d
= 1, the origin is moved to the boundary in the direction of
v; if d = -1, it moves to the boundary in the direction of
the negation of v. Other values of d interpolate linearly
(so for example, d = 0 centers the origin along the direction
of v).