202_GaussianCurvature.py 529 B

123456789101112131415161718192021222324
  1. # Add the igl library to the modules search path
  2. import sys, os
  3. sys.path.insert(0, os.getcwd() + "/../")
  4. import pyigl as igl
  5. # Load mesh
  6. V = igl.eigen.MatrixXd()
  7. F = igl.eigen.MatrixXi()
  8. igl.readOFF("../../tutorial/shared/bumpy.off",V,F);
  9. # Compute Gaussian curvature
  10. K = igl.eigen.MatrixXd();
  11. igl.gaussian_curvature(V,F,K);
  12. # Compute pseudocolor
  13. C = igl.eigen.MatrixXd();
  14. igl.jet(K,True,C);
  15. # Plot the mesh with pseudocolors
  16. viewer = igl.viewer.Viewer()
  17. viewer.data.set_mesh(V, F)
  18. viewer.data.set_colors(C)
  19. viewer.launch()