LPDI-EPFL / masif

MaSIF- Molecular surface interaction fingerprints. Geometric deep learning to decipher patterns in molecular surfaces.
Apache License 2.0
571 stars 151 forks source link

Problem about the 'vertex_mean_curvature' and 'vertex_gaussian_curvature' #57

Closed ZeroDesigner closed 1 year ago

ZeroDesigner commented 1 year ago

Hi, I am recently to reproduce the code. And in the 'read_data_from_surface.py' I find the codes:

    # Compute the principal curvature components for the shape index. 
    mesh.add_attribute("vertex_mean_curvature")
    H = mesh.get_attribute("vertex_mean_curvature")
    mesh.add_attribute("vertex_gaussian_curvature")
    K = mesh.get_attribute("vertex_gaussian_curvature")
    elem = np.square(H) - K
    # In some cases this equation is less than zero, likely due to the method that computes the mean and gaussian curvature.
    # set to an epsilon.
    elem[elem<0] = 1e-8
    k1 = H + np.sqrt(elem)
    k2 = H - np.sqrt(elem)
    # Compute the shape index 
    si = (k1+k2)/(k1-k2)
    si = np.arctan(si)*(2/np.pi)

Actually, I don't know how to get the H and K. In these codes , I mean it just give an attribute to the mesh but there is no value for the attribute. Do I miss something else?

ZeroDesigner commented 1 year ago

I have read the PyMesh code.And find the solution.