Currently the calculate_profile function is called in lot of different places throughout bevel. This resulted in redundant calls to the function. In most situations it was being called 2 - 5 times, even when only the last result is used.
There are a few downsides to the current situation:
- It's potentially slower (although I didn't find a difference in calculation time in a test).
- It's harder to debug changes to calculate_profile because you need to worry about which call was final.
So with this patch, all of the profiles are calculated at once, right before the vertex meshes are built, meaning each profile is only calculated once too.