Beispiel #1
0

# Load a mesh in OFF format
igl.readOFF("../../tutorial/shared/camelhead.off", V, F)

# Fix two points on the boundary
bnd = igl.eigen.MatrixXi()
b = igl.eigen.MatrixXi(2, 1)

igl.boundary_loop(F, bnd)
b[0] = bnd[0]
b[1] = bnd[int(bnd.size() / 2)]
bc = igl.eigen.MatrixXd([[0, 0], [1, 0]])

# LSCM parametrization
igl.lscm(V, F, b, bc, V_uv)

# Scale the uv
V_uv *= 5

# Plot the mesh
viewer = igl.viewer.Viewer()
viewer.data.set_mesh(V, F)
viewer.data.set_uv(V_uv)
viewer.callback_key_down = key_down

# Disable wireframe
viewer.core.show_lines = False

# Draw checkerboard texture
viewer.core.show_texture = True
Beispiel #2
0

# Load a mesh in OFF format
igl.readOFF(TUTORIAL_SHARED_PATH + "camelhead.off", V, F)

# Fix two points on the boundary
bnd = igl.eigen.MatrixXi()
b = igl.eigen.MatrixXi(2, 1)

igl.boundary_loop(F, bnd)
b[0] = bnd[0]
b[1] = bnd[int(bnd.size() / 2)]
bc = igl.eigen.MatrixXd([[0, 0], [1, 0]])

# LSCM parametrization
igl.lscm(V, F, b, bc, V_uv)

# Scale the uv
V_uv *= 5

# Plot the mesh
viewer = igl.glfw.Viewer()
viewer.data().set_mesh(V, F)
viewer.data().set_uv(V_uv)
viewer.callback_key_down = key_down

# Disable wireframe
viewer.data().show_lines = False

# Draw checkerboard texture
viewer.data().show_texture = True