I got notified that surface deform would behave strangely when the vertices were close to the target mesh edges.
After looking into this I realized that the issue was that the hard coded epsilon value was too large for the current floating point resolution.
However, changing it to a smaller value would lead to breakage in other scenarios as the epsilon value would then be too small.
To solve this I implemented a method to actually calculate the correct minimal epsilon value that can be used.
Using this, the uv bevel example mentioned in the code works:
And my Surface Deform example file works as expected when rebinding the modifier:
There is still more work to be done with this patch if this approach is deemed exceptable.
If not, I would at least want to have a alternate method that the surface deform modifier uses that has this feature.
Otherwise what is left to do is:
- Move the epsilon calculation out into a utility function.
- Make other functions use this that might need it. (The _v3 variant of weights_poly for example).