freealise commited on
Commit
900284f
1 Parent(s): c3afac9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -226,18 +226,18 @@ def get_mesh(image, depth):
226
  triangles = create_triangles(image.shape[0], image.shape[1])
227
  print('triangles - ok')
228
  colors = image.reshape(-1, 3)
229
- mesh = trimesh.Trimesh(vertices=verts, faces=triangles, vertex_colors=colors)
 
230
  #material = trimesh.visual.texture.SimpleMaterial(image=image)
231
  #texture = trimesh.visual.TextureVisuals(uv=uv, image=image, material=material)
232
  #mesh.visual = texture
233
- light = trimesh.scene.lighting.SpotLight(color=[1.0, 1.0, 1.0, 1.0], intensity=1.0, radius=None, innerConeAngle=0.0, outerConeAngle=0.7853981633974483)
234
- scene = trimesh.Scene([mesh, light])
235
  print('mesh - ok')
236
 
237
  # Save as glb
238
  glb_file = tempfile.NamedTemporaryFile(suffix='.glb', delete=False)
239
  glb_path = glb_file.name
240
- scene.export(glb_path)
241
  print('file - ok')
242
  return glb_path
243
 
 
226
  triangles = create_triangles(image.shape[0], image.shape[1])
227
  print('triangles - ok')
228
  colors = image.reshape(-1, 3)
229
+ #mesh = trimesh.Trimesh(vertices=verts, faces=triangles, vertex_colors=colors)
230
+ mesh = trimesh.PointCloud(verts, colors=colors)
231
  #material = trimesh.visual.texture.SimpleMaterial(image=image)
232
  #texture = trimesh.visual.TextureVisuals(uv=uv, image=image, material=material)
233
  #mesh.visual = texture
234
+ scene = trimesh.Scene([mesh])
 
235
  print('mesh - ok')
236
 
237
  # Save as glb
238
  glb_file = tempfile.NamedTemporaryFile(suffix='.glb', delete=False)
239
  glb_path = glb_file.name
240
+ scene.export(glb_path, line_settings={'point_size':2})
241
  print('file - ok')
242
  return glb_path
243