102_DrawMesh.py 351 B

123456789101112131415
  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 a mesh in OFF format
  6. V = igl.eigen.MatrixXd()
  7. F = igl.eigen.MatrixXi()
  8. igl.readOFF("../../tutorial/shared/beetle.off", V, F)
  9. # Plot the mesh
  10. viewer = igl.viewer.Viewer();
  11. viewer.data.set_mesh(V, F);
  12. viewer.launch();