Deactivate area based rejection of triangles in triangulation
Use FindDegenerates post processing step for that.pull/2044/head
parent
bca41ceba5
commit
3c5c0a0df3
|
@ -485,21 +485,22 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh)
|
||||||
for(aiFace* f = last_face; f != curOut; ) {
|
for(aiFace* f = last_face; f != curOut; ) {
|
||||||
unsigned int* i = f->mIndices;
|
unsigned int* i = f->mIndices;
|
||||||
|
|
||||||
// drop dumb 0-area triangles
|
// drop dumb 0-area triangles - deactivated for now:
|
||||||
if (std::fabs(GetArea2D(temp_verts[i[0]],temp_verts[i[1]],temp_verts[i[2]])) < 1e-5f) {
|
//FindDegenerates post processing step can do the same thing
|
||||||
ASSIMP_LOG_DEBUG("Dropping triangle with area 0");
|
//if (std::fabs(GetArea2D(temp_verts[i[0]],temp_verts[i[1]],temp_verts[i[2]])) < 1e-5f) {
|
||||||
--curOut;
|
// ASSIMP_LOG_DEBUG("Dropping triangle with area 0");
|
||||||
|
// --curOut;
|
||||||
|
|
||||||
delete[] f->mIndices;
|
// delete[] f->mIndices;
|
||||||
f->mIndices = NULL;
|
// f->mIndices = nullptr;
|
||||||
|
|
||||||
for(aiFace* ff = f; ff != curOut; ++ff) {
|
// for(aiFace* ff = f; ff != curOut; ++ff) {
|
||||||
ff->mNumIndices = (ff+1)->mNumIndices;
|
// ff->mNumIndices = (ff+1)->mNumIndices;
|
||||||
ff->mIndices = (ff+1)->mIndices;
|
// ff->mIndices = (ff+1)->mIndices;
|
||||||
(ff+1)->mIndices = NULL;
|
// (ff+1)->mIndices = nullptr;
|
||||||
}
|
// }
|
||||||
continue;
|
// continue;
|
||||||
}
|
//}
|
||||||
|
|
||||||
i[0] = idx[i[0]];
|
i[0] = idx[i[0]];
|
||||||
i[1] = idx[i[1]];
|
i[1] = idx[i[1]];
|
||||||
|
|
Loading…
Reference in New Issue