102_DrawMesh_TCP.py 891 B

123456789101112131415161718192021222324252627282930
  1. # This file is part of libigl, a simple c++ geometry processing library.
  2. #
  3. # Copyright (C) 2017 Sebastian Koch <s.koch@tu-berlin.de> and Daniele Panozzo <daniele.panozzo@gmail.com>
  4. #
  5. # This Source Code Form is subject to the terms of the Mozilla Public License
  6. # v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. # obtain one at http://mozilla.org/MPL/2.0/.
  8. import sys, os
  9. import time
  10. # Add the igl library to the modules search path
  11. sys.path.insert(0, os.getcwd() + "/../")
  12. import pyigl as igl
  13. import tcpviewer
  14. from shared import TUTORIAL_SHARED_PATH
  15. ## This is a test application for the TCPViewer
  16. # Make sure to launch the tcpviewer.py first
  17. # Read a mesh
  18. V = igl.eigen.MatrixXd()
  19. F = igl.eigen.MatrixXi()
  20. igl.readOFF(TUTORIAL_SHARED_PATH + "beetle.off", V, F)
  21. # Send it to the viewer
  22. viewer = tcpviewer.TCPViewer()
  23. viewer.data.set_mesh(V, F)
  24. viewer.launch()