lmoss commited on
Commit
beebf2b
·
1 Parent(s): 2eea8e7

added slice

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -47,9 +47,10 @@ x, y, z = grid.points.T
47
  values = img.flatten()
48
  grid.point_data['my_array'] = values
49
  slices = grid.slice_orthogonal()
50
-
51
- pl.add_mesh(slices, cmap="gray")
52
-
 
53
  pl.export_html('pyvista.html')
54
 
55
  st.header("test html import")
 
47
  values = img.flatten()
48
  grid.point_data['my_array'] = values
49
  slices = grid.slice_orthogonal()
50
+ mesh = grid.contour(1, values, method='marching_cubes', rng=[1, 0], preference="points")
51
+ dist = np.linalg.norm(mesh.points, axis=1)
52
+ #pl.add_mesh(slices, cmap="gray")
53
+ pl.add_mesh(mesh, scalars=dist)
54
  pl.export_html('pyvista.html')
55
 
56
  st.header("test html import")