Fix (unreported) broken wavefront IO test in debug builds.
`face_verts` parameter of `fixup_invalid_face()` was shadowed by a local variable, leading to asserting on the wrong data.
This commit is contained in:
@@ -62,11 +62,11 @@ Vector<Vector<int>> fixup_invalid_face(Span<float3> vert_positions, Span<int> fa
|
||||
/* Emit new face information from CDT result. */
|
||||
Vector<Vector<int>> faces;
|
||||
faces.reserve(res.face.size());
|
||||
for (const auto &f : res.face) {
|
||||
Vector<int> face_verts;
|
||||
face_verts.reserve(f.size());
|
||||
for (int64_t i = 0; i < f.size(); ++i) {
|
||||
int idx = f[i];
|
||||
for (const auto &res_face : res.face) {
|
||||
Vector<int> res_face_verts;
|
||||
res_face_verts.reserve(res_face.size());
|
||||
for (int64_t i = 0; i < res_face.size(); ++i) {
|
||||
int idx = res_face[i];
|
||||
BLI_assert(idx >= 0 && idx < res.vert_orig.size());
|
||||
if (res.vert_orig[idx].is_empty()) {
|
||||
/* If we have a whole new vertex in the tessellated result, we won't quite know what to do
|
||||
@@ -77,10 +77,10 @@ Vector<Vector<int>> fixup_invalid_face(Span<float3> vert_positions, Span<int> fa
|
||||
/* Vertex corresponds to one or more of the input vertices, use it. */
|
||||
idx = res.vert_orig[idx][0];
|
||||
BLI_assert(idx >= 0 && idx < face_verts.size());
|
||||
face_verts.append(idx);
|
||||
res_face_verts.append(idx);
|
||||
}
|
||||
}
|
||||
faces.append(face_verts);
|
||||
faces.append(res_face_verts);
|
||||
}
|
||||
return faces;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user