Untested, but implement z-interpolation for points and lines.