Here’s my best solution to this issue. (Note that this action must be performed before removing duplicate vertices)