static void DegenEpilogue(TSpace psTspace[], TriInfo pTriInfos[], int piTriListIn[], final MikkTSpaceContext mikkTSpace, final int iNrTrianglesIn, final int iTotTris) {
        
        // deal with degenerate triangles
        // punishment for degenerate triangles is O(N^2)
        for (int t = iNrTrianglesIn; t < iTotTris; t++) {
            // degenerate triangles on a quad with one good triangle are skipped
            // here but processed in the next loop
            final boolean bSkip = (pTriInfos[t].flag & QUAD_ONE_DEGEN_TRI) != 0;

            if (!bSkip) {
                for (int i = 0; i < 3; i++) {
                    final int index1 = piTriListIn[t * 3 + i];
                    // search through the good triangles
                    boolean bNotFound = true;
                    int j = 0;
                    while (bNotFound && j < (3 * iNrTrianglesIn)) {
                        final int index2 = piTriListIn[j];
                        if (index1 == index2) {
                            bNotFound = false;
                        } else {
                            ++j;
                        }
                    }

                    if (!bNotFound) {
                        final int iTri = j / 3;
                        final int iVert = j % 3;
                        final int iSrcVert = pTriInfos[iTri].vertNum[iVert];
                        final int iSrcOffs = pTriInfos[iTri].tSpacesOffs;
                        final int iDstVert = pTriInfos[t].vertNum[i];
                        final int iDstOffs = pTriInfos[t].tSpacesOffs;

                        // copy tspace
                        psTspace[iDstOffs + iDstVert] = psTspace[iSrcOffs + iSrcVert];
                    }
                }
            }
        }

        // deal with degenerate quads with one good triangle
        for (int t = 0; t < iNrTrianglesIn; t++) {
            // this triangle belongs to a quad where the
            // other triangle is degenerate
            if ((pTriInfos[t].flag & QUAD_ONE_DEGEN_TRI) != 0) {
               
                byte[] pV = pTriInfos[t].vertNum;
                int iFlag = (1 << pV[0]) | (1 << pV[1]) | (1 << pV[2]);
                int iMissingIndex = 0;
                if ((iFlag & 2) == 0) {
                    iMissingIndex = 1;
                } else if ((iFlag & 4) == 0) {
                    iMissingIndex = 2;
                } else if ((iFlag & 8) == 0) {
                    iMissingIndex = 3;
                }

                int iOrgF = pTriInfos[t].orgFaceNumber;
                Vector3f vDstP = getPosition(mikkTSpace, makeIndex(iOrgF, iMissingIndex));
                boolean bNotFound = true;
                int i = 0;
                while (bNotFound && i < 3) {
                    final int iVert = pV[i];
                    final Vector3f vSrcP = getPosition(mikkTSpace, makeIndex(iOrgF, iVert));
                    if (vSrcP.equals(vDstP)) {
                        final int iOffs = pTriInfos[t].tSpacesOffs;
                        psTspace[iOffs + iMissingIndex] = psTspace[iOffs + iVert];
                        bNotFound = false;
                    } else {
                        ++i;
                    }
                }
                assert (!bNotFound);
            }
        }

    }
A private constructor to inhibit instantiation of this class.
jme3-core/src/main/java/com/jme3/util/mikktspace/MikktspaceTangentGenerator.java