Face normal projection for texture painting

I am working on the implementation of a face normal projection mode for texture painting.
As a first approach, I created a function that recalculates the screen coordinates of the vertices with a fake view based on the normal of the face that is being processed in project_paint_face_init(). I am updating these screen coordinates just before project_bucket_clip_face() is called. I think the projection is working fine, but it is giving me these artifacts:

Is there a better place where I can update the screen coordinates? Is there an efficient way to update it per input sample?
Thank you for your help.

I’m not too familiar with this code, but I know it relies heavily on caching projected data from a particular viewpoint. So whenever the viewpoint changes during painting a lot of cached bucket needs to be freed.

Further I believe it stores some data like mask and original color per projected pixel rather than pixel in the painted image, and that would somehow need to be preserved.

So I expect some deeper changes to the data structures will be needed, it’s not just a matter of updating coordinates at the right moment.