def is_planar(self, positions=None, tolerance=DEFAULT_PLANAR_TOLERANCE):
        positions = positions or self.positions
        if len(positions) <= 3:
            return True

        p0 = positions[0]
        edge1 = vmath.v3sub(positions[1], p0)
        edge2 = vmath.v3sub(positions[2], p0)
        normal = vmath.v3normalize(vmath.v3cross(edge1, edge2))

        for p in positions:
            distance = vmath.v3dot(vmath.v3sub(p, p0), normal)
            if (distance * distance) > tolerance:
                return False

        return True
Determine if mesh is planar; that all vertices lie in the same plane.
dataset/ETHPy150Open turbulenz/turbulenz_tools/turbulenz_tools/tools/mesh.py/Mesh.is_planar