blender/tests/files/modeling/operators.blend
Campbell Barton f26d2a7b44 Fix #160055: un-subdivide creating duplicate faces
Resolve errors where unsubdivide would create duplicate faces.

- Fix the existing face check which passed in unordered
  vertices to BM_face_exists.

- Fix BM_face_exists_multi_edge to take an unordered set of edges
  so it worked as documented

- Fix creation of duplicate faces from splitting off face-ears,
  where duplicates faces may already exist - or where splitting
  off multiple ears could create duplicates between them.

- Fix errors where vertices besides the vertex being
  dissolved would be removed.

  - A "vertex-chain" between two faces would join the faces
    and remove all vertices and edges between them.
    Now the vertex and the two adjacent edges are merged into one,
    matching the behavior of wire edge-chains.
  - When a boundary vertex dissolved into an edge that already
    had a connected face, it was possible dissolve would dissolve
    this edge too - removing vertices besides the vertex being dissolved.

  In both cases it was possible the main dissolve loop would iterate
  over freed vertices. In practice this probably didn't cause issues
  in relate builds because the BLI_mempool memory wasn't used to create
  new vertices - and is still allocated by Blender.
  Nevertheless this asserted with ASAN and is bad practice to
  rely on the content of freed vertices during iteration.

  Now only the vertices being dissolved will be removed when
  un-subdividing.

Add public functions:

- BM_face_split_check_double_face
- BM_face_pair_overlap_check_subset_{same,swap}_winding
- BM_face_exists_subset_from_face

Also fix BM_face_exists_multi_edge which didn't work on an unordered
set of edges (as documented), it didn't cause problems but was needed
for duplicate face detection.

Update test data since a cube now un-subdivides into a tetrahedron
instead of collapsing into single triangle.

Ref !160375
2026-06-20 01:36:36 +00:00

3 lines
132 B
Text

version https://git-lfs.github.com/spec/v1
oid sha256:345857f0185fc38799d26e671e88ed06bf7754163c0ea58b4b8475c57908f9cc
size 4028858