K3D-tools / K3D-jupyter

K3D lets you create 3D plots backed by WebGL with high-level API (surfaces, isosurfaces, voxels, mesh, cloud points, vtk objects, volume renderer, colormaps, etc). The primary aim of K3D-jupyter is to be easy for use as stand alone package like matplotlib, but also to allow interoperation with existing libraries as VTK.
MIT License
916 stars 123 forks source link

marching_cubes with color from array #427

Closed sTamaroTum closed 6 months ago

sTamaroTum commented 11 months ago

Hi, is it possible to give a color to the iso surfaces that come out of k3d.marching_cubes(A) based on an array with the same dimensions as A? Right now I could only set a uniform color. Thanks.

artur-trzesiok commented 10 months ago

I like that idea :)

artur-trzesiok commented 10 months ago

image Will be available in next release :) - thanks for inspiration!

artur-trzesiok commented 10 months ago

example is on devel: https://github.com/K3D-tools/K3D-jupyter/blob/devel/examples/marchingcubes_with_attribute.ipynb

sTamaroTum commented 5 months ago

Hi! Thanks a lot for implementing this, it is a nice feature. When I tried it I was a bit confused, since the velocity colors seem to be on different coordinates than what I expected.

To double-check, I tried marching cubes on an array with a certain level x, and then I asked for a color attribute using the same array. I would expect the color to be uniform and equal to x, but, it is not. Could this be? Thanks!