def generate_tangents(self, pos_tol=DEFAULT_POSITION_TOLERANCE,
                          zero_tol=DEFAULT_ZERO_TOLERANCE,
                          tan_split_tol=DEFAULT_TANGENT_SPLIT_TOLERANCE):
        if 0 == len(self.uvs[0]): # We can't generate nbts without uvs
            LOG.debug("Can't generate nbts without uvs:%i", len(self.uvs[0]))
            return
        num_vertices = len(self.positions)
        self.tangents = [ (0, 0, 0) ] * num_vertices
        self.binormals = [ (0, 0, 0) ] * num_vertices

        # Split map for recording pairs of integers that represent which vertexes have been split.
        partition_vertices = True
        split_map = [ ]
        tan_split_tol_sq = (tan_split_tol * tan_split_tol)

        for prim_index, prim in enumerate(self.primitives):
            (tangent, binormal) = self._generate_tangents_for_triangle(prim, pos_tol, zero_tol)
            (i1, i2, i3) = prim
            if partition_vertices:
                self._split_vertex_with_new_tangents(i1, prim_index, split_map, tangent, binormal, tan_split_tol_sq)
                self._split_vertex_with_new_tangents(i2, prim_index, split_map, tangent, binormal, tan_split_tol_sq)
                self._split_vertex_with_new_tangents(i3, prim_index, split_map, tangent, binormal, tan_split_tol_sq)
            else:
                # Accumulate tangent and binormal
                self.tangents[i1] = vmath.v3add(self.tangents[i1], tangent)
                self.tangents[i2] = vmath.v3add(self.tangents[i2], tangent)
                self.tangents[i3] = vmath.v3add(self.tangents[i3], tangent)
                self.binormals[i1] = vmath.v3add(self.binormals[i1], binormal)
                self.binormals[i2] = vmath.v3add(self.binormals[i2], binormal)
                self.binormals[i3] = vmath.v3add(self.binormals[i3], binormal)
Generate a NBT per vertex.
dataset/ETHPy150Open turbulenz/turbulenz_tools/turbulenz_tools/tools/mesh.py/Mesh.generate_tangents