15575b953dfaea29e64788ebc0ce00425401de49
The most time-consuming operation in merge by distance is to find duplicate faces (faces that are different but have the same vertices). Therefore, some strategies were planned to optimize this algorithm: - Store the corner indices in an array thus avoiding multiple calls of `weld_iter_loop_of_poly_next`; - Create a map of polygons linked to edges instead of linked to vertices - this decreases the number of connections and reduces the calculation of the intersection of polygon indices. There are other fields to optimize, like reusing the `wpolys` array instead of creating a new array of corner offsets. And join some arrays as members of the same struct to be used in the same buffer. But for now, it is already a nice optimization. And the new `poly_find_doubles` function can be reused in the future to create a generic utility. The result of the optimization varies greatly depending on the number of polygons, the size of each polygon and the number of duplicates. On average it was something around 2 times faster. Worst case tested (old vs new): 0.1ms vs 0.3ms Best case tested (old vs new): 10.0ms vs 3.2ms Differential Revision: https://developer.blender.org/D17071
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
