jupyter-widgets-contrib / ipygany Goto Github PK
View Code? Open in Web Editor NEW3-D Scientific Visualization in the Jupyter Notebook
License: BSD 3-Clause "New" or "Revised" License
3-D Scientific Visualization in the Jupyter Notebook
License: BSD 3-Clause "New" or "Revised" License
Hello.
Thank you for such a nice module!
Is there a way to show mesh edges? I see it is possible to do it in pyvista and I was wondering if it is possible to do it with ipygany.
Thank you
Similarly to point data, could you also support cell data?
It would be great if when loading a mesh from memory, I could manually pass cell data, i.e. data associated with the tetrahedra for a tetrahedral mesh. For instance if I wanted to colour my mesh with the element id number, this is something that I cannot do with point data. Similarly, when importing a vtk file that includes both point and cell data, being able to import both and visualise cell data would be amazing.
Thanks a lot for your time!
Best,
Ado
We should scale up or down geometries on a per-scene basis
// Scale up or down the geometry
this.geometry.computeBoundingSphere();
const { radius } = this.geometry.boundingSphere;
this.scale = new THREE.Vector3(1 / radius, 1 / radius, 1 / radius)
I'd like to request an easy to use way to utilize the magnitude of multicomponent data in ipygany. Something like this where the velocity
data has multiple components and norm
is an optional argument.
colored_mesh = IsoColor(mesh, input='velocity', norm=True)
Right now, the only method I can come up with is to add the magnitude as a separate component or separate data. It would be useful in pyvista to avoid having to create another data array for ipygany. This arose in pyvista/pyvista#1387 (comment).
Would it be possible to add more colormaps in the dedicated widget, i.e. using custom colormaps defined earlier in the notebooks ?
In :
# Colormap choice widget colormap = Dropdown( options=colormaps, description='colormap:' )
For now colormaps is :
{'BrBG': 0, 'PRGn': 1, 'PiYG': 2, 'PuOr': 3, 'RdBu': 4, 'RdGy': 5, 'RdYlBu': 6, 'RdYlGn': 7, 'Spectral': 8, 'BuGn': 9, 'BuPu': 10, 'GnBu': 11, 'OrRd': 12, 'PuBuGn': 13, 'PuBu': 14, 'PuRd': 15, 'RdPu': 16, 'YlGnBu': 17, 'YlGn': 18, 'YlOrBr': 19, 'YlOrRd': 20, 'Blues': 21, 'Greens': 22, 'Greys': 23, 'Purples': 24, 'Reds': 25, 'Oranges': 26, 'Cividis': 27, 'CubehelixDefault': 28, 'Rainbow': 29, 'Warm': 30, 'Cool': 31, 'Sinebow': 32, 'Turbo': 33, 'Viridis': 34, 'Magma': 35, 'Inferno': 36, 'Plasma': 37}
In e.g. matplotlib, np.nan
is shown as transparent in an image plot. I guess it is currently not supported in ipygany. It would be nice to also not render it, maybe by removing every vertex that has a NaN in one of its coordinates?
Or optionally pass a boolean array for the mask, which would allow to support integer types?
We should expose the scene's background property to Python and allow changing the skybox.
Hi,
I am using ipygany together with pyvista in a jupyter notebook. I am mostly working with large point clouds of traffic scenes. When zooming in on certain parts of the point cloud, points are disappearing. It is a behavior I do not experience with for example the ipyvtklink backend of pyvista.
Unfortunately, I cannot give you a minimal working example at the moment, because the data I am using is not public, but here's a short video of what I am experiencing. (Note the backend was set globally to ipygany.)
https://user-images.githubusercontent.com/21262762/131076118-225bac83-5408-4462-bf11-1ade3a31f80a.mp4
I am guessing is that this is a clipping issue. Specifically, I suspect that line https://github.com/QuantStack/ipygany/blob/20b82f08c41f415919da11bf161c7dee2d97b2c7/src/widget.ts#L987 and https://github.com/QuantStack/ipygany/blob/20b82f08c41f415919da11bf161c7dee2d97b2c7/src/widget.ts#L1015 could cause this issue. Is there a way to change the clipping range? Using the camera object of pyvista does not seem to have an effect.
The reason I suspect that this is the issue, is that the order in which I add meshes to the plotter matters. For example,
...
plotter.add_mesh(pc, point_size=5, render_points_as_spheres=True, color='g')
arrow = pv.Arrow()
plotter.add_mesh(arrow)
...
works fine (except for the clipping when zooming in), whereas doing it the other way around
...
arrow = pv.Arrow()
plotter.add_mesh(arrow)
plotter.add_mesh(pc, point_size=5, render_points_as_spheres=True, color='g')
...
leads to a blank scene.
I really like the idea of ipygany, but this makes it unusable for me at this point, unfortunately. It would be great to see this fixed in the future. :)
The ipygany scene is resized and redrawn when enlarging the size of the parent container, but not when reducing the size.
Is it intended behavior? Other widgets such as ipygany's ColorBar
or ipyleaflet's Map
seem to be fully responsive.
To reproduce:
ipygany.ipynb
on Binder (Jupyterlab 3.0.5, Ipygany 0.5.0)HBox
-> no output (output cell is resized but nothing is shown)VBox
-> it worksTriangle indices are not ordered correctly in the IsoSurface computation, resulting in the triangle normals to be randomly chosen.
Normals are important for face culling:
(Using the ThreeJS default culling: THREE.FrontSide
only triangles facing the camera are displayed, this depends on the triangle normal)
(Using THREE.DoubleSide
all the triangle are displayed)
Concerning the iso-surface computation, we should use the THREE.DoubleSide
option anyway, because the surface has no "side". But concerning the threshold computation, it will be important to get normal rights (especially for transparent meshes, because transparency depends a lot on culling).
It should be possible to set triangleIndices to null for non-indexed geometries.
this gif shows a wonderful example of linking min/max values from a FloatRangeSlider
with the Threshold
class.
I am struggling to find the correct way to forward the tuple provided by FloatRangeSlider.value
to the correct jslink
call.
Could you provide the code snippet from the example? I think this specific example is not included in the documentation
I'm thinking about a subclass of ipygany.Component
, which would provide:
The value of the array
attribute would be the array that correspond to the current index value in the list of arrays (or the current slice of the nd-array).
This would be very useful to create responsive and/or smoothly animated ipygany scenes, especially in conditions of low bandwidth. This way we could send the whole data at once before playing the animation. And then have no or very little (index value) server/client communication while playing the animation.
There's a similar suggestion in vidartf/ipydatawidgets#8, but I'm not sure what would be the best place to implement this.
Hey guys,
Thank you guys for making such a wonderful library. I was using it to show the 3D geometries with results on a static github site. Unfortunately I have encountered a problem during compilation of readthedocs and I cannot overpass it. Could you please help me with that? The full error warning can be found there:
https://readthedocs.org/projects/cofea/builds/13298501/
Thank you for your help!
Provide a texture component, with default or user-defined texture mapping
When I run the dambreak example notebook on data I generated myself with proteus, I get some kind of shading artifact. As shown in the image below. Any ideas?
Could you point me to the data set you used for the demo?
Also, the 'tex.jpeg" file didn't seem to be in https://github.com/martinRenou/proteus_visualization, so I used the texture.jpeg instead, which is bricks, but I don't thank that has anything to do with the triangle issue.
ipygany.Component.array
accepts ipydatawidgets' NDArrayWidget
instances, which is nice if we want to send to the front-end some numpy arrays that may be then reused across multiple widgets (ipygany or other).
However, changing the value of the NDArrayWidget.array
attribute has currently no effect on the rendered ipygany scene. It would be nice if this could be supported. This would be useful especially when NDArrayWidget.array
is often updated (e.g., animated visualization of temporal data).
Looking at pythreejs
, it seems like it should be possible to add a point cloud. Any hints for getting this added? I'm fine with submitting a PR.
Hi,
When installing ipygany with conda
, dependencies were not installed automatically. For me, at least VTK was not installed. I had to install VTK manually later. I checked the dependencies with conda search -c conda-forge ipygany=0.3.3 --info
, it only showed: ipywidgets >=7.5.0
, numpy
, python >=3.5
, and traittypes
.
In Linux, browsers using Wayland backend did not properly show figures. (But when using X11 backend, both Chrome and FireFox worked fine.) Here are snapshots of what were shown in FireFox when using Wayland (from the notebook in the example folder):
Here's what I try to run in jupyterlab:
from ipygany import Scene, PolyMesh
mesh = PolyMesh.from_vtk('domain.vtk')
mesh.default_color = 'gray'
scene = Scene([mesh])
scene
I get the following message:
Error displaying widget: model not found
I'm running a notebook with a conda kernel. Here's conda list
for the appropriate conda environment:
# packages in environment at /home/jason/mambaforge/envs/sfepy:
#
# Name Version Build Channel
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 1_gnu conda-forge
alsa-lib 1.2.3 h516909a_0 conda-forge
argon2-cffi 20.1.0 py39h3811e60_2 conda-forge
async_generator 1.10 py_0 conda-forge
attrs 21.2.0 pyhd8ed1ab_0 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
backports 1.0 py_2 conda-forge
backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge
bleach 4.1.0 pyhd8ed1ab_0 conda-forge
blosc 1.21.0 h9c3ff4c_0 conda-forge
bzip2 1.0.8 h7f98852_4 conda-forge
c-ares 1.17.2 h7f98852_0 conda-forge
ca-certificates 2021.5.30 ha878542_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
certifi 2021.5.30 py39hf3d152e_0 conda-forge
cffi 1.14.6 py39he32792d_0 conda-forge
cftime 1.5.0 py39hce5d2b2_0 conda-forge
curl 7.78.0 hea6ffbf_0 conda-forge
cycler 0.10.0 py_2 conda-forge
dbus 1.13.6 h48d8840_2 conda-forge
debugpy 1.4.1 py39he80948d_0 conda-forge
decorator 5.1.0 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
double-conversion 3.1.5 h9c3ff4c_2 conda-forge
eigen 3.4.0 h4bd325d_0 conda-forge
entrypoints 0.3 pyhd8ed1ab_1003 conda-forge
expat 2.4.1 h9c3ff4c_0 conda-forge
ffmpeg 4.3.2 hca11adc_0 conda-forge
fontconfig 2.13.1 hba837de_1005 conda-forge
freetype 2.10.4 h0708190_1 conda-forge
gettext 0.19.8.1 h0b5b191_1005 conda-forge
gl2ps 1.4.2 h0708190_0 conda-forge
glew 2.1.0 h9c3ff4c_2 conda-forge
glib 2.68.4 h9c3ff4c_0 conda-forge
glib-tools 2.68.4 h9c3ff4c_0 conda-forge
gmp 6.2.1 h58526e2_0 conda-forge
gmpy2 2.1.0b5 py39h78fa15d_0 conda-forge
gnutls 3.6.13 h85f3911_1 conda-forge
gst-plugins-base 1.18.5 hf529b03_0 conda-forge
gstreamer 1.18.5 h76c114f_0 conda-forge
h5py 3.3.0 nompi_py39h98ba4bc_100 conda-forge
hdf4 4.2.15 h10796ff_3 conda-forge
hdf5 1.10.6 nompi_h6a2412b_1114 conda-forge
icu 68.1 h58526e2_0 conda-forge
importlib-metadata 4.8.1 py39hf3d152e_0 conda-forge
importlib_metadata 4.8.1 hd8ed1ab_0 conda-forge
ipygany 0.5.0 pyhd8ed1ab_0 conda-forge
ipykernel 6.4.1 py39hef51801_0 conda-forge
ipython 7.27.0 py39hef51801_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.6.4 pyhd8ed1ab_0 conda-forge
jbig 2.1 h7f98852_2003 conda-forge
jedi 0.18.0 py39hf3d152e_2 conda-forge
jinja2 3.0.1 pyhd8ed1ab_0 conda-forge
jpeg 9d h36c2ea0_0 conda-forge
jsoncpp 1.9.4 h4bd325d_3 conda-forge
jsonschema 3.2.0 pyhd8ed1ab_3 conda-forge
jupyter_client 7.0.2 pyhd8ed1ab_0 conda-forge
jupyter_core 4.7.1 py39hf3d152e_0 conda-forge
jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge
jupyterlab_widgets 1.0.1 pyhd8ed1ab_0 conda-forge
kiwisolver 1.3.2 py39h1a9c180_0 conda-forge
krb5 1.19.2 hcc1bbae_0 conda-forge
lame 3.100 h7f98852_1001 conda-forge
lcms2 2.12 hddcbb42_0 conda-forge
ld_impl_linux-64 2.36.1 hea4e1c9_2 conda-forge
lerc 2.2.1 h9c3ff4c_0 conda-forge
libblas 3.9.0 11_linux64_openblas conda-forge
libcblas 3.9.0 11_linux64_openblas conda-forge
libclang 11.1.0 default_ha53f305_1 conda-forge
libcurl 7.78.0 h2574ce0_0 conda-forge
libdeflate 1.7 h7f98852_5 conda-forge
libedit 3.1.20191231 he28a2e2_2 conda-forge
libev 4.33 h516909a_1 conda-forge
libevent 2.1.10 hcdb4288_3 conda-forge
libffi 3.3 h58526e2_2 conda-forge
libgcc-ng 11.1.0 hc902ee8_8 conda-forge
libgfortran-ng 11.1.0 h69a702a_8 conda-forge
libgfortran5 11.1.0 h6c583b3_8 conda-forge
libglib 2.68.4 h3e27bee_0 conda-forge
libglu 9.0.0 he1b5a44_1001 conda-forge
libgomp 11.1.0 hc902ee8_8 conda-forge
libiconv 1.16 h516909a_0 conda-forge
liblapack 3.9.0 11_linux64_openblas conda-forge
libllvm11 11.1.0 hf817b99_2 conda-forge
libnetcdf 4.8.1 nompi_hcd642e3_100 conda-forge
libnghttp2 1.43.0 h812cca2_0 conda-forge
libogg 1.3.4 h7f98852_1 conda-forge
libopenblas 0.3.17 pthreads_h8fe5266_1 conda-forge
libopus 1.3.1 h7f98852_1 conda-forge
libpng 1.6.37 h21135ba_2 conda-forge
libpq 13.3 hd57d9b9_0 conda-forge
libsodium 1.0.18 h36c2ea0_1 conda-forge
libssh2 1.10.0 ha56f1ee_0 conda-forge
libstdcxx-ng 11.1.0 h56837e0_8 conda-forge
libtheora 1.1.1 h7f98852_1005 conda-forge
libtiff 4.3.0 hf544144_1 conda-forge
libuuid 2.32.1 h7f98852_1000 conda-forge
libvorbis 1.3.7 h9c3ff4c_0 conda-forge
libwebp-base 1.2.1 h7f98852_0 conda-forge
libxcb 1.13 h7f98852_1003 conda-forge
libxkbcommon 1.0.3 he3ba5ed_0 conda-forge
libxml2 2.9.12 h72842e0_0 conda-forge
libzip 1.8.0 h4de3113_0 conda-forge
loguru 0.5.3 py39hf3d152e_2 conda-forge
lz4-c 1.9.3 h9c3ff4c_1 conda-forge
lzo 2.10 h516909a_1000 conda-forge
markupsafe 2.0.1 py39h3811e60_0 conda-forge
matplotlib-base 3.4.3 py39h2fa2bec_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
meshio 5.0.0 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py39h3811e60_1004 conda-forge
mock 4.0.3 py39hf3d152e_1 conda-forge
mpc 1.2.1 h9f54685_0 conda-forge
mpfr 4.1.0 h9202a9a_1 conda-forge
mpmath 1.2.1 pyhd8ed1ab_0 conda-forge
mysql-common 8.0.25 ha770c72_2 conda-forge
mysql-libs 8.0.25 hfa10184_2 conda-forge
nbclient 0.5.4 pyhd8ed1ab_0 conda-forge
nbconvert 6.1.0 py39hf3d152e_0 conda-forge
nbformat 5.1.3 pyhd8ed1ab_0 conda-forge
ncurses 6.2 h58526e2_4 conda-forge
nest-asyncio 1.5.1 pyhd8ed1ab_0 conda-forge
netcdf4 1.5.7 nompi_py39hd2e3950_101 conda-forge
nettle 3.6 he412f7d_0 conda-forge
notebook 6.4.3 pyha770c72_0 conda-forge
nspr 4.30 h9c3ff4c_0 conda-forge
nss 3.69 hb5efdd6_0 conda-forge
numexpr 2.7.3 py39hde0f152_0 conda-forge
numpy 1.21.2 py39hdbf815f_0 conda-forge
olefile 0.46 pyh9f0ad1d_1 conda-forge
openh264 2.1.1 h780b84a_0 conda-forge
openjpeg 2.4.0 hb52868f_1 conda-forge
openssl 1.1.1l h7f98852_0 conda-forge
packaging 21.0 pyhd8ed1ab_0 conda-forge
pandoc 2.14.2 h7f98852_0 conda-forge
pandocfilters 1.4.2 py_1 conda-forge
parso 0.8.2 pyhd8ed1ab_0 conda-forge
pcre 8.45 h9c3ff4c_0 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 8.3.2 py39ha612740_0 conda-forge
pip 21.2.4 pyhd8ed1ab_0 conda-forge
proj 8.1.0 h277dcde_1 conda-forge
prometheus_client 0.11.0 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.20 pyha770c72_0 conda-forge
psutil 5.8.0 py39h3811e60_1 conda-forge
pthread-stubs 0.4 h36c2ea0_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pugixml 1.11.4 h9c3ff4c_0 conda-forge
pycparser 2.20 pyh9f0ad1d_2 conda-forge
pygments 2.10.0 pyhd8ed1ab_0 conda-forge
pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge
pyrsistent 0.17.3 py39h3811e60_2 conda-forge
pytables 3.6.1 py39hf6dc253_3 conda-forge
python 3.9.7 h49503c6_0_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python_abi 3.9 2_cp39 conda-forge
pyzmq 22.2.1 py39h37b5a0c_0 conda-forge
qt 5.12.9 hda022c4_4 conda-forge
readline 8.1 h46c0cb4_0 conda-forge
scipy 1.7.1 py39hee8e79c_0 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 58.0.4 py39hf3d152e_0 conda-forge
sfepy 2021.2 py39hce5d2b2_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
sqlite 3.36.0 h9cd32fc_1 conda-forge
sympy 1.8 py39hf3d152e_0 conda-forge
tbb 2020.2 h4bd325d_4 conda-forge
tbb-devel 2020.2 h4bd325d_4 conda-forge
terminado 0.12.1 py39hf3d152e_0 conda-forge
testpath 0.5.0 pyhd8ed1ab_0 conda-forge
tk 8.6.11 h27826a3_1 conda-forge
tornado 6.1 py39h3811e60_1 conda-forge
traitlets 5.1.0 pyhd8ed1ab_0 conda-forge
traittypes 0.2.1 pyh9f0ad1d_2 conda-forge
tzdata 2021a he74cb21_1 conda-forge
utfcpp 3.2.1 ha770c72_0 conda-forge
vtk 9.0.3 no_osmesa_py39hb68e339_103 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
wheel 0.37.0 pyhd8ed1ab_1 conda-forge
widgetsnbextension 3.5.1 py39hf3d152e_4 conda-forge
x264 1!161.3030 h7f98852_1 conda-forge
xorg-kbproto 1.0.7 h7f98852_1002 conda-forge
xorg-libice 1.0.10 h7f98852_0 conda-forge
xorg-libsm 1.2.3 hd9c2040_1000 conda-forge
xorg-libx11 1.7.2 h7f98852_0 conda-forge
xorg-libxau 1.0.9 h7f98852_0 conda-forge
xorg-libxdmcp 1.1.3 h7f98852_0 conda-forge
xorg-libxext 1.3.4 h7f98852_1 conda-forge
xorg-libxt 1.2.1 h7f98852_2 conda-forge
xorg-xextproto 7.3.0 h7f98852_1002 conda-forge
xorg-xproto 7.0.31 h7f98852_1007 conda-forge
xz 5.2.5 h516909a_1 conda-forge
zeromq 4.3.4 h9c3ff4c_1 conda-forge
zipp 3.5.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h516909a_1010 conda-forge
zstd 1.5.0 ha95c52a_0 conda-forge
Here's my labextension listing:
JupyterLab v3.1.1
/home/jason/mambaforge/share/jupyter/labextensions
nbdime-jupyterlab v2.1.0 enabled OK
jupyter-threejs v2.3.0 enabled OK (python, pythreejs)
jupyterlab-datawidgets v7.0.0 enabled OK
jupyter-matplotlib v0.9.0 enabled OK
jupyter-webrtc v0.6.0 enabled OK
ipyvolume v0.6.0-alpha.8 enabled OK
bqplot v0.5.31 enabled OK (python, bqplot)
@jupyterlab/git v0.32.2 enabled OK (python, jupyterlab-git)
@ryantam626/jupyterlab_code_formatter v1.4.10 enabled OK (python, jupyterlab-code-formatter)
@jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)
Other labextensions (built into JupyterLab)
app dir: /home/jason/mambaforge/share/jupyter/lab
@axlair/jupyterlab_vim v0.13.4 enabled OK
ipygany v0.5.0 enabled OK
The following source extensions are overshadowed by older prebuilt extensions:
@jupyter-widgets/jupyterlab-manager
Any help is appreciated. Thanks!
I tried to install ipygany
in Fedora 34 using pip, but I just don't get anything shown.
I load a PolyMesh.from_vtk
and then create a Scene
.
I did see:
Scene(children=[PolyMesh(data=[], triangle_indices=array([5901, 2333, 2162, ..., 1452, 4105, 3028], dtype=uint…
but after installing ipywidgets, that is now gone, and I am back to seeing nothing.
I am seeing an error of Could not instantiate widget
in firefox's console, but I do not understand the output.
Is there anything else I need to install, besides ipywidgets
that is not pulled in automatically?
(adapted from the notebook example in this repo):
In [2]: mesh2 = TetraMesh.from_vtk('piston.vtu')
...
... iso2 = IsoColor(mesh2, input=('RESU____DEPL', 'DX'), min=-1.3931281e-06, max=1.3929895e-06)
...
... scene2 = Scene([iso2])
In [3]: scene2
I'd like to change the isocolor input, e.g., from another notebook cell
In [4]: iso2.input = ('RESU____DEPL', 'DY')
But it has no effect on the scene that is already rendered in cell 3 output. To see the new input color I need to re-execute that cell.
Is it the normal behavior? I see that Effect.input
is synchronized so I'd rather expect that changing it would update the scene(s) already shown in output cells.
Hi, is water effect example in another repository?
I cloned https://github.com/martinRenou/proteus_visualization/
which contains /blob/master/reef.ipynb in resository.
when I tried run reef.ipynb, error occured.
FileNotFoundError Traceback (most recent call last)
in
----> 1 arrays_metadata = extract_arrays_metadata('reef/solitary_reef.h5')
2
3 mem_vertices = extract_array(arrays_metadata, 'nodesSpatial_Domain0')
4 vertices = np.array(mem_vertices[:, 0:2])
We should be able to easily provide a skydome texture to the scene
When I create triangle indices with a dtype='uint16'
, I get no output and this message in the browser console:
WebGL warning: drawElementsInstanced: Indexed vertex fetch requires 71173184 vertices, but attribs only supply 1088.
I checked that the triangle indices have no value greater than 65535.
The issue also appears with dtype=uint8
, but it works fine with dtype=uint32
.
It would be nice to be able to add different geometric sources that can represent solid bodies in the domain. An example would be something like Paraview's cylinder source https://kitware.github.io/paraview-docs/latest/python/paraview.simple.Cylinder.html
Example:
scene1 = ipygany.Scene(...)
scene2 = ipygany.Scene(...)
ipywidgets.jslink((scene1, "camera_position"), (scene2, "camera_position"))
ipywidgets.jslink((scene1, "camera_target"), (scene2, "camera_target"))
ipywidgets.jslink((scene1, "camera_up"), (scene2, "camera_up"))
Interacting with scene1
has no effect on scene2
.
It also seems that camera controls are not sync in the JS -> Python direction (i.e., camera_position
value is still None
after interacting with the scene widget, but changing the value from Python updates the scene).
I noticed that CPU usage increases significantly (+ 20%) when the scene is shown on the screen (active tab), even when I'm not interacting with it at all (nor playing any animation). When multiple scenes (or scene views) are created in a notebook, fans are running high.
Tested on both Firefox and Chrome, on a MacBook Pro 13-inch, 2019 (MacOS Mojave). I'm using a 4k screen.
Out of curiosity, I've checked some examples from https://threejs.org/examples. Some of them seem to use a lot of CPU (especially animations), while others (static) don't use much CPU when not interacting with it.
Great work with this module!
Is there any way of toggling the visibility of a mesh? I'm trying to incorporate this with ipytree
, but there's no callback or trait that lets me toggle the global visibility of a mesh. Is this a low hanging PR?
... unless I re-build jupyterlab with --minimize=False
.
JupyterLab v2.2.8
Known labextensions:
app dir: /Users/bbovy/miniconda3/envs/jupyterlab/share/jupyter/lab
@jupyter-voila/jupyterlab-preview v1.1.0 enabled OK
@jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK
@jupyter-widgets/jupyterlab-sidecar v0.5.0 enabled OK
@jupyterlab/debugger v0.3.2 enabled OK
@jupyterlab/geojson-extension v2.0.1 enabled OK
@jupyterlab/git v0.21.1 enabled OK
@jupyterlab/toc v4.0.0 enabled OK
@pyviz/jupyterlab_pyviz v1.0.4 enabled OK
dask-labextension v3.0.0 enabled OK
ipycanvas v0.5.1 enabled OK
ipygany v0.4.0 enabled OK
jupyter-cytoscape v1.0.4 enabled OK
jupyter-leaflet v0.13.2 enabled OK
jupyterlab-datawidgets v6.3.0 enabled OK
jupyterlab-drawio v0.7.0 enabled OK
nbdime-jupyterlab v2.0.0 enabled OK
xref jupyterlab/jupyterlab#8688
Perhaps it won't be relevant anymore after #70 so feel free to close this @martinRenou.
There should be a corner case for transparent meshes. Transparent meshes should be displayed a first time with THREE.BackSide
, and a second time with THREE.FrontSide
.
There is a dataset_adapter
in vtk that should speed up the vtk file loading:
from vtk.numpy_interface import dataset_adapter as dsa
# Get vertices as a NumPy array without going through a for-loop
vertices = dsa.WrapDataObject(grid).Points
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.