{"_id":"gl-isosurface3d","_rev":"60-8da53188c39aedf5700c21870861f05a","name":"gl-isosurface3d","dist-tags":{"latest":"0.5.0"},"versions":{"0.5.0":{"name":"gl-isosurface3d","version":"0.5.0","keywords":["webgl","isosurface"],"author":{"name":"Mikola Lysenko, Ilmari Heikkinen"},"license":"MIT","_id":"gl-isosurface3d@0.5.0","maintainers":[{"name":"ilmarihei","email":"ilmari@fhtr.net"}],"homepage":"https://github.com/gl-vis/gl-isosurface3d#readme","bugs":{"url":"https://github.com/gl-vis/gl-isosurface3d/issues"},"dist":{"shasum":"e4adf78c6ff76ae7f7141bc0cb19c2bb772490bc","tarball":"https://registry.npmjs.org/gl-isosurface3d/-/gl-isosurface3d-0.5.0.tgz","fileCount":42,"integrity":"sha512-/2m6GYcGKe9x9VueuUtUCz6Kf8Kd2t0LIe7ujCFLHZ8vluv5cGpabgXizrsIwpDVqELkf9hqbE2Ln+U8ZDJyAg==","signatures":[{"sig":"MEUCIDAHal7sybJd+6HolqpbtFRUGj8TghEcojPnFMRN35TwAiEA+1KouheJo6F/DwUGxZ3n8PP2NjKfv/4rLgh5VV2ob8I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32642563,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbTsfsCRA9TVsSAnZWagAAKtkP/Al4eulMki5a4lgRAWiW\n0ZBaI1noYE0PfWmKkFCOlOwDq9dL7jUy3zjECmE9CQB2GXBURqKkvKgpT0G8\nkCM51E6uw82Af/6h+PTiQLjX9yToO2Wj+A4N9/F8O+aKgq2HtqodLmlGfySt\nvqCvM8pS+d5fWASdGtH9vQjO1En3YBYabltVKO6f6ddjRMzAxMMU39N7gX7p\nUIissKmfp+TcGdH+WdpgLUAYAoJCb0CEfq+Kp2NPpRg+5Q/8kTn001FvwTfv\nQ3kCGSM1xWNJ0Gt1M7q/lTW4sH8RqoLI3gSvbzgmIjiB4djlBJ9y/PXdebIE\nDNpcBYkHGlz7E0ZWp94WeoAtbXwBeQkQUWxaCoYxJfpqdLvebLQcbaNO+hpJ\nj3t+q78cGvJ2iA7PbQjgP2X/DZh3KTFSW5omm7K+/MpjeqX8f30fD/bgNyzt\nlhChZtbivWmZo0oLB/B5KnlMCucB1fdjHAP2jGshCMVsELsLqtUTylMIV9CT\nq0aP3xnH4C4S6KtPU0sb4Pt4/EhKHH/EAhtiUx6vyRURgIKHLgKhQbbIoWrr\ndChMro3Tl/5qVfCt+4U8L5U1XI+MIDqrPp++Gv9XJItxAfWd0EDfI04MSR6R\nVlBuIPHhA8r2wr/dYbE+UtxEfrdEC6RF7Z2ucIQBt+0Ivp6ohOQWCb1gTDUJ\nURPW\r\n=caNd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"isosurface.js","gitHead":"b4a79af9986263bd2bf1a70cc6096e711d2365ee","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build-example":"browserify -o build/example_isosurface.js example/isosurface.js && browserify -o build/example_mri.js example/mri.js && browserify -o build/example_cone.js example/cone.js && browserify -o build/example_multi_iso.js example/multi_iso.js && browserify -o build/example_smooth_skin.js example/smooth_skin.js && browserify -o build/example_surface_points.js example/surface_points.js && browserify -o build/example_brainbrowser.js example/brainbrowser.js"},"_npmUser":{"name":"ilmarihei","email":"ilmari@fhtr.net"},"browserify":{"transform":["glslify"]},"repository":{"url":"git://github.com/gl-vis/gl-isosurface3d.git","type":"git"},"_npmVersion":"5.8.0","description":"3D isosurface generator","directories":{"example":"example"},"_nodeVersion":"8.11.3","dependencies":{"gl-vao":"^1.1.3","gl-mat4":"^1.0.0","glslify":"^6.1.0","ndarray":"^1.0.15","normals":"^1.0.1","colormap":"^2.1.0","gl-buffer":"^2.0.8","gl-shader":"4.2.1","barycentric":"^1.0.1","gl-texture2d":"^2.0.8","typedarray-pool":"^1.1.0","polytope-closest-point":"^1.0.0","simplicial-complex-contour":"^1.0.0","glsl-specular-cook-torrance":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"gl-mat4":"^1.0.0","gl-axes3d":"^1.2.5","gl-mesh3d":"^1.3.2","babel-core":"^6.26.0","canvas-fit":"^1.5.0","gl-spikes3d":"^1.0.5","bound-points":"^1.0.0","gl-scatter3d":"^1.0.10","3d-view-controls":"^2.2.0","gl-select-static":"^2.0.2","parse-wavefront-obj":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/gl-isosurface3d_0.5.0_1531889643887_0.20444925714569795","host":"s3://npm-registry-packages"}}},"time":{"created":"2018-07-18T04:54:03.886Z","modified":"2026-09-14T15:42:00.409Z","0.5.0":"2018-07-18T04:54:04.299Z"},"bugs":{"url":"https://github.com/gl-vis/gl-isosurface3d/issues"},"author":{"name":"Mikola Lysenko, Ilmari Heikkinen"},"license":"MIT","homepage":"https://github.com/gl-vis/gl-isosurface3d#readme","keywords":["webgl","isosurface"],"repository":{"url":"git://github.com/gl-vis/gl-isosurface3d.git","type":"git"},"description":"3D isosurface generator","maintainers":[{"email":"chris@plot.ly","name":"chriddyp"},{"email":"post.ben.here@gmail.com","name":"bpostlethwaite"},{"email":"antoine@plot.ly","name":"antrg"},{"email":"chuck@plot.ly","name":"bronsolo"},{"email":"t4rk@outlook.com","name":"t4rk"},{"email":"roman@plot.ly","name":"roman-nb"},{"email":"cameron.decoster@gmail.com","name":"camdecoster"},{"email":"alex@plot.ly","name":"alexcjohnson"},{"email":"adrian.borrmann@plot.ly","name":"aborrmann"},{"email":"emily@plot.ly","name":"emilykl-plotly"},{"email":"packages@plot.ly","name":"packages-team-plotly"},{"email":"ilmari@fhtr.net","name":"ilmarihei"},{"email":"code@etpinard.xyz","name":"etpinard"}],"readme":"gl-isosurface3d\n=====================\nVisualization module for isosurfaces.\n\n# Example\n\n```javascript\nvar createScene      = require('gl-plot3d')\nvar createIsosurface = require('gl-isosurface3d')\n\nvar scene = createScene()\n\nvar width = 64\nvar height = 64\nvar depth = 64\n\nvar data = new Uint16Array(width*height*depth)\nfor (var z=0; z<depth; z++)\nfor (var y=0; y<height; y++)\nfor (var x=0; x<width; x++) {\n\tvar value = 1500 + 500 * (\n\t\tMath.sin(3 * 2*Math.PI*(z/depth-0.5)) +\n\t\tMath.cos(4 * 2*Math.PI*(x/width-0.5)) +\n\t\tMath.sin(5 * 2*Math.PI*(h/height-0.5))\n\t);\n\tdata[z*height*width + y*width + x] = value\n}\n\nvar dims = [width, height, depth]\nvar bounds = [[0,0,0], [width, height, depth]]\n\nvar isoPlot = createIsosurface({\n\tvalues: data,\n\tdimensions: dims,\n\tisoBounds: [1600, 2000],\n\tvertexIntensityBounds: [1000, 2000],\n\tsmoothNormals:  true,\n\tisoCaps: true,\n\tsingleMesh: false,\n\tcolormap: 'portland',\n\tcapsColormap: 'jet'\n}, bounds)\n\nvar mesh = createIsosurface.createTriMesh(gl, isoPlot)\nvar capMesh = createIsosurface.createTriMesh(gl, isoPlot.caps)\n\nscene.add(mesh)\nscene.add(capMesh)\n```\n\n[Try out the example in your browser](http://gl-vis.github.io/gl-isosurface3d/)\n\n# Install\n\n```\nnpm i gl-isosurface3d\n```\n\n# Basic interface\n\n## Constructor\n\n#### `var isosurface = require('gl-isosurface3d')(params, bounds)`\nCreates an isosurface out of a 3D array.\n\n* `params` is an object that has the following properties:\n\n    + `values` *(Required)* An flattened 3D array of values\n    + `dimensions` *(Required)* The dimensions of the array\n    + `isoBounds` *(Recommended)* The range of values to envelop with the isosurface. Defaults to [1, Infinity], which creates an isosurface that has all values 1 and larger inside it.\n    + `vertexIntensityBounds` *(Optional)* The range of values to map to [0..1] intensities. Defaults to the minimum and maximum values of the values array.\n    + `smoothNormals` *(Optional)* Generate vertex normals for the isosurface. Defaults to false.\n    + `isoCaps` *(Optional)* Generate caps for the isosurface. Defaults to false.\n    + `singleMesh` *(Optional)* Merge isosurface and isocap meshes into a single mesh. Defaults to false, in which case the isocap mesh is stored in isoPlot.caps.\n\t+ `colormap` Name of the colormap to use for coloring the isosurface.\n\t+ `capsColormap` Name of the colormap to use for coloring the isocaps when using singleMesh = false. Defaults to the isosurface colormap.\n\n* `bounds` is a bounds object that tells what part of the 3D array to display. It defaults to [[0, 0, 0], [width, height, depth]].\n\n**Returns** An isosurface object that can be passed to isosurface3d.createTriMesh.\n\n#### `var drawable = require('gl-isosurface3d').createTriMesh(params)`\nCreates a drawable out of the isosurface triangle data. This is a version of gl-mesh3d optimized for fast loading of unindexed triangle meshes.\n\n* `params` is an object that has the following properties:\n\n    + `gl` A reference to the WebGL context\n\t+ `positions` *(Required)* Vertex positions array for the mesh, encoded as a flat Float32Array.\n\t+ `vertexNormals` *(Required)* Vertex normals for the mesh, encoded as a flat Float32Array.\n\t+ `vertexIntensity` Intensities of the vertices, used for intensity texture lookups.\n\t+ `colormap` Name of the colormap to use for coloring the vertices.\n    + `vertexIntensityBounds` intensity range for the colormap\n    + `ambientLight` ambient light color * intensity\n    + `diffuseLight` diffuse light color * intensity\n    + `specularLight` specular light color\n    + `lightPosition` location of light\n    + `roughness` surface roughness\n    + `fresnel` surface glossiness/\"rim light\" factor\n    + `opacity` surface opacity\n\n**Returns** A drawable object that can be drawn on the passed gl context with drawable.draw(cameraParams);\n\n# Credits\n(c) 2013-2017 Mikola Lysenko, Ilmari Heikkinen. MIT License\n","readmeFilename":"README.md"}