From 3c5c0a0df38161ed77903ffc092c8007c63ddabb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B6ber?= Date: Fri, 29 Jun 2018 09:55:49 +0200 Subject: [PATCH] Deactivate area based rejection of triangles in triangulation Use FindDegenerates post processing step for that. --- code/TriangulateProcess.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/code/TriangulateProcess.cpp b/code/TriangulateProcess.cpp index cc8b05c47..31239bb2d 100644 --- a/code/TriangulateProcess.cpp +++ b/code/TriangulateProcess.cpp @@ -485,21 +485,22 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh) for(aiFace* f = last_face; f != curOut; ) { unsigned int* i = f->mIndices; - // drop dumb 0-area triangles - if (std::fabs(GetArea2D(temp_verts[i[0]],temp_verts[i[1]],temp_verts[i[2]])) < 1e-5f) { - ASSIMP_LOG_DEBUG("Dropping triangle with area 0"); - --curOut; + // drop dumb 0-area triangles - deactivated for now: + //FindDegenerates post processing step can do the same thing + //if (std::fabs(GetArea2D(temp_verts[i[0]],temp_verts[i[1]],temp_verts[i[2]])) < 1e-5f) { + // ASSIMP_LOG_DEBUG("Dropping triangle with area 0"); + // --curOut; - delete[] f->mIndices; - f->mIndices = NULL; + // delete[] f->mIndices; + // f->mIndices = nullptr; - for(aiFace* ff = f; ff != curOut; ++ff) { - ff->mNumIndices = (ff+1)->mNumIndices; - ff->mIndices = (ff+1)->mIndices; - (ff+1)->mIndices = NULL; - } - continue; - } + // for(aiFace* ff = f; ff != curOut; ++ff) { + // ff->mNumIndices = (ff+1)->mNumIndices; + // ff->mIndices = (ff+1)->mIndices; + // (ff+1)->mIndices = nullptr; + // } + // continue; + //} i[0] = idx[i[0]]; i[1] = idx[i[1]];