Note: Not doing worldspace comparison for now. We would need to create new
BM_face_calc_area and BM_face_calc_perimeter equivalent functions for that.
Not sure if it is worth the trouble.
Note: Unlike 2.79 we are not comparing face->mat_nr, but the material itself.
On top og that, if the material slot is empty we are just ignoring this face.
I'm not sure why we may want to sample both a sharp and an unsharp edges at the
same time, maybe to see if the selected edges all have the same values?
Either way, implemented as in 2.79. I also believe we may have a faster way to
select all the edges, but let's file this under optimizations to be done later.
I'm not sure why the original implementation was only checking for equal
comparison but I'm doing the same here. It is a one line change if we
want to support LT/GT anyways.
Also "technically" we should compare the angles in the worldspace, since
different scales will result in different angles. Added as a TODO but
honestly I think this is overkill.
I'm using kdtree here but there is nothing preventing us from using a simple
float linked list with a sorting and finding "nearest" equivalents.
At least we are benefitting from bisecting as oppose to the original solution.
Also we need epsilon for the float comparisons.
Note: I had to add an epsilon on top of the threshould for SIMVERT_NORMAL.
Otherwise I was getting differences such as 0.000000something when comparing
supposed-to-be-identical normals.
The way I see it, the Threshold option is a user feature, where users can
control more or less what they want selected. While the epsilon is a
non-negotiable requirement for our float comparison here.
This includes support for:
* SIMVERT_NORMAL
* SIMVERT_FACE
* SIMVERT_EDGE
Not included and currently not supported/disabled:
* SIMVERT_VGROUP
* SIMEDGE_*
* SIMFACE_*
While we are working on this, we prevent users from using the non-ported modes.
Note: the bmo_similar.c file is still around, to be removed in the near future.
Everyone: Please fell free to jump in and help tackling the missing modes.
For details on the implementation discussion:
https://developer.blender.org/D3674