silx-kit / h5web

React components for data visualization and exploration

Home Page:https://h5web.panosc.eu/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for mesh preview

LogWell opened this issue · comments

May I ask if it supports visualization of 3D data, such as OBJ and PLY.

import igl  # https://libigl.github.io/libigl-python-bindings/igl_docs/
import h5py

path_mesh = "bunny.obj"
v, f = igl.read_triangle_mesh(path_mesh)

path_h5 = path_mesh[:-4] + ".h5"
with h5py.File(path_h5, 'w') as h5f:
    g_mesh = h5f.create_group('mesh')
    g_geo = g_mesh.create_group('geometry')
    g_geo.create_dataset("v", data=v, dtype='float32', compression='gzip', compression_opts=4)
    g_geo.create_dataset("f", data=f, dtype='int32', compression='gzip', compression_opts=4)

I worked in the past on a surface vis (progress tracked as #1292) but it stayed in experimental stage.

Unfortunately, I no longer have the bandwidth to work on this 😞