Browse Source

MeshTools: properly reduce unique prefix in the last iteration.

The test passes now.
pull/449/head
Vladimír Vondruš 6 years ago
parent
commit
1cc2564c53
  1. 16
      src/Magnum/MeshTools/RemoveDuplicates.h

16
src/Magnum/MeshTools/RemoveDuplicates.h

@ -283,15 +283,15 @@ template<class IndexType, class Vector> std::size_t removeDuplicatesFuzzyIndexed
/* Remap the resulting index array */ /* Remap the resulting index array */
for(auto& i: indices) i = remapping[i]; for(auto& i: indices) i = remapping[i];
/* Finished */ /* Move vertex coordinates by epsilon/2 in the next direction. Do that
if(moving == Vector::Size) continue; only if we're not in the last iteration, as that would be an OOB
access otherwise. */
/* Move vertex coordinates by epsilon/2 in the next direction */ if(moving != Vector::Size) {
moved = Vector(); moved = Vector();
moved[moving] = epsilon/2; moved[moving] = epsilon/2;
}
/* Next time go only through the unique prefix; clear the table for the /* Reduce to an unique prefix; clear the table for the next pass */
next pass */
dataSize = table.size(); dataSize = table.size();
table.clear(); table.clear();
} }

Loading…
Cancel
Save