i have a test-case attached where the alg in bullet-2.79 does the following steps on that mesh:
- it decides that f0, f1 and f2 are coplanar and tries to merge them. it doesn't like f3 in that group because in reality f0,f1,f2 and f3 are NOT coplanar -- they are nearly coplanar.
Code: Select all
faceNormalA.dot(faceNormalB)>faceWeldThreshold
- this new merged face of v0, v1, v2, v4 replaces the existing faces f0, f1, f2
now we have a degenerated mesh.
later in m_polyhedron->initialize() it collects all edges and has an assertion checking that one edge has at most 2 faces using it:
Code: Select all
if (edptr)
{
btAssert(edptr->m_face0>=0);
btAssert(edptr->m_face1<0);
edptr->m_face1 = i;
} else
{
btInternalEdge ed;
ed.m_face0 = i;
edges.insert(vp,ed);
}
}
the edge (v0, v4) is used by 3 faces: f3, f4 and the merged face (f0, f1,f2)
i think the right behaviour would have been not to merge f0, f1 and f2 at all.