102_DrawMesh_TCP.py 510 B

1234567891011121314151617181920212223
  1. import sys, os
  2. import time
  3. # Add the igl library to the modules search path
  4. sys.path.insert(0, os.getcwd() + "/../")
  5. import pyigl as igl
  6. import tcpviewer
  7. from shared import TUTORIAL_SHARED_PATH
  8. ## This is a test application for the TCPViewer
  9. # Make sure to launch the tcpviewer.py first
  10. # Read a mesh
  11. V = igl.eigen.MatrixXd()
  12. F = igl.eigen.MatrixXi()
  13. igl.readOFF(TUTORIAL_SHARED_PATH + "beetle.off", V, F)
  14. # Send it to the viewer
  15. viewer = tcpviewer.TCPViewer()
  16. viewer.data.set_mesh(V, F)
  17. viewer.launch()