triangulation without long triangles
Question: In python, for a set of points, With

    
    
    import matplotlib.tri as tri
    triang = tri.Triangulation(x, y)
    

How I can make a mask for eliminate the triangles with long edges ?


Answer: finally I solved with this :

    
    
    import matplotlib.tri as tri
    
    def long_edges(x, y, triangles, radio=22):
        out = []
        for points in triangles:
            #print points
            a,b,c = points
            d0 = np.sqrt( (x[a] - x[b]) **2 + (y[a] - y[b])**2 )
            d1 = np.sqrt( (x[b] - x[c]) **2 + (y[b] - y[c])**2 )
            d2 = np.sqrt( (x[c] - x[a]) **2 + (y[c] - y[a])**2 )
            max_edge = max([d0, d1, d2])
            #print points, max_edge
            if max_edge > radio:
                out.append(True)
            else:
                out.append(False)
        return out
    
    triang = tri.Triangulation(x, y)
    mask = long_edges(x,y, triang.triangles)
    triang.set_mask(mask)
    plt.triplot(triang)
    

