Howto get texture color from brep

Sorry, but with your code i have the same issue.

If i change the UVW rotation in the mapping channel, i do not get the right result. If i change the UVW repeat it works perfect, also with the UVW offset.
@andy do you have any clue what is wrong?