def generate_normals_from_tangents(self, zero_tol=DEFAULT_ZERO_TOLERANCE,
                                       dont_norm_tol=DEFAULT_DONT_NORMALIZE_TOLERANCE):
        if not len(self.tangents) or not len(self.binormals): # We can't generate normals without nbts
            LOG.debug("Can't generate normals from nbts without tangets:%i and binormals:%i",
                      len(self.tangents), len(self.binormals))
            return
        num_vertices = len(self.normals)
        assert num_vertices == len(self.tangents)
        assert num_vertices == len(self.binormals)
        # Regenerate the vertex normals from the new tangents and binormals
        for i in range(num_vertices):
            normal = self.normals[i]
            cp = vmath.v3cross(self.tangents[i], self.binormals[i])
            # Keep vertex normal if the tangent and the binormal are paralel
            if vmath.v3lengthsq(cp) > dont_norm_tol:
                cp = vmath.v3normalize(cp)
                # Keep vertex normal if new normal is *somehow* in the primitive plane
                cosangle = vmath.v3dot(cp, normal)
                if not vmath.iszero(cosangle, zero_tol):
                    if cosangle < 0:
                        self.normals[i] = vmath.v3neg(cp)
                    else:
                        self.normals[i] = cp
Create a new normal from the tangent and binormals.
dataset/ETHPy150Open turbulenz/turbulenz_tools/turbulenz_tools/tools/mesh.py/Mesh.generate_normals_from_tangents