Rotation functions?

Agreed:

rotate point (px, py) around point (ox, oy) by angle theta:

p'x = cos(theta) * (px-ox) - sin(theta) * (py-oy) + ox

p'y = sin(theta) * (px-ox) + cos(theta) * (py-oy) + oy

That will work for our purposes, just calculate the rotated x+y values before using zranger’s functions should work, I think. And for a given rotation of a shape, you could precalculate the sine/cosine just once per shape. So pretty quick.