added conversion helpers for matlab
added examples for using the python wrappers in matlab
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
import igl
|
||||
import tcpviewer
|
||||
import time
|
||||
|
||||
# Load a mesh in OFF format
|
||||
V = igl.eigen.MatrixXd()
|
||||
F = igl.eigen.MatrixXi()
|
||||
time1 = time.time()
|
||||
# igl.read_triangle_mesh("../tutorial/shared/armadillo.obj", V, F)
|
||||
igl.readOFF("../tutorial/shared/beetle.off", V, F)
|
||||
time2 = time.time()
|
||||
|
||||
|
||||
print('Loading mesh (%d vertices) %0.3f ms' % (V.rows(),(time2-time1)*1000.0))
|
||||
|
||||
|
||||
# Plot the mesh
|
||||
viewer = tcpviewer.TCPViewer()
|
||||
viewer.data.set_mesh(V, F)
|
||||
viewer.core.align_camera_center(V,F)
|
||||
viewer.launch()
|
||||
time3 = time.time()
|
||||
|
||||
print('Sending to TCP viewer took %0.3f ms' % ((time3-time2)*1000.0))
|
||||
@@ -0,0 +1,27 @@
|
||||
## This is a test application for the TCPViewer
|
||||
|
||||
# Add the igl library to the modules search path
|
||||
import sys, os
|
||||
sys.path.insert(0, os.getcwd() + "/../")
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
# Launch the tcp viewer
|
||||
os.system("python ../tcpviewer.py&")
|
||||
|
||||
# Wait for it to set up the socket
|
||||
time.sleep(1)
|
||||
|
||||
import igl
|
||||
import tcpviewer
|
||||
|
||||
# Read a mesh
|
||||
V = igl.eigen.MatrixXd()
|
||||
F = igl.eigen.MatrixXi()
|
||||
igl.readOFF('../../tutorial/shared/beetle.off', V, F)
|
||||
|
||||
# Send it to the viewer
|
||||
viewer = tcpviewer.TCPViewer()
|
||||
viewer.data.set_mesh(V, F)
|
||||
viewer.launch()
|
||||
Reference in New Issue
Block a user