Mesh: replace 'BKE_mesh_merge_verts' algorithm #105137
Closed
Germano Cavalcante
wants to merge 1 commits from
When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
mano-wii:deduplicate_merge
into main
pull from: mano-wii:deduplicate_merge
merge into: blender:main
blender:main
blender:brush-assets-project
blender:blender-v3.6-release
blender:blender-v3.3-release
blender:universal-scene-description
blender:partial-write-refactor
blender:blender-v4.1-release
blender:blender-v3.6-temp_wmoss_animrig_public
blender:temp-sculpt-dyntopo
blender:gpencil-next
blender:anim/animation-id-113594
blender:blender-v4.0-release
blender:blender-projects-basics
blender:bridge-curves
blender:sculpt-blender
blender:asset-browser-frontend-split
blender:asset-shelf
blender:tmp-usd-python-mtl
blender:tmp-usd-3.6
blender:blender-v3.5-release
blender:blender-v2.93-release
blender:realtime-clock
blender:sculpt-dev
blender:bevelv2
blender:xr-dev
When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 Commits
Author | SHA1 | Message | Date |
---|---|---|---|
Germano Cavalcante | f7d4ac5a4b |
Mesh: replace 'BKE_mesh_merge_verts' algorithm
Blender currently has 2 algorithms for merging vertices: - `BKE_mesh_merge_verts`; - `blender::geometry::create_merged_mesh` `BKE_mesh_merge_verts` has a simplified algorithm to work with Array, Mirror and Screw modifiers. It doesn't support merge results that would create new faces. However it has shortcuts to be more efficient in these modifiers. `blender::geometry::create_merged_mesh` tries to predict all possible outcomes. So it's a more complex. But it loses in performance to `BKE_mesh_merge_verts` in some cases. The performance comparison between these two depends on many factors. `blender::geometry::create_merged_mesh` works with a context that has only the affected geometry. Thus a smaller region of the mesh is read for duplicate checking. Therefore, the smaller the affected geometry, the more efficient the operation. By my tests `blender::geometry::create_merged_mesh` beats `BKE_mesh_merge_verts` when less than 20% of the geometry is affected in worst case `MESH_MERGE_VERTS_DUMP_IF_EQUAL` or 17% in case of `MESH_MERGE_VERTS_DUMP_IF_MAPPED` . For cases where the entire geometry is affected, a 30% loss was noticed, largely due to the creation of a context that represents the entire mesh. |