102_DrawMesh_TCP.py 545 B

123456789101112131415161718192021222324252627
  1. ## This is a test application for the TCPViewer
  2. # Add the igl library to the modules search path
  3. import sys, os
  4. sys.path.insert(0, os.getcwd() + "/../")
  5. import os
  6. import time
  7. # Launch the tcp viewer
  8. os.system("python ../tcpviewer.py&")
  9. # Wait for it to set up the socket
  10. time.sleep(1)
  11. import pyigl as igl
  12. import tcpviewer
  13. # Read a mesh
  14. V = igl.eigen.MatrixXd()
  15. F = igl.eigen.MatrixXi()
  16. igl.readOFF('../../tutorial/shared/beetle.off', V, F)
  17. # Send it to the viewer
  18. viewer = tcpviewer.TCPViewer()
  19. viewer.data.set_mesh(V, F)
  20. viewer.launch()