The programmed 'toolpath' if we can call it that is a line grinding wheel radius from the desired surface of the cam. This is a similar problem to cutter radius compensation, but the applied principal is similar.
This link gives some insight into cutter radius compensation.
This only works in the XY plane, so we need to calculate the compensation ourselves because the cam appears as a 4th axis being in degrees.
This requires a polar to rectangular conversion which can be done in line by a g-code interpreter.
You can solve trig and Pythagoras problems on the fly, where one of the main variables used will be the current wheel radius.
I haven't done any of this stuff before, so I call some experts who have already done it.
Not trivial, but some high school maths will solve the problem.
You need to treat grinding wheel like a very big cam follower.