I would like to avoid doing this if we can solve the problem in the shrinkwrap code. This makes the remesher slower in high poly meshes and these random projection spikes mostly happen in low poly meshes when the voxel size is not enough to hold the detail.
This patch feels like hiding issues in other code. Not sure we should try to patch it this way, unless we know for certain that it is intended by the shrinkwrap code.
Wouldn't mind splitting this function into several functions so it is easier to step through when debugging. Would also clarify better the steps in the code.
Unsure: is BM_VERT and BM_EDGE needed?
Possible Division by zero?
Unclear where this loops comes from. Please clarify in doc.
Hi. Just want to provide an example of broken by shrinkwrap modifier mesh. I made some voxel remesh operations and then applied shrinkwrap to duplicated mesh. "Target Normal Project" always gives wrong results on this type of mesh. I think "Project Above Surface" gives better results compared to other methods. But not sure if "Project Above Surface" will broke other types of meshes or not.
@Pablo Dobarro (pablodp606) The best Shrinkwrap option I have seen is having it set to Project -> On Surface -> Cull Faces set to Off -> Direction Positive+Negative checked on. Been using it very often while projecting details back onto my new mesh while having MultiRes activated. Don't think I have seen these projection artefacts ever using this method.
This should frankly also be the default setting while working with the modifier in Sculpt Mode. Could be worth trying to see if this solves the problem of strange projection artefacts with Voxel Remesher.