Determine orientation of workpiece