8000 New code for isosurface trace by archmoj · Pull Request #3340 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

New code for isosurface trace #3340

10000
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

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
71ae66e
new isosurface traces
archmoj Dec 16, 2018
be3c5a5
using full data cube
archmoj Dec 16, 2018
dfe2a85
use data cube dimensions i.e. width and height
archmoj Dec 16, 2018
251b2d4
value > volume
archmoj Dec 16, 2018
cd86716
revised x y z
archmoj Dec 16, 2018
66bf59d
updated baseline
archmoj Dec 16, 2018
dee7c8e
handle non-uniform space pass 1 for integers
archmoj Dec 17, 2018
b2b7bc0
real world translation
archmoj Dec 17, 2018
0ac65d9
fixed interpolation
archmoj Dec 17, 2018
f5c6052
using isovalueand improved the mock
archmoj Dec 17, 2018
e5c7ff0
multiple isovalues could be applied with one trace
archmoj Dec 17, 2018
e60de84
http > https
archmoj Dec 17, 2018
0a9bf1d
fixed update for redraw
archmoj Dec 17, 2018
eecd804
fixed colorscale
archmoj Dec 17, 2018
b1f7939
corrected new isosurface baseline with colorscale
archmoj Dec 17, 2018
8779a6a
set intensity an internal value for iso-surface traces
archmoj Dec 17, 2018
2a4b9fb
correct baseline with colorscale
archmoj Dec 17, 2018
08e1508
added option to control which iso-surface meshing algorithm to use
archmoj Dec 18, 2018
4b49dc4
fixed scale tranform
archmoj Dec 18, 2018
07e11c0
isosurface baseline with correct x y z scales
archmoj Dec 18, 2018
06531f8
separate meshing record process
archmoj Dec 18, 2018
87ae392
improved isosurface mock to have both sides
archmoj Dec 18, 2018
af9294b
new two-sided isosurface baseline
archmoj Dec 18, 2018
f141098
fixed scales for negative ranges and prepration for isocaps
archmoj Dec 19, 2018
04cc4b4
more optimized code base for iso caps
archmoj Dec 19, 2018
a10b365
removed unused mock
archmoj Dec 19, 2018
16208cb
debug and fixed cap interpolation
archmoj Dec 19, 2018
b2f84be
removed debug opt
archmoj Dec 19, 2018
605ce44
updated isosurface mock with caps
archmoj Dec 19, 2018
56b4df1
volume > value and added checks to make trace invisible in case of em…
archmoj Dec 19, 2018
5311b01
reduced tolerance ratio
archmoj Dec 20, 2018
0171bf6
iso-surface baseline with reduced error for caps
archmoj Dec 21, 2018
1da04df
xyzw > xyzv
archmoj Dec 22, 2018
4ac90eb
may help handle parametric x y z coordinates
archmoj Dec 22, 2018
49aa746
reduced color attributes
archmoj Dec 31, 2018
d9c1fa7
intensity > value
archmoj Dec 31, 2018
79fdb19
more intensity to value
archmoj Dec 31, 2018
de20714
separate interpolatoin and extrapolation
archmoj Dec 31, 2018
341ba29
Merge remote-tracking branch 'origin/master' into isosurface-new
archmoj Jan 1, 2019
dac7f9d
apply new syntax rules for camelCase and one var per variable
archmoj Jan 1, 2019
94f0767
2018 > 2019 for isosurface
archmoj Jan 1, 2019
7c7bbe5
reduce vertex ids on each cap
archmoj Jan 2, 2019
9e5441d
reduced number of vertices of iso-surface and smoothing
archmoj Jan 2, 2019
940b41f
smooth isosurface baseline
archmoj Jan 2, 2019
dd08cd4
removed surfaceNets and marchingTetrahedra algorithms
archmoj Jan 2, 2019
530cdb4
revised to be more functional
archmoj Jan 2, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
using isovalueand improved the mock
  • Loading branch information
archmoj committed Dec 17, 2018
commit f5c60520fc0282d570e294f3bbb825fb4ad2b45c
9 changes: 9 additions & 0 deletions src/traces/isosurface/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ module.exports = extendFlat({
'Sets the 4th dimension of the vertices.'
].join(' ')
},
isovalue: {
valType: 'number',
editType: 'calc',
dflt: 0,
description: [
'For the moment it is a single number that defines the iso surface boundaries.',
'TODO: It would be nice to pass an array of numbers in the next step'
].join(' ')
},

text: {
valType: 'string',
Expand Down
2 changes: 1 addition & 1 deletion src/traces/isosurface/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function createIsosurfaceTrace(scene, data) {

var index = i + width * j + width * height * k;

fXYZs[n] = data.volume[index]; // use input data from the mock
fXYZs[n] = data.volume[index] - data.isovalue; // use input data from the mock

n++;
}
Expand Down
6 changes: 3 additions & 3 deletions src/traces/isosurface/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
coerce('x');
coerce('y');
coerce('z');
coerce('volume');

var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');
handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout);

// Coerce remaining properties
[
'volume',
'isovalue',
'text',
'lighting.ambient',
'lighting.diffuse',
'lighting.specular',
Expand Down Expand Up @@ -58,6 +60,4 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
else if('vertexcolor' in traceIn) coerce('vertexcolor');
else coerce('color', defaultColor);
}

coerce('text');
};
46 changes: 22 additions & 24 deletions test/image/mocks/gl3d_isosurface_math.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
"data": [
{
"data": [{
"type": "isosurface",
"color": "rgb(255,255,0)",
"lighting": {
"ambient": 0.25,
"diffuse": 0.75,
"specular": 0.5,
"roughness": 0.25,
"fresnel": 0.25
},
"lightposition": {
"x": 1000,
"y": 1000,
"z": 1000
},
"opacity": 0.75,
"color": "rgb(255,255,0)",
"colorscale": "Reds",
"cmax": 1250,
"cmin": 750,
"isovalue": 1000,
"x": [100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140],
"y": [0,0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.10,0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18,0.19,0.20,0.21,0.22,0.23,0.24,0.25,0.26,0.27,0.28,0.29,0.30,0.31,0.32,0.33,0.34,0.35,0.36,0.37,0.38,0.39,0.40],
"y": [0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0],
"z": [0,-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,-19,-20,-21,-22,-23,-24,-25,-26,-27,-28,-29,-30,-31,-32,-33,-34,-35,-36,-37,-38,-39,-40],
"volume": [
732,351,-22,-377,-706,-1001,-1256,-1464,-1621,-1722,-1766,-1751,-1678,-1549,-1366,-1134,-858,-545,-202,163,541,924,1302,1667,2010,2323,2599,2831,3013,3143,3216,3230,3187,3085,2929,2720,2466,2171,1842,1487,1114,
Expand Down Expand Up @@ -1741,26 +1740,25 @@
4609,4228,3855,3500,3171,2876,2621,2413,2257,2155,2111,2126,2199,2328,2511,2743,3019,3332,3675,4040,4418,4801,5179,5544,5887,6200,6476,6708,6891,7020,7093,7108,7064,6962,6806,6598,6343,6048,5719,5364,4991,
4444,4063,3690,3335,3006,2711,2456,2248,2091,1990,1946,1961,2034,2163,2346,2578,2854,3167,3510,3875,4253,4636,5014,5379,5722,6035,6311,6543,6725,6855,6928,6942,6898,6797,6640,6432,6178,5882,5553,5198,4826
],
"isomin": 750,
"isomax": 1250,
"cmin": 750,
"cmax": 1250,
"smoothnormals": true,
"isocaps": true,
"colorscale": "Reds"
}
],
"lightposition": {
"x": 500,
"y": 500,
"z": 500
},
"contour": {
"show": true,
"width": 4
}

}],
"layout": {
"title": "isosurface trace",
"width": 1200,
"height": 900,
"scene": {
"xaxis": {
},
"yaxis": {
},
"zaxis": {
},
"xaxis": {"nticks": 12},
"yaxis": {"nticks": 12},
"zaxis": {"nticks": 12},
"camera": {
"eye": {
"x": -2.0,
Expand Down
0