-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New code for isosurface trace #3340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -70,6 +70,7 @@ | |||
"es6-promise": "^3.0.2", | |||
"fast-isnumeric": "^1.1.2", | |||
"font-atlas-sdf": "^1.3.3", | |||
"isosurface": "git://github.com/archmoj/isosurface.git#e2c41594417a2ba363bb430c7d38adfe18312fc5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
var gl = scene.glplot.gl; | ||
|
||
var mesh = createMesh({gl: gl}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reusing gl-mesh3d
is a very nice idea. One drawback I noticed though: hover labels don't appear on the input data coordinates, they appear on the (interpolated) mesh x/y/z - which I think is ok for now, albeit not consistent with our other trace types. For example, surface hover always picks out data-coordinates (even when the surface coordinates are refined). In contrast, streamtubes hover picks the coordinates on the tubes themselves.
@archmoj nice work! Your code and algo look very good, reusing Now, I'm trying to verify concerns from #2752 (comment) - pasting var width = 64
var height = 64
var depth = 64
var isomin = 1600
var isomax = 2000
var xs = []
var ys = []
var zs = []
var data = new Uint16Array(width*height*depth)
var k = 0
for (var z=0; z<depth; z++)
for (var y=0; y<height; y++)
for (var x=0; x<width; x++) {
xs.push(x/width)
ys.push(y/height)
zs.push(z/depth)
data[k] = x < width/2 ? isomax+1 : isomin-1
k++
}
Plotly.newPlot(gd, [{
type: 'isosurface',
x: xs,
y: ys,
z: zs,
volume: data,
isomin: isomin,
isomax: isomax,
cmin: isomin - 100,
cmax: isomax + 100,
smoothnormals: true,
isocaps: true,
singlemesh: true,
colorscale: 'Portland',
capscolorscale: 'Jet'
}], {
scene: {
xaxis: {range: [0, 1]},
yaxis: {range: [0, 1]},
zaxis: {range: [0, 1]}
}
}) appears to result in an infinite loop. Am I doing anything wrong? |
…pty x y z value and isovalue arrays
@etpinard This is a demo related to the comment that you mentioned: #2752 (comment) |
@etpinard demo link related to #2752 (comment) |
Can we close this PR, now that #3438 is up? |
Supersedes #3311 i.e. without using
gl-isosurface3d
refactored code!Totally rewritten and based on plotly.js most recent source code for
mesh3d
trace.Also in this regard, the isosurface module which used to support various algorithms namely
marching-cube
,marching-tetrahedra
&surface-nets
for displaying mathematical functions is forked and improved to accept data cubes.Using
isovalue
attribute the user may create one, two or multiple 3D contour surfaces.It is possible to enable
isocap
surfaces too.Various iso-surface traces could be modelled using this manual demo or this auto-update demo.
@plotly/plotly_js