master a32772903845 cached
581 files
6.4 MB
1.7M tokens
1134 symbols
1 requests
Download .txt
Showing preview only (6,845K chars total). Download the full file or copy to clipboard to get everything.
Repository: mikolalysenko/mikolalysenko.github.com
Branch: master
Commit: a32772903845
Files: 581
Total size: 6.4 MB

Directory structure:
gitextract_98ry2z6h/

├── Arrays/
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── data_structures/
│   │   ├── linked_list.js
│   │   ├── ordered_array.js
│   │   └── unordered_array.js
│   ├── particles.html
│   ├── require.js
│   └── test_cases/
│       ├── particles.js
│       ├── test_construct.js
│       └── test_particles.js
├── DataStructures/
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── index.html
│   ├── require.js
│   ├── structures/
│   │   ├── list.js
│   │   ├── pma.js
│   │   ├── unordered_vector.js
│   │   └── vector.js
│   └── tests/
│       ├── particles.js
│       └── test_particles.js
├── Downsample/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── experiment.txt
│   ├── index.html
│   ├── js/
│   │   ├── boxfilter.js
│   │   ├── closing.js
│   │   ├── marchingcubes.js
│   │   ├── marchingtetrahedra.js
│   │   ├── maxfilter.js
│   │   ├── medianfilter.js
│   │   ├── minfilter.js
│   │   ├── nearestfilter.js
│   │   ├── opening.js
│   │   ├── perlinnoise.js
│   │   ├── surfacenets.js
│   │   └── testdata.js
│   └── vendor/
│       ├── dsp.js
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── Isosurface/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── experiment.txt
│   ├── index.html
│   ├── js/
│   │   ├── benchmark.js
│   │   ├── marchingcubes.js
│   │   ├── marchingtetrahedra.js
│   │   ├── perlinnoise.js
│   │   ├── surfacenets.js
│   │   └── testdata.js
│   └── vendor/
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── LevelOfDetail/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── js/
│   │   ├── boxfilter.js
│   │   ├── closing.js
│   │   ├── marchingcubes.js
│   │   ├── marchingtetrahedra.js
│   │   ├── maxfilter.js
│   │   ├── medianfilter.js
│   │   ├── minfilter.js
│   │   ├── nearestfilter.js
│   │   ├── opening.js
│   │   ├── perlinnoise.js
│   │   ├── surfacenets.js
│   │   └── testdata.js
│   └── vendor/
│       ├── dsp.js
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── MeshLife/
│   ├── bundle.js
│   ├── index.html
│   └── main.css
├── MeshSimplify/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── experiment.txt
│   ├── index.html
│   ├── js/
│   │   ├── marchingcubes.js
│   │   ├── marchingtetrahedra.js
│   │   ├── montecarlo.js
│   │   ├── surfacenets.js
│   │   ├── testdata.js
│   │   └── triangle_index.js
│   └── vendor/
│       ├── dsp.js
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── MinecraftMeshes/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── index.html
│   ├── js/
│   │   ├── culled.js
│   │   ├── greedy.js
│   │   ├── stupid.js
│   │   └── testdata.js
│   └── vendor/
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── MinecraftMeshes2/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── experiments.txt
│   ├── index.html
│   ├── js/
│   │   ├── benchmark.js
│   │   ├── culled.js
│   │   ├── greedy.js
│   │   ├── greedy_tri.js
│   │   ├── monotone.js
│   │   ├── stupid.js
│   │   └── testdata.js
│   └── vendor/
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── Pictures/
│   └── test_smooth.py
├── Resources/
│   ├── brep.js
│   ├── glow_shell.js
│   ├── lib/
│   │   └── GLOW.js
│   ├── models/
│   │   ├── bunny.js
│   │   ├── bunny.obj
│   │   ├── convert_three.js
│   │   └── teapot.js
│   ├── surfacenets.js
│   └── tools/
│       └── convert_obj.js
├── ShapeCarving/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── experiments.txt
│   ├── index.html
│   ├── js/
│   │   ├── benchmark.js
│   │   ├── culled.js
│   │   ├── greedy.js
│   │   ├── greedy_tri.js
│   │   ├── monotone.js
│   │   ├── shapecarve.js
│   │   ├── stupid.js
│   │   └── testdata.js
│   ├── jscolor/
│   │   ├── demo.html
│   │   └── jscolor.js
│   └── vendor/
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── TJunctions/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── index.html
│   └── vendor/
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── Terrain/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── index.html
│   ├── index.html~
│   ├── js/
│   │   ├── dualcontour.js
│   │   ├── events.js
│   │   ├── perlinnoise.js
│   │   ├── testdata.js
│   │   └── webgl.js
│   └── require.js
└── resume.html

================================================
FILE CONTENTS
================================================

================================================
FILE: Arrays/Makefile
================================================
# makefile to automatize simple operations

server:
	python -m SimpleHTTPServer

deploy:
	# assume there is something to commit
	# use "git diff --exit-code HEAD" to know if there is something to commit
	# so two lines: one if no commit, one if something to commit 
	git commit -a -m "New deploy" && git push -f origin HEAD:gh-pages && git reset HEAD~



================================================
FILE: Arrays/css/main.css
================================================
body {
	overflow	: hidden;
	padding		: 0;
	margin		: 0;

	color		: #222;
	background-color: #BBB;
	font-family	: arial;
	font-size	: 100%;
}
#info a {
	color		: #66F;
	text-decoration	: none;
}
#info a:hover {
	text-decoration	: underline;
}
#info {
	position	: absolute;
	top		: 10px;
	left		: 10px;
	padding		: 5px;
	z-index: 10;
}

#particleCanvas {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
}



================================================
FILE: Arrays/data_structures/linked_list.js
================================================
function Cell(prev, next, value) {
  this.prev = prev;
  this.next = next;
  this.value = value;
}

function List(head, tail) {
  this.head = head;
  this.tail = tail;
}

exports.create = function() {
  return new List(null, null);
}

exports.append = function(list, value) {
  var ncell = new Cell(list.tail, null, value);
  if(!list.head) {
    list.head       = ncell;
    list.tail       = ncell;
  } else {
    list.tail.next  = ncell;
    list.tail       = ncell;
  }
}

exports.insert = function(list, iter, value) {
  if(iter === null) {
    exports.append(list, value);
    return;  
  }
  var ncell = new Cell(iter.prev, iter, value);
  iter.prev = ncell;
  if(iter.prev) {
    iter.prev.next = ncell;
  } else {
    list.head = ncell;
  }
}

exports.remove = function(list, iter) {
  if(iter.prev) {
    iter.prev.next = iter.next;
  } else {
    list.head = iter.next;
  } 
  if(iter.next) {
    iter.next.prev = iter.prev;
  } else {
    list.tail = iter.prev;
  }
}

exports.read = function(list, iter) {
  return iter.value;
}

exports.begin = function(list) {
  return list.head;
}

exports.next = function(list, iter) {
  return iter.next;
}

exports.prev = function(list, iter) {
  return iter.prev;
}

exports.end = function(list) {
  return null;
}



================================================
FILE: Arrays/data_structures/ordered_array.js
================================================
exports.create = function() {
  return [];
}

exports.insert = function(array, iter, value) {
  array.splice(iter, 0, value);
}

exports.remove = function(array, iter) {
  array.splice(iter, 1);
}

exports.append = function(array, value) {
  array.push(value);
}

exports.read = function(array, iter) {
  return array[iter];
}

exports.begin = function(array) {
  return array.length-1;
}

exports.prev = function(array, iter) {
  return iter + 1;
}

exports.next = function(array, iter) {
  return iter - 1;
}

exports.end = function(array) {
  return -1;
}


================================================
FILE: Arrays/data_structures/unordered_array.js
================================================
exports.create = function() {
  return [];
}

exports.insert = function(array, iter, value) {
  //Not supported  
  throw new Error("Unsupported operation");
}

exports.remove = function(array, iter) {
  array[iter] = array[array.length - 1];
  array.pop();
}

exports.append = function(array, value) {
  array.push(value);
}

exports.read = function(array, iter) {
  return array[iter];
}

exports.begin = function(array) {
  return array.length - 1;
}

exports.prev = function(array, iter) {
  //Not supported  
  throw new Error("Unsupported operation");
}

exports.next = function(array, iter) {
  return iter - 1;
}

exports.end = function(array) {
  return -1;
}



================================================
FILE: Arrays/particles.html
================================================
<html>
  <head>
    <title>Particle Test</title>
    <script src="require.js"></script>
    <link rel="stylesheet" type="text/css" href="css/main.css" />
  </head>
  <body>
    <div id="info">
      <p>
        <label> Data Structure: </label>
        <select id="dataStructure"></select>
      </p>
      <p>
        <label> Spawn Rate: </label>
        <input type="range" id="spawnRate" min="0" max="100" step="0.1" value="1.0" />
      </p>
      <p>
        <label> Particle Count: </label>
        <input type="text" id="particleCount" />
      </p>
      <p>
        <label> Average Frame Time (ms): </label>
        <input type="text" id="frameTime" />
      </p>
    
    </div>
  
    <canvas id="particleCanvas" ></canvas>
    
    <script>

// shim layer with setTimeout fallback
window.requestAnimFrame = (function(){
  return  window.requestAnimationFrame       || 
          window.webkitRequestAnimationFrame || 
          window.mozRequestAnimationFrame    || 
          window.oRequestAnimationFrame      || 
          window.msRequestAnimationFrame     || 
          function( callback ){
            window.setTimeout(callback, 1000 / 60);
          };
})();

(function() {
  "use strict";
  
  var particles = require('./test_cases/particles.js')
    , unordered_array = require('./data_structures/unordered_array.js')
    , ordered_array = require('./data_structures/ordered_array.js')
    , linked_list = require('./data_structures/linked_list.js');
  
  //Initialize data structures
  var data_structures = {
      'Ordered Array':    ordered_array
    , 'Linked List':      linked_list
    , 'Unordered Array':  unordered_array
  };

  //Initialize option list
  for(var id in data_structures) {
    document.getElementById("dataStructure").add(new Option(id, id));
  }

  var simulation
    , data_structure;
  function resetParticles() {
    data_structure = data_structures[document.getElementById("dataStructure").value];
    simulation = particles.create_particle_system({
          data_structure: data_structure
        , emitter_rate: 1.0 * document.getElementById("spawnRate").value
    });
  }
  
  document.getElementById("dataStructure").addEventListener("change", resetParticles, false);
  resetParticles();
  
  document.getElementById("spawnRate").addEventListener("change", function() {
    simulation.emitter_rate = 1.0 * document.getElementById("spawnRate").value;
  }, false);
  
  //Tick every 15 ms
  var avg_frame_time = 10;
  setInterval(function() {
    var start = new Date();
    simulation.tick();
    var end = new Date();
    avg_frame_time = 0.7 * avg_frame_time + 0.3 * (end - start);
  }, 15);
  

  //Retrieve context
  var canvas  = document.getElementById("particleCanvas")
    , context = canvas.getContext("2d");
  
  //Resize event handler
  function resize() {
    canvas.width  = window.innerWidth;
    canvas.height = window.innerHeight;
  }
  window.addEventListener("resize", resize, false);
  resize();
  
  //Render event handler
  function render() {
  
    context.clearRect(0, 0, canvas.width, canvas.height);
    
    var sx = canvas.width / 20.0
      , sy = canvas.height / 20.0;
    var count = 0;
    for(var iter = data_structure.begin(simulation.particles);
        iter !== data_structure.end(simulation.particles);
        iter = data_structure.next(simulation.particles, iter)) {
     
      var particle = data_structure.read(simulation.particles, iter)
        , intensity = Math.floor(255.0 * particle.color);
      context.fillStyle = 'rgb(' + intensity + ',' + intensity + ',' + intensity + ')';
      context.fillRect(sx*(particle.x+10.0)-3, sy*(particle.y+10.0)-3, 6, 6);
      ++count;
    }
  
    document.getElementById("frameTime").value = Math.round(1000*avg_frame_time)/1000.0;
    document.getElementById("particleCount").value = count;

    window.requestAnimFrame(render);
  }
  render();  
           
})();
    
    </script>
  </body>
</html>


================================================
FILE: Arrays/require.js
================================================
// ==Closure.compiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// ==/Closure.compiler==

// Require() 0.3.2 unstable
//
// Copyright 2012 Torben Schulz <http://pixelsvsbytes.com/>
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// 
///////////////////////////////////////////////////////////////////////

(function() {
'use strict';

if (window.require !== undefined)
	throw 'RequireException: \'require\' already defined in global scope';

window.require = function(module, callback) {
	var url = window.require.resolve(module);

	if (require.cache[url]) {
		// NOTE The callback should always be called asynchronously
		callback && setTimeout(callback, 0);
		return require.cache[url];
	}

	require.cache[url] = new Object();

	var request = new XMLHttpRequest();
	request.onreadystatechange = function() {
		if (request.readyState != 4)
			return;
		if (request.status != 200)
			throw 'RequireException: '+request.status+' '+request.statustext+' ('+url+')';

		if (request.getResponseHeader('content-type').indexOf('application/json') != -1) 
			window.require.cache[url] = JSON.parse(request.responseText);
		else 
			eval('(function(){'+(window.require.strict?'\'use strict\';':'')+'var exports=window.require.cache[\''+url+'\'];'+request.responseText+'\n})();\n//@ sourceURL='+url);

		callback && callback();
	}

	request.open('GET', url, !!callback);
	request.send();
	return require.cache[url];
}
window.require.resolve = function(module) {
	var r = module.match(/^(\.{0,2}\/)?([^\.]*)(\..*)?$/);
	return (r[1]?r[1]:'/js_modules/')+r[2]+(r[3]?r[3]:'/index.js');
}
// INFO initializing module cache
window.require.cache = new Object();
// INFO initializing strict mode toggle
window.require.strict = false;

})();


================================================
FILE: Arrays/test_cases/particles.js
================================================

function Particle() {
  this.x = 0.0;
  this.y = 0.0;  
  var t = Math.random() * Math.PI * 2.0
    , r = Math.random() * 0.1;
  this.vx = Math.cos(t) * r;
  this.vy = Math.sin(t) * r;
  this.color = Math.random();
}

exports.create_particle_system = function(options) {
  var Seq = options.data_structure
    , particles = Seq.create()
    , accumulator = 0.0;
  
  return {
      particles: particles
    , emitter_rate: options.emitter_rate
    , tick: function() {
      accumulator += Math.random() * this.emitter_rate * 2.0;
      while(accumulator > 1) {
        Seq.append(particles, new Particle());
        accumulator -= 1.0;
      }
      for(var iter = Seq.begin(particles); iter!== Seq.end(particles); iter = Seq.next(particles, iter)) {
        var particle = Seq.read(particles, iter);
        particle.x += particle.vx;
        particle.y += particle.vy;
        if(Math.abs(particle.x) > 10.0 || Math.abs(particle.y) > 10.0) {
          Seq.remove(particles, iter);
        }
      }
    }
  }
}



================================================
FILE: Arrays/test_cases/test_construct.js
================================================
var Seq = require(process.argv[2]);

//Create initial data structure
for(var i=5; i<23; ++i) {
  var n = (1<<i)
    , d = Seq.create();
  
  console.log("Running test, n=", n);
  
  //Fill in data structure
  var start = (new Date());
  for(var j=0; j<n; ++j) {
    Seq.append(d, Math.random());
  }
  var end = (new Date());
  console.log( "Create time: ", (end - start) / 1000.0 );
  
  //Walk over the array a couple of times
  start = new Date();
  for(var j=0; j<10; ++j) {
    var s = 0;
    for(var iter = Seq.begin(d); iter !== Seq.end(d); iter = Seq.next(d, iter)) {
      s += Seq.read(d, iter);
    }
  }
  end = new Date();
  console.log( "Iter. time: ", (end - start) / 10000.0 );
}



================================================
FILE: Arrays/test_cases/test_particles.js
================================================
var particles = require('./particles.js').create_particle_system({
    data_structure: require(process.argv[2]).create
  , emitter_rate:   2.0
}); 


//Warm up
console.log("Warming up...");
for(var i=0; i<10000; ++i) {
  particles.tick();
}
console.log("Running benchmark");

//Do simulation
var NUM_ITERS = 1000000;
var start = new Date();
for(var i=0; i<NUM_ITERS; ++i) {
  particles.tick();
}
var end = new Date();
console.log("Average time per tick = ", (end-start) / (NUM_ITERS * 1000.0), "s");



================================================
FILE: DataStructures/Makefile
================================================
# makefile to automatize simple operations

server:
	python -m SimpleHTTPServer

deploy:
	# assume there is something to commit
	# use "git diff --exit-code HEAD" to know if there is something to commit
	# so two lines: one if no commit, one if something to commit 
	git commit -a -m "New deploy" && git push -f origin HEAD:gh-pages && git reset HEAD~



================================================
FILE: DataStructures/css/main.css
================================================
body {
	overflow	: hidden;
	padding		: 0;
	margin		: 0;

	color		: #222;
	background-color: #BBB;
	font-family	: arial;
	font-size	: 100%;
}
#info a {
	color		: #66F;
	text-decoration	: none;
}
#info a:hover {
	text-decoration	: underline;
}
#info {
	position	: absolute;
	top		: 10px;
	left		: 10px;
	padding		: 5px;
	z-index: 10;
}

#particleCanvas {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
}



================================================
FILE: DataStructures/index.html
================================================
<html>
  <head>
    <title>Particle Test</title>
    <script src="require.js"></script>
    <link rel="stylesheet" type="text/css" href="css/main.css" />
  </head>
  <body>
    <div id="info">
      <p>
        <label> Data Structure: </label>
        <select id="dataStructure"></select>
      </p>
      <p>
        <label> Spawn Rate: </label>
        <input type="range" id="spawnRate" min="0" max="100" step="0.1" value="1.0" />
      </p>
      <p>
        <label> Particle Count: </label>
        <input type="text" id="particleCount" />
      </p>
      <p>
        <label> Average Frame Time (ms): </label>
        <input type="text" id="frameTime" />
      </p>
    
    </div>
  
    <canvas id="particleCanvas" ></canvas>
    
    <script>

// shim layer with setTimeout fallback
window.requestAnimFrame = (function(){
  return  window.requestAnimationFrame       || 
          window.webkitRequestAnimationFrame || 
          window.mozRequestAnimationFrame    || 
          window.oRequestAnimationFrame      || 
          window.msRequestAnimationFrame     || 
          function( callback ){
            window.setTimeout(callback, 1000 / 60);
          };
})();

(function() {
  "use strict";
  
  var particles = require('./tests/particles.js')
    , vector    = require('./structures/vector.js')
    , list      = require('./structures/list.js')
    , unordered_vector = require('./structures/unordered_vector.js');
  
  //Initialize data structures
  var data_structures = {
      'Vector':     vector.create
    , 'List':       list.create
    , 'Unordered Vector': unordered_vector.create
  };

  //Initialize option list
  for(var id in data_structures) {
    document.getElementById("dataStructure").add(new Option(id, id));
  }

  var simulation
    , data_structure;
  function resetParticles() {
    data_structure = data_structures[document.getElementById("dataStructure").value];
    simulation = particles.create_particle_system({
          data_structure: data_structure
        , emitter_rate: 1.0 * document.getElementById("spawnRate").value
    });
  }
  
  document.getElementById("dataStructure").addEventListener("change", resetParticles, false);
  resetParticles();
  
  document.getElementById("spawnRate").addEventListener("change", function() {
    simulation.emitter_rate = 1.0 * document.getElementById("spawnRate").value;
  }, false);
  
  //Tick every 15 ms
  var avg_frame_time = 10;
  setInterval(function() {
    var start = new Date();
    simulation.tick();
    var end = new Date();
    avg_frame_time = 0.7 * avg_frame_time + 0.3 * (end - start);
  }, 15);
  

  //Retrieve context
  var canvas  = document.getElementById("particleCanvas")
    , context = canvas.getContext("2d");
  
  //Resize event handler
  function resize() {
    canvas.width  = window.innerWidth;
    canvas.height = window.innerHeight;
  }
  window.addEventListener("resize", resize, false);
  resize();
  
  //Render event handler
  function render() {
    context.clearRect(0, 0, canvas.width, canvas.height);
    
    var sx = canvas.width / 20.0
      , sy = canvas.height / 20.0;
    var count = 0;
    
    simulation.foreachParticle(function(x, y, vx, vy, color) {
      ++count;
      var intensity = Math.floor(255.0 * color);
      context.fillStyle = 'rgb(' + intensity + ',' + intensity + ',' + intensity + ')';
      context.fillRect(sx*(x+10.0)-3, sy*(y+10.0)-3, 6, 6);
    });
  
    document.getElementById("frameTime").value = Math.round(1000*avg_frame_time)/1000.0;
    document.getElementById("particleCount").value = count;

    window.requestAnimFrame(render);
  }
  render();  
           
})();
    
    </script>
  </body>
</html>


================================================
FILE: DataStructures/require.js
================================================
// ==Closure.compiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
// ==/Closure.compiler==

// Require() 0.3.2 unstable
//
// Copyright 2012 Torben Schulz <http://pixelsvsbytes.com/>
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// 
///////////////////////////////////////////////////////////////////////

(function() {
'use strict';

if (window.require !== undefined)
	throw 'RequireException: \'require\' already defined in global scope';

window.require = function(module, callback, base_url) {

  base_url = base_url || "";
  
  //Munge tokens
  var toks = module.split("/");
  if(toks[0] == '.') {
    toks = base_url.split('/').concat(toks.slice(1));
  }
  for(var i=0; i<toks.length; ++i) {
    if(toks[i] == ".." && i > 0) {
      toks.splice(i-1, 2);
      i -= 2;
    } else if(toks[i] == "." || toks[i].length === 0) {
      toks.splice(i, 1);
      i -= 1;
    }
  }
  
  var dirname = toks.slice(0,toks.length-1).join("/")
    , url = toks.join("/");
  
	if (require.cache[url]) {
		// NOTE The callback should always be called asynchronously
		var obj = require.cache[url];
		if(obj.loaded) {
		  callback && setTimeout(function(){callback(obj.exports);}, 0);
		  return obj.exports;
		} else if(callback) {
		  obj.listeners.push(callback);
		  return obj.exports;
		}
	} else {
	  window.require.cache[url] = {
	      loaded: false
	    , listeners: []
	    , exports: new Object()
	  };
  }
  
  
	var request = new XMLHttpRequest();
	request.onreadystatechange = function() {
	
	  var obj = window.require.cache[url];
	  if(obj.loaded) {
	    return;
	  }
	
		if (request.readyState != 4)
			return;
		if (request.status != 200)
			throw 'RequireException: '+request.status+' '+request.statustext+' ('+url+')';

		if (request.getResponseHeader('content-type').indexOf('application/json') != -1) 
			window.require.cache[url] = JSON.parse(request.responseText);
		else 
			eval('(function(){\'use strict\';\nvar exports=window.require.cache[\''+url+'\'].exports;\nvar __DIRNAME="'+dirname+'";\nvar require=function(module,cb){return window.require(module,cb,"'+dirname+'");};\n'+request.responseText+'\n})();\n//@ sourceURL='+url);

    //Set loaded flag
    obj.loaded = true;
    
    //Wake up all listeners
    var listeners = obj.listeners;
    for(var i=0; i<listeners.length; ++i) {
      listeners[i](obj.exports);
    }
	}
	
	if(callback) {
	  window.require.cache[url].listeners.push(callback);
  }

	request.open('GET', url, !!callback);
	request.send();
	return require.cache[url].exports;
}

// INFO initializing module cache
window.require.cache = new Object();

})();


================================================
FILE: DataStructures/structures/list.js
================================================
exports.create = function(ArrayType, item_size) {

  function Cell(next, prev, value) {
    this.next   = next;
    this.prev   = prev;
    this.value  = value;
  }

  var head  = null
    , tail  = null
    , count = 0;
    
  //Create the data structure
  var list = {
  
    //Iterator functions
      begin: function() {
      return head;
    }
    , end: function() {
      return null;
    }
    , buffer: function(iter) {
      return iter.value;
    }
    , index: function(iter) {
      return 0;
    }
    , next: function(iter) {
      return iter.next;
    }
    , prev: function(iter) {
      if(iter)
        return iter.prev;
      return tail;
    }
    , valid: function(iter) {
      return !!iter;
    }
    
    //Iterator modification stuff
    , insert: function(iter, value) {
      ++count;
      
      //Special case: At end of list
      if(!iter) {
        var ncell = new Cell(null, tail, value);
        if(tail) {
          tail.next = ncell;
        } else {
          head = ncell;
        }
        tail = ncell;
        return;
      }
      //Otherwise, just insert normally
      var ncell = new Cell(iter, iter.prev, value);
      if(iter.prev) {
        iter.prev.next = ncell;
      } else {
        head = ncell;
      }
      iter.prev = ncell;
    }
    , remove: function(iter) {
      --count;
      if(iter.prev) {
        iter.prev.next = iter.next;
      } else {
        head = iter.next;
      }
      if(iter.next) {
        iter.next.prev = iter.prev;
      } else {
        tail = iter.prev;
      }
    }
    
    
    //Updates
    , push: function(value) {
      list.insert(list.end(), value);
    }
    , pop: function() {
      list.remove(list.prev(list.end()));
    }
    , unshift: function(value) {
      list.insert(list.begin(), value);
    }
    , shift: function() {
      list.remove(list.begin());
    }
    
    //Status stuff
    , count: function() {
      return count;
    } 
  };
  
  return list;
}


================================================
FILE: DataStructures/structures/pma.js
================================================
//Packed memory array
//
// Supports fast iteration like vector, but O(log^2(n)) insert/delete like linked list
//
exports.makePMA = function(ArrayType, item_size) {

  var levels      = 1
    , chunk_size  = levels * item_size
    , buffer      = new ArrayType( chunk_size << (levels+1) )
    , occupancy   = new UInt8Array( 1<<(levels+1) )
    , item_count  = 0; 
    
  //Reallocate the data structure
  function set_levels(nlevels) {
  
    var nchunk_size = nlevels * item_size
      , nbuffer     = new ArrayType(chunk_size << (nlevels+1))
      , noccupancy  = new UInt8Array(1<<(nlevels+1));
    
    //Rebalance array into new buffer, swap pointers
    
  
  }
    
  //Rebalance all the elements in range
  function rebalance(lo, hi) {
  
  }
  
  return {
    //Basic iterator stuff
      begin: function() {
    }
    , end: function() {
    }
    , value: function(iter) {
    }
    , next: function(iter) {
    }
    , prev: function(iter) {
    }
    , valid: function(iter) {
    }

    //Iterator modification stuff
    , insert: function(iter, value) {
    }
    , remove: function(iter) {
    }

    //Updates
    , push: function(value) {
    }
    , pop: function() {
    }
    , unshift: function(value) {
    }
    , shift: function() {
    }
    
    //Status flags
    , count: function() {
    }
  };
}



================================================
FILE: DataStructures/structures/unordered_vector.js
================================================
var vector = require('./vector.js');

exports.create = function(ArrayType, item_size) {
  var vec = vector.create(ArrayType, item_size);
  
  vec.remove = function(iter) {
    var buf = vec.buffer(iter)
      , eob = vec.end() - item_size;
    for(var i=0; i<item_size; ++i) {
      buf[iter+i] = buf[eob+i];
    }
    vec.pop();
  }

  return vec;
}




================================================
FILE: DataStructures/structures/vector.js
================================================
//A flat array of fixed size items stored in a packed type array.
//
// Basically this class is a workaround for the lack of packed struct support in javascript
//
exports.create = function(ArrayType, item_size) {

  var buffer_size = 0
    , buffer = new ArrayType(item_size, Math.ceil(4096 / item_size));
  
  //Reserves some space  
  function check_resize() {
    if(buffer_size + item_size <= buffer.length) {
      return;
    }
    var tmp = new ArrayType(2*buffer.length);
    tmp.set(buffer);
    buffer = tmp;
  }
  
  return {
    //Basic iterator stuff
      begin: function() {
      return 0;
    }
    , end: function() {
      return buffer_size;
    }
    , buffer: function(iter) {
      return buffer;
    }
    , index: function(iter) {
      return iter;
    }
    , next: function(iter) {
      return iter + item_size;
    }
    , prev: function(iter) {
      return iter - item_size;
    }
    , valid: function(iter) {
      return 0 <= iter && iter < buffer_size;
    }

    //Iterator modification stuff
    , insert: function(iter, value) {
      check_resize();
      buffer.set(buffer.subarray(iter, buffer_size), iter+item_size);
      buffer.set(value, iter);
      buffer_size += item_size;
    }
    , remove: function(iter) {
      buffer.set(buffer.subarray(iter+item_size, buffer_size), iter);
      buffer_size -= item_size;
    }

    //Updates
    , push: function(value) {
      check_resize();
      buffer.set(value, buffer_size);
      buffer_size += item_size;
    }
    , pop: function() {
      buffer_size -= item_size;
    }
    , unshift: function(value) {
      check_resize();
      buffer.set(buffer.subarray(item_size, buffer_size), item_size);
      buffer.set(value);
      buffer_size += item_size;
    }
    , shift: function() {
      buffer.set(buffer.subarray(item_size, buffer_size));
      buffer_size -= item_size;
    }
    
    //Status flags
    , count: function() {
      return buffer_size / item_size;
    }
    , item_size: function() {
      return item_size;
    }
  };
}



================================================
FILE: DataStructures/tests/particles.js
================================================
exports.create_particle_system = function(options) {
  var particles   = options.data_structure(Float32Array, 5)
    , accumulator = 0.0;
  return {
      emitter_rate: options.emitter_rate
    , tick: function() {
      accumulator += Math.random() * this.emitter_rate * 2.0;
      while(accumulator >= 1.0) {
        var t = Math.random() * Math.PI * 2.0
          , v = Math.random() * 0.1 + 0.01;
        particles.push(new Float32Array([
            0.0, 0.0
          , Math.cos(t) * v, Math.sin(t) * v
          , Math.random()
        ]));
        accumulator -= 1.0;
      }
      
      for(var iter = particles.prev(particles.end());
        particles.valid(iter);
        iter = particles.prev(iter)) {
        var buf = particles.buffer(iter)
          , idx = particles.index(iter);
        buf[idx+0] += buf[idx+2];
        buf[idx+1] += buf[idx+3];
        if(Math.abs(buf[idx]) > 10.0 || Math.abs(buf[idx+1]) > 10.0) {
          particles.remove(iter);
        }
      }
    }
    , foreachParticle: function(visitor) {
      for(var iter = particles.begin(); iter !== particles.end(); iter = particles.next(iter)) {
        var buf = particles.buffer(iter)
          , idx = particles.index(iter);
        visitor(buf[idx+0], buf[idx+1], buf[idx+2], buf[idx+3], buf[idx+4]);
      }
    }
    , count : function() {
      return particles.count();
    }
  }
}



================================================
FILE: DataStructures/tests/test_particles.js
================================================
var particles = require('./particles.js').create_particle_system({
    data_structure: require(process.argv[2]).create
  , emitter_rate:   200.0
}); 

//Warm up
console.log("Warming up...");
for(var i=0; i<2000; ++i) {
  particles.tick();
}
console.log("Initial population:", particles.count());

//Do simulation
console.log("Running benchmark");
var NUM_ITERS = 10000;
var start = new Date();
for(var i=0; i<NUM_ITERS; ++i) {
  particles.tick();
}
var end = new Date();
console.log("Final population:", particles.count());
console.log("Score = ", (end-start) / (NUM_ITERS * 1000.0), "s / tick");



================================================
FILE: Downsample/MIT-LICENSE.txt
================================================
Copyright (c) 2011 Jerome Etienne, http://jetienne.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

================================================
FILE: Downsample/Makefile
================================================
# makefile to automatize simple operations

server:
	python -m SimpleHTTPServer

deploy:
	# assume there is something to commit
	# use "git diff --exit-code HEAD" to know if there is something to commit
	# so two lines: one if no commit, one if something to commit 
	git commit -a -m "New deploy" && git push -f origin HEAD:gh-pages && git reset HEAD~



================================================
FILE: Downsample/css/main.css
================================================
body {
	overflow	: hidden;
	padding		: 0;
	margin		: 0;

	color		: #222;
	background-color: #BBB;
	font-family	: arial;
	font-size	: 100%;
}
#info .top {
	position	: absolute;
	top		: 0px;
	width		: 100%;
	padding		: 5px;
	text-align	: center;
}
#info a {
	color		: #66F;
	text-decoration	: none;
}
#info a:hover {
	text-decoration	: underline;
}
#info .bottom {
	position	: absolute;
	bottom		: 0px;
	right		: 5px;
	padding		: 5px;
}

#info .controls {
	position	: absolute;
	top		: 10px;
	left		: 10px;
	padding		: 5px;
}


================================================
FILE: Downsample/experiment.txt
================================================

Method:  tested each algorithm on 65^3 grid.  Plotted the function

  sin(omega * x) + sin(omega * y) + sin(omega * z)

in the range [-pi/2, pi/2] x [-pi/2, pi/2] x [-pi/2, pi/2]

To control for garbage collection and other unpredictable run time events, each run was repeated 100x to get an averaged measurement.

Also, since v8 has a JIT, we ran each method on a grid initialized with omega = 5 for 100 iterations in an attempt to trigger v8's optimizer.

Measurements were taken on my laptop:

  node.js version: 0.6.14
  Linux Mint 12
  CPU: Intel Core2 Duo P8700 @ 2.53GHz
  RAM: 4 GB

First column is omega, second column is time taken.  All measurements are in milliseconds (ms)

mc:

0, 29.93
1, 43.62
2, 61.48
3, 93.31
4, 138.2
5, 145.8
6, 186.0
7, 213.2
8, 255.9
9, 272.1
10, 274.6




sn (no precalc):

0, 26.79
1, 33.95
2, 44.87
3, 54.74
4, 59.81
5, 86.61
6, 98.45
7, 114.5
8, 131.2
9, 131.0
10, 147.7





sn (w/ edge precalculation):

0, 24.06
1, 29.42
2, 37.78
3, 47.72
4, 51.36
5, 74.54
6, 83.99
7, 97.34
8, 112.4
9, 109.2
10, 124.3



mt (NOTE: Number of iterations was reduced to 20 in order to get benchmark to complete in a reasonable time):

0, 57
1, 171
2, 250
3, 392
4, 510
5, 620
6, 784
7, 922
8, 1070
9, 1220
10, 1420






Mesh sizes:

vertices/faces:


sn:

0, 0
7759, 7569
15261, 14513
23247, 22695
30590, 29132
38627, 37749
45957, 43861
53899, 52755
60978, 58304
68991, 67665
76193, 73133



mc:

0, 0
31038, 15520
61034, 30512
93042, 46548
122378, 61204
154758, 77504
184138, 92224
216282, 108484
244514, 122576
277422, 139440
306554, 154168

mt:

0, 0
139770, 42701
214610, 65071
338766, 102805
431466, 130840
553458, 167781
652046, 197603
769878, 233265
869174, 263474
986538, 298725
1087086, 329083





================================================
FILE: Downsample/index.html
================================================
<!doctype html>
<html>
	<head>
		<title>Volume Sampling Toolbox</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
		
			
		<script src="vendor/three.js/Three.js"></script>
		<script src="vendor/three.js/Detector.js"></script>
		<script src="vendor/three.js/Stats.js"></script>

		<script src="vendor/threex/THREEx.screenshot.js"></script>
		<script src="vendor/threex/THREEx.FullScreen.js"></script>
		<script src="vendor/threex/THREEx.WindowResize.js"></script>
		<script src="vendor/threex.dragpancontrols.js"></script>

    <!--DSP-->
    <script src="vendor/dsp.js"></script>


    <!--Mesh algorithms-->
    <script src="js/surfacenets.js"></script>
    
    <!--Downsamplers-->
    <script src="js/nearestfilter.js"></script>
    <script src="js/boxfilter.js"></script>
    <script src="js/maxfilter.js"></script>
    <script src="js/minfilter.js"></script>
    <script src="js/medianfilter.js"></script>
    <script src="js/closing.js"></script>
    <script src="js/opening.js"></script>
    
    <script src="js/perlinnoise.js"></script>
    <script src="js/testdata.js"></script>

		<link  href="css/main.css" rel="stylesheet"/>
	</head>
<body>
	<!-- three.js container -->
    	<div id="container"></div>
	<!-- info on screen display -->
	<div id="info">
		<div class="top">
			Volume Resampling
		</div>
		<div class="bottom" id="inlineDoc" >
			- <i>p</i> for screenshot
		</div>
	  <div class="controls">
	    <p>Input Data:</p>
	    <p><select id="datasource"></select></p>
	    <p>Filter:</p>
	    <p><select id="filters"></select></p>
	    <p>Scale:</p>
	    <p><select id="resolution"></select></p>
	    <p>Show facets: <input type="checkbox" id="showfacets" value="checked" /></p>
	    <p>Show edges: <input type="checkbox" id="showedges" value="checked" /></p>
	    <p>Volume Resolution: <input type="text" id="volumeres" value="0" /> </p>
	    <p>Vertex count: <input type="text" id="vertcount" value="0" /> </p>
	    <p>Face count: <input type="text" id="facecount" value="0" /> </p>
	  </div> 
	</div> 
	
	<script type="text/javascript">
	(function() {
	"use strict";
	
	  (function() {
		  var resolution = document.getElementById("resolution");
		  resolution.add(new Option('1', 0), null);
	    for(var i=1; i<5; ++i) {
  		  resolution.add(new Option('1/' + (1<<i), i), null);
	    }
	  })();
	
	
		var stats, scene, renderer, composer;
		var camera, cameraControls;
		var geometry, surfacemesh, wiremesh;
		
		var filters = {
		     'Nearest': NearestFilter
		   , 'Trilinear': BoxFilter
		   , 'Min': MinFilter
		   , 'Max': MaxFilter
		   , 'Median': MedianFilter
		   , 'Closing': ClosingFilter
		   , 'Opening': OpeningFilter
		};
		var testdata = {};
		
		
		function updateMesh() {
		
		  if(surfacemesh) {
		    scene.remove(surfacemesh);
		    scene.remove(wiremesh);
		  }
		  
		  //Downsample volume
		  var field = testdata[ document.getElementById("datasource").value ]()
		    , num_iters = parseInt(document.getElementById('resolution').value, 10)
		    , filter = filters[ document.getElementById("filters").value ]
		    , min_dim = Math.min(field.dims[0], Math.min(field.dims[1], field.dims[2]));
		  
	    if((1 << num_iters) >= min_dim) {
	      field = { volume: new Float32Array([0,0,0,0,0,0,0,0]), dims:[1,1,1] };
	    } else {
		    for(var i=0; (1<<i)<min_dim && i<num_iters; ++i) {
		      field = filter(field.volume, field.dims);
		    }
		  }
		    
		  //Create mesh and display
		  var result = SurfaceNets( field.volume, field.dims );
      
      //Update statistics
      document.getElementById("volumeres").value = field.dims[0] + 'x' + field.dims[1] + 'x' + field.dims[2];
      document.getElementById("vertcount").value = result.vertices.length;
      document.getElementById("facecount").value = result.faces.length;
      
      //Create surface mesh      
      geometry = new THREE.Geometry();  	      
      for(var i=0; i<result.vertices.length; ++i) {
        var v = result.vertices[i];
        geometry.vertices.push(new THREE.Vector3(v[0], v[1], v[2]));
      }
      
      for(var i=0; i<result.faces.length; ++i) {
        var f = result.faces[i];
        geometry.faces.push(new THREE.Face4(f[0], f[1], f[2], f[3]));
      }
      
      geometry.computeFaceNormals();
      geometry.computeBoundingBox();
      geometry.computeBoundingSphere();
			
      var bb = geometry.boundingBox
        , maxdim = 1.0;
      for(var i=0; i<3; ++i) {
        maxdim = Math.max(maxdim, field.dims[i]);
      }
      var scale = 1.0 / maxdim;
      
      
      var material	= new THREE.MeshNormalMaterial();
      surfacemesh	= new THREE.Mesh( geometry, material );
      surfacemesh.doubleSided = true;
      var wirematerial = new THREE.MeshBasicMaterial({
          color : 0xffffff
        , wireframe : true
      });
      wiremesh = new THREE.Mesh(geometry, wirematerial);
      wiremesh.doubleSided = true;
      scene.add( surfacemesh );
      scene.add( wiremesh );			

      
      wiremesh.scale.x = surfacemesh.scale.x = scale;
      wiremesh.scale.y = surfacemesh.scale.y = scale;
      wiremesh.scale.z = surfacemesh.scale.z = scale;
      
      wiremesh.position.x = surfacemesh.position.x = -field.dims[0] * scale * 0.5;
      wiremesh.position.y = surfacemesh.position.y = -field.dims[1] * scale * 0.5;
      wiremesh.position.z = surfacemesh.position.z = -field.dims[2] * scale * 0.5;
      
      scene.remove(surfacemesh);
      scene.add(surfacemesh);
      scene.remove(wiremesh);
      scene.add(wiremesh);
		}

		if( !init() )	animate();

		// init the scene
		function init(){
				
			if( Detector.webgl ){
				renderer = new THREE.WebGLRenderer({
					antialias		: true,	// to get smoother output
					preserveDrawingBuffer	: true	// to allow screenshot
				});
				renderer.setClearColorHex( 0xBBBBBB, 1 );
			}else{
			  renderer = new THREE.CanvasRenderer();
			}
			
			renderer.setSize( window.innerWidth, window.innerHeight );
			document.getElementById('container').appendChild(renderer.domElement);

			// add Stats.js - https://github.com/mrdoob/stats.js
			stats = new Stats();
			stats.domElement.style.position	= 'absolute';
			stats.domElement.style.bottom	= '0px';
			document.body.appendChild( stats.domElement );

			// create a scene
			scene = new THREE.Scene();

			// put a camera in the scene
			camera	= new THREE.PerspectiveCamera(35, window.innerWidth / window.innerHeight, 1, 10000 );
			camera.position.set(0, 0, 3);
			scene.add(camera);

			// create a camera contol
			cameraControls	= new THREE.TrackballControls( camera, document.getElementById('container') )

			// transparently support window resize
			THREEx.WindowResize.bind(renderer, camera);
			// allow 'p' to make screenshot
			THREEx.Screenshot.bindKey(renderer);
			// allow 'f' to go fullscreen where this feature is supported
			if( THREEx.FullScreen.available() ){
				THREEx.FullScreen.bindKey();		
				document.getElementById('inlineDoc').innerHTML	+= "- <i>f</i> for fullscreen";
			}

			// here you add your objects
			// - you will most likely replace this part by your own
			var light	= new THREE.AmbientLight( Math.random() * 0xffffff );
			scene.add( light );
			var light	= new THREE.DirectionalLight( Math.random() * 0xffffff );
			light.position.set( Math.random(), Math.random(), Math.random() ).normalize();
			scene.add( light );
			
			//Initialize dom elements
			testdata = createTestData();
			var ds = document.getElementById("datasource");
			for(var id in testdata) {
			  ds.add(new Option(id, id), null);
			}
			ds.onchange = updateMesh;
			var ms = document.getElementById("filters");
			for(var alg in filters) {
			  ms.add(new Option(alg, alg), null);
			}
			ms.onchange = updateMesh;
			
			document.getElementById("resolution").onchange = updateMesh;
			
			document.getElementById("showfacets").checked = true;
			document.getElementById("showedges").checked  = true;
			
			//Update mesh
			updateMesh();
			
			return false;
		}

		// animation loop
		function animate() {

			// loop on request animation loop
			// - it has to be at the begining of the function
			// - see details at http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
			requestAnimationFrame( animate );

			// do the render
			render();

			// update stats
			stats.update();
		}

		// render the scene
		function render() {
			// variable which is increase by Math.PI every seconds - usefull for animation
			var PIseconds	= Date.now() * Math.PI;

			// update camera controls
			cameraControls.update();

      surfacemesh.visible = document.getElementById("showfacets").checked;
      wiremesh.visible = document.getElementById("showedges").checked;

			// actually render the scene
			renderer.render( scene, camera );
		}
	})();
	</script>
</body>
</html>


================================================
FILE: Downsample/js/boxfilter.js
================================================

//Naive box filter for downsampling volume
function BoxFilter(volume, dims) {
  "use strict";
  
  var ndims = new Int32Array(3);
  for(var i=0; i<3; ++i) {
    ndims[i] = Math.floor(dims[i] / 2);
  }
  
  var nvolume = new Float32Array(ndims[0] * ndims[1] * ndims[2])
    , n = 0;
  for(var k=0; k<ndims[2]; ++k)
  for(var j=0; j<ndims[1]; ++j)
  for(var i=0; i<ndims[0]; ++i) {
  
    var s = 0.0;
    for(var dz=-1; dz<2; ++dz) {
      var iz = 2*(k)+dz;
      if(iz < 0) {
        iz = -iz;
      }
      if(iz >= dims[2]) {
        iz = 2*dims[2]-2-iz;
      }
      
      for(var dy=-1; dy<2; ++dy) {
        var iy = 2*(j)+dy;
        if(iy < 0) {
          iy = -iy;
        }
        if(iy >= dims[1]) {
          iy = 2*dims[1]-2-iy;
        }
        
        for(var dx=-1; dx<2; ++dx) {
          var ix = 2*(i)+dx;
          if(ix < 0) {
            ix = -ix;
          }
          if(ix >= dims[0]) {
            ix = 2*dims[0]-2-ix;
          }
          s += volume[ix+dims[0]*(iy+dims[1]*(iz))] / (1 << (Math.abs(dx) + Math.abs(dy) + Math.abs(dz)));
        }
      }
    }
    nvolume[n++] = s / 8.0;
  }
  
  return { volume: nvolume, dims:ndims };
}



================================================
FILE: Downsample/js/closing.js
================================================

//Morophological closing filter
function ClosingFilter(volume, dims) {
  "use strict";
  

  //Dilate
  var pvolume = new Float32Array(dims[0] * dims[1] * dims[2])
    , n = 0;
  for(var k=0; k<dims[2]; ++k)
  for(var j=0; j<dims[1]; ++j)
  for(var i=0; i<dims[0]; ++i) {
    var s = 1e16;
    for(var dz=-1; dz<=1; ++dz) {
      var iz = k+dz;
      if(iz < 0 || iz >=dims[2]) {
        continue;
      }
      for(var dy=-1; dy<=1; ++dy) {
        var iy = j+dy;
        if(iy < 0 || iy >= dims[1]) {
          continue;
        }
        for(var dx=-1; dx<=1; ++dx) {
          var ix = i+dx;
          if(ix < 0 || ix >= dims[0]) {
            continue;
          }
          s = Math.min(s, volume[ix+dims[0]*(iy+dims[1]*(iz))]);
        }
      }
    }
    pvolume[n++] = s;
  }
  
  //Erode and downsample
  var ndims = new Int32Array(3);
  for(var i=0; i<3; ++i) {
    ndims[i] = Math.floor(dims[i]/2);
  }
  var nvolume = new Float32Array(ndims[0] * ndims[1] * ndims[2]);
  n = 0;
  for(var k=0; k<ndims[2]; ++k)
  for(var j=0; j<ndims[1]; ++j)
  for(var i=0; i<ndims[0]; ++i) {
    var s = -1e16;
    for(var dz=-1; dz<=1; ++dz) {
      var iz = 2*k+dz;
      if(iz < 0 || iz >=dims[2]) {
        continue;
      }
      for(var dy=-1; dy<=1; ++dy) {
        var iy = 2*j+dy;
        if(iy < 0 || iy >= dims[1]) {
          continue;
        }
        for(var dx=-1; dx<=1; ++dx) {
          var ix = 2*i+dx;
          if(ix < 0 || ix >= dims[0]) {
            continue;
          }
          s = Math.max(s, pvolume[ix+dims[0]*(iy+dims[1]*(iz))]);
        }
      }
    }
    nvolume[n++] = s;
  }
  
  return { volume: nvolume, dims:ndims };
}



================================================
FILE: Downsample/js/marchingcubes.js
================================================
/**
 * Javascript Marching Cubes
 *
 * Based on Paul Bourke's classic implementation:
 *    http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/
 *
 * JS port by Mikola Lysenko
 */

var MarchingCubes = (function() {
var edgeTable= new Uint32Array([
      0x0  , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c,
      0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00,
      0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c,
      0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90,
      0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c,
      0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30,
      0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac,
      0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0,
      0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c,
      0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60,
      0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc,
      0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0,
      0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c,
      0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950,
      0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc ,
      0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0,
      0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc,
      0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0,
      0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c,
      0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650,
      0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc,
      0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0,
      0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c,
      0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460,
      0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac,
      0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0,
      0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c,
      0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230,
      0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c,
      0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190,
      0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c,
      0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0   ])
  , triTable = [
      [],
      [0, 8, 3],
      [0, 1, 9],
      [1, 8, 3, 9, 8, 1],
      [1, 2, 10],
      [0, 8, 3, 1, 2, 10],
      [9, 2, 10, 0, 2, 9],
      [2, 8, 3, 2, 10, 8, 10, 9, 8],
      [3, 11, 2],
      [0, 11, 2, 8, 11, 0],
      [1, 9, 0, 2, 3, 11],
      [1, 11, 2, 1, 9, 11, 9, 8, 11],
      [3, 10, 1, 11, 10, 3],
      [0, 10, 1, 0, 8, 10, 8, 11, 10],
      [3, 9, 0, 3, 11, 9, 11, 10, 9],
      [9, 8, 10, 10, 8, 11],
      [4, 7, 8],
      [4, 3, 0, 7, 3, 4],
      [0, 1, 9, 8, 4, 7],
      [4, 1, 9, 4, 7, 1, 7, 3, 1],
      [1, 2, 10, 8, 4, 7],
      [3, 4, 7, 3, 0, 4, 1, 2, 10],
      [9, 2, 10, 9, 0, 2, 8, 4, 7],
      [2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4],
      [8, 4, 7, 3, 11, 2],
      [11, 4, 7, 11, 2, 4, 2, 0, 4],
      [9, 0, 1, 8, 4, 7, 2, 3, 11],
      [4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1],
      [3, 10, 1, 3, 11, 10, 7, 8, 4],
      [1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4],
      [4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3],
      [4, 7, 11, 4, 11, 9, 9, 11, 10],
      [9, 5, 4],
      [9, 5, 4, 0, 8, 3],
      [0, 5, 4, 1, 5, 0],
      [8, 5, 4, 8, 3, 5, 3, 1, 5],
      [1, 2, 10, 9, 5, 4],
      [3, 0, 8, 1, 2, 10, 4, 9, 5],
      [5, 2, 10, 5, 4, 2, 4, 0, 2],
      [2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8],
      [9, 5, 4, 2, 3, 11],
      [0, 11, 2, 0, 8, 11, 4, 9, 5],
      [0, 5, 4, 0, 1, 5, 2, 3, 11],
      [2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5],
      [10, 3, 11, 10, 1, 3, 9, 5, 4],
      [4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10],
      [5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3],
      [5, 4, 8, 5, 8, 10, 10, 8, 11],
      [9, 7, 8, 5, 7, 9],
      [9, 3, 0, 9, 5, 3, 5, 7, 3],
      [0, 7, 8, 0, 1, 7, 1, 5, 7],
      [1, 5, 3, 3, 5, 7],
      [9, 7, 8, 9, 5, 7, 10, 1, 2],
      [10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3],
      [8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2],
      [2, 10, 5, 2, 5, 3, 3, 5, 7],
      [7, 9, 5, 7, 8, 9, 3, 11, 2],
      [9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11],
      [2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7],
      [11, 2, 1, 11, 1, 7, 7, 1, 5],
      [9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11],
      [5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0],
      [11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0],
      [11, 10, 5, 7, 11, 5],
      [10, 6, 5],
      [0, 8, 3, 5, 10, 6],
      [9, 0, 1, 5, 10, 6],
      [1, 8, 3, 1, 9, 8, 5, 10, 6],
      [1, 6, 5, 2, 6, 1],
      [1, 6, 5, 1, 2, 6, 3, 0, 8],
      [9, 6, 5, 9, 0, 6, 0, 2, 6],
      [5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8],
      [2, 3, 11, 10, 6, 5],
      [11, 0, 8, 11, 2, 0, 10, 6, 5],
      [0, 1, 9, 2, 3, 11, 5, 10, 6],
      [5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11],
      [6, 3, 11, 6, 5, 3, 5, 1, 3],
      [0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6],
      [3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9],
      [6, 5, 9, 6, 9, 11, 11, 9, 8],
      [5, 10, 6, 4, 7, 8],
      [4, 3, 0, 4, 7, 3, 6, 5, 10],
      [1, 9, 0, 5, 10, 6, 8, 4, 7],
      [10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4],
      [6, 1, 2, 6, 5, 1, 4, 7, 8],
      [1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7],
      [8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6],
      [7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9],
      [3, 11, 2, 7, 8, 4, 10, 6, 5],
      [5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11],
      [0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6],
      [9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6],
      [8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6],
      [5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11],
      [0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7],
      [6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9],
      [10, 4, 9, 6, 4, 10],
      [4, 10, 6, 4, 9, 10, 0, 8, 3],
      [10, 0, 1, 10, 6, 0, 6, 4, 0],
      [8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10],
      [1, 4, 9, 1, 2, 4, 2, 6, 4],
      [3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4],
      [0, 2, 4, 4, 2, 6],
      [8, 3, 2, 8, 2, 4, 4, 2, 6],
      [10, 4, 9, 10, 6, 4, 11, 2, 3],
      [0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6],
      [3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10],
      [6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1],
      [9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3],
      [8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1],
      [3, 11, 6, 3, 6, 0, 0, 6, 4],
      [6, 4, 8, 11, 6, 8],
      [7, 10, 6, 7, 8, 10, 8, 9, 10],
      [0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10],
      [10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0],
      [10, 6, 7, 10, 7, 1, 1, 7, 3],
      [1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7],
      [2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9],
      [7, 8, 0, 7, 0, 6, 6, 0, 2],
      [7, 3, 2, 6, 7, 2],
      [2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7],
      [2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7],
      [1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11],
      [11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1],
      [8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6],
      [0, 9, 1, 11, 6, 7],
      [7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0],
      [7, 11, 6],
      [7, 6, 11],
      [3, 0, 8, 11, 7, 6],
      [0, 1, 9, 11, 7, 6],
      [8, 1, 9, 8, 3, 1, 11, 7, 6],
      [10, 1, 2, 6, 11, 7],
      [1, 2, 10, 3, 0, 8, 6, 11, 7],
      [2, 9, 0, 2, 10, 9, 6, 11, 7],
      [6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8],
      [7, 2, 3, 6, 2, 7],
      [7, 0, 8, 7, 6, 0, 6, 2, 0],
      [2, 7, 6, 2, 3, 7, 0, 1, 9],
      [1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6],
      [10, 7, 6, 10, 1, 7, 1, 3, 7],
      [10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8],
      [0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7],
      [7, 6, 10, 7, 10, 8, 8, 10, 9],
      [6, 8, 4, 11, 8, 6],
      [3, 6, 11, 3, 0, 6, 0, 4, 6],
      [8, 6, 11, 8, 4, 6, 9, 0, 1],
      [9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6],
      [6, 8, 4, 6, 11, 8, 2, 10, 1],
      [1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6],
      [4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9],
      [10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3],
      [8, 2, 3, 8, 4, 2, 4, 6, 2],
      [0, 4, 2, 4, 6, 2],
      [1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8],
      [1, 9, 4, 1, 4, 2, 2, 4, 6],
      [8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1],
      [10, 1, 0, 10, 0, 6, 6, 0, 4],
      [4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3],
      [10, 9, 4, 6, 10, 4],
      [4, 9, 5, 7, 6, 11],
      [0, 8, 3, 4, 9, 5, 11, 7, 6],
      [5, 0, 1, 5, 4, 0, 7, 6, 11],
      [11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5],
      [9, 5, 4, 10, 1, 2, 7, 6, 11],
      [6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5],
      [7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2],
      [3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6],
      [7, 2, 3, 7, 6, 2, 5, 4, 9],
      [9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7],
      [3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0],
      [6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8],
      [9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7],
      [1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4],
      [4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10],
      [7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10],
      [6, 9, 5, 6, 11, 9, 11, 8, 9],
      [3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5],
      [0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11],
      [6, 11, 3, 6, 3, 5, 5, 3, 1],
      [1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6],
      [0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10],
      [11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5],
      [6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3],
      [5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2],
      [9, 5, 6, 9, 6, 0, 0, 6, 2],
      [1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8],
      [1, 5, 6, 2, 1, 6],
      [1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6],
      [10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0],
      [0, 3, 8, 5, 6, 10],
      [10, 5, 6],
      [11, 5, 10, 7, 5, 11],
      [11, 5, 10, 11, 7, 5, 8, 3, 0],
      [5, 11, 7, 5, 10, 11, 1, 9, 0],
      [10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1],
      [11, 1, 2, 11, 7, 1, 7, 5, 1],
      [0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11],
      [9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7],
      [7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2],
      [2, 5, 10, 2, 3, 5, 3, 7, 5],
      [8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5],
      [9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2],
      [9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2],
      [1, 3, 5, 3, 7, 5],
      [0, 8, 7, 0, 7, 1, 1, 7, 5],
      [9, 0, 3, 9, 3, 5, 5, 3, 7],
      [9, 8, 7, 5, 9, 7],
      [5, 8, 4, 5, 10, 8, 10, 11, 8],
      [5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0],
      [0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5],
      [10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4],
      [2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8],
      [0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11],
      [0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5],
      [9, 4, 5, 2, 11, 3],
      [2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4],
      [5, 10, 2, 5, 2, 4, 4, 2, 0],
      [3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9],
      [5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2],
      [8, 4, 5, 8, 5, 3, 3, 5, 1],
      [0, 4, 5, 1, 0, 5],
      [8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5],
      [9, 4, 5],
      [4, 11, 7, 4, 9, 11, 9, 10, 11],
      [0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11],
      [1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11],
      [3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4],
      [4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2],
      [9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3],
      [11, 7, 4, 11, 4, 2, 2, 4, 0],
      [11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4],
      [2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9],
      [9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7],
      [3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10],
      [1, 10, 2, 8, 7, 4],
      [4, 9, 1, 4, 1, 7, 7, 1, 3],
      [4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1],
      [4, 0, 3, 7, 4, 3],
      [4, 8, 7],
      [9, 10, 8, 10, 11, 8],
      [3, 0, 9, 3, 9, 11, 11, 9, 10],
      [0, 1, 10, 0, 10, 8, 8, 10, 11],
      [3, 1, 10, 11, 3, 10],
      [1, 2, 11, 1, 11, 9, 9, 11, 8],
      [3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9],
      [0, 2, 11, 8, 0, 11],
      [3, 2, 11],
      [2, 3, 8, 2, 8, 10, 10, 8, 9],
      [9, 10, 2, 0, 9, 2],
      [2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8],
      [1, 10, 2],
      [1, 3, 8, 9, 1, 8],
      [0, 9, 1],
      [0, 3, 8],
      []]
  , cubeVerts = [
     [0,0,0]
    ,[1,0,0]
    ,[1,1,0]
    ,[0,1,0]
    ,[0,0,1]
    ,[1,0,1]
    ,[1,1,1]
    ,[0,1,1]]
  , edgeIndex = [ [0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7] ];

return function(data, dims) {
  var vertices = []
    , faces = []
    , n = 0
    , grid = new Float32Array(8)
    , edges = new Int32Array(12)
    , x = new Int32Array(3);
  //March over the volume
  for(x[2]=0; x[2]<dims[2]-1; ++x[2], n+=dims[0])
  for(x[1]=0; x[1]<dims[1]-1; ++x[1], ++n)
  for(x[0]=0; x[0]<dims[0]-1; ++x[0], ++n) {
    //For each cell, compute cube mask
    var cube_index = 0;
    for(var i=0; i<8; ++i) {
      var v = cubeVerts[i]
        , s = data[n + v[0] + dims[0] * (v[1] + dims[1] * v[2])];
      grid[i] = s;
      cube_index |= (s > 0) ? 1 << i : 0;
    }
    //Compute vertices
    var edge_mask = edgeTable[cube_index];
    if(edge_mask === 0) {
      continue;
    }
    for(var i=0; i<12; ++i) {
      if((edge_mask & (1<<i)) === 0) {
        continue;
      }
      edges[i] = vertices.length;
      var nv = [0,0,0]
        , e = edgeIndex[i]
        , p0 = cubeVerts[e[0]]
        , p1 = cubeVerts[e[1]]
        , a = grid[e[0]]
        , b = grid[e[1]]
        , d = a - b
        , t = 0;
      if(Math.abs(d) > 1e-6) {
        t = a / d;
      }
      for(var j=0; j<3; ++j) {
        nv[j] = (x[j] + p0[j]) + t * (p1[j] - p0[j]);
      }
      vertices.push(nv);
    }
    //Add faces
    var f = triTable[cube_index];
    for(var i=0; i<f.length; i += 3) {
      faces.push([edges[f[i]], edges[f[i+1]], edges[f[i+2]]]);
    }
  }
  return { vertices: vertices, faces: faces };
};
})();

if(exports) {
  exports.mesher = MarchingCubes;
}



================================================
FILE: Downsample/js/marchingtetrahedra.js
================================================
/**
 * Marching Tetrahedra in Javascript
 *
 * Based on Paul Bourke's implementation
 *  http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/
 *
 * (Several bug fixes were made to deal with oriented faces)
 *
 * Javascript port by Mikola Lysenko
 */
var MarchingTetrahedra = (function() {
var cube_vertices = [
        [0,0,0]
      , [1,0,0]
      , [1,1,0]
      , [0,1,0]
      , [0,0,1]
      , [1,0,1]
      , [1,1,1]
      , [0,1,1] ]
  , tetra_list = [
        [0,2,3,7]
      , [0,6,2,7]
      , [0,4,6,7]
      , [0,6,1,2]
      , [0,1,6,4]
      , [5,6,1,4] ];

return function(data, dims) {
   
   var vertices = []
    , faces = []
    , n = 0
    , grid = new Float32Array(8)
    , edges = new Int32Array(12)
    , x = [0,0,0];
    
  function interp(i0, i1) {
    var g0 = grid[i0]
      , g1 = grid[i1]
      , p0 = cube_vertices[i0]
      , p1 = cube_vertices[i1]
      , v  = [x[0], x[1], x[2]]
      , t = g0 - g1;
    if(Math.abs(t) > 1e-6) {
      t = g0 / t;
    }
    for(var i=0; i<3; ++i) {
      v[i] += p0[i] + t * (p1[i] - p0[i]);
    }
    vertices.push(v);
    return vertices.length - 1;
  }
  
  //March over the volume
  for(x[2]=0; x[2]<dims[2]-1; ++x[2], n+=dims[0])
  for(x[1]=0; x[1]<dims[1]-1; ++x[1], ++n)
  for(x[0]=0; x[0]<dims[0]-1; ++x[0], ++n) {
    //Read in cube  
    for(var i=0; i<8; ++i) {
      grid[i] = data[n + cube_vertices[i][0] + dims[0] * (cube_vertices[i][1] + dims[1] * cube_vertices[i][2])];
    }
    for(var i=0; i<tetra_list.length; ++i) {
      var T = tetra_list[i]
        , triindex = 0;
      if (grid[T[0]] < 0) triindex |= 1;
      if (grid[T[1]] < 0) triindex |= 2;
      if (grid[T[2]] < 0) triindex |= 4;
      if (grid[T[3]] < 0) triindex |= 8;
      
      //Handle each case
      switch (triindex) {
        case 0x00:
        case 0x0F:
        break;
        case 0x0E:
          faces.push([ 
              interp(T[0], T[1])
            , interp(T[0], T[3]) 
            , interp(T[0], T[2]) ]);
        break;
        case 0x01:
          faces.push([ 
              interp(T[0], T[1])
            , interp(T[0], T[2])
            , interp(T[0], T[3])  ]);
        break;
        case 0x0D:
          faces.push([ 
              interp(T[1], T[0])
            , interp(T[1], T[2]) 
            , interp(T[1], T[3]) ]);
        break;
        case 0x02:
          faces.push([ 
              interp(T[1], T[0])
            , interp(T[1], T[3])
            , interp(T[1], T[2]) ]);
        break;
        case 0x0C:
          faces.push([ 
                interp(T[1], T[2])
              , interp(T[1], T[3])
              , interp(T[0], T[3])
              , interp(T[0], T[2]) ]);
        break;
        case 0x03:
          faces.push([ 
                interp(T[1], T[2])
              , interp(T[0], T[2])
              , interp(T[0], T[3])
              , interp(T[1], T[3]) ]);
        break;
        case 0x04:
          faces.push([ 
                interp(T[2], T[0])
              , interp(T[2], T[1])
              , interp(T[2], T[3]) ]);
        break;
        case 0x0B:
          faces.push([ 
                interp(T[2], T[0])
              , interp(T[2], T[3]) 
              , interp(T[2], T[1]) ]);
        break;
        case 0x05:
          faces.push([ 
                interp(T[0], T[1])
              , interp(T[1], T[2])
              , interp(T[2], T[3])
              , interp(T[0], T[3]) ]);
        break;
        case 0x0A:
          faces.push([ 
                interp(T[0], T[1])
              , interp(T[0], T[3])
              , interp(T[2], T[3])
              , interp(T[1], T[2]) ]);
        break;
        case 0x06:
          faces.push([ 
                interp(T[2], T[3])
              , interp(T[0], T[2])
              , interp(T[0], T[1])
              , interp(T[1], T[3]) ]);
        break;
        case 0x09:
          faces.push([ 
                interp(T[2], T[3])
              , interp(T[1], T[3])
              , interp(T[0], T[1])
              , interp(T[0], T[2]) ]);
        break;
        case 0x07:
          faces.push([ 
                interp(T[3], T[0])
              , interp(T[3], T[1])
              , interp(T[3], T[2]) ]);
        break;
        case 0x08:
          faces.push([ 
                interp(T[3], T[0])
              , interp(T[3], T[2])
              , interp(T[3], T[1]) ]);
        break;
      }
    }
  }
  
  return { vertices: vertices, faces: faces };
}
})();


if(exports) {
  exports.mesher = MarchingTetrahedra;
}


================================================
FILE: Downsample/js/maxfilter.js
================================================

//Maximum filter
function MaxFilter(volume, dims) {
  "use strict";
  
  var ndims = new Int32Array(3);
  for(var i=0; i<3; ++i) {
    ndims[i] = Math.floor(dims[i]/2);
  }
  
  var nvolume = new Float32Array(ndims[0] * ndims[1] * ndims[2])
    , n = 0;
  for(var k=0; k<ndims[2]; ++k)
  for(var j=0; j<ndims[1]; ++j)
  for(var i=0; i<ndims[0]; ++i) {
    var s = -1e16;
    for(var dz=-1; dz<2; ++dz) {
      var iz = 2*(k)+dz;
      if(iz < 0 || iz >=dims[2]) {
        continue;
      }
      for(var dy=-1; dy<2; ++dy) {
        var iy = 2*(j)+dy;
        if(iy < 0 || iy >= dims[1]) {
          continue;
        }
        for(var dx=-1; dx<2; ++dx) {
          var ix = 2*(i)+dx;
          if(ix < 0 || ix >= dims[0]) {
            continue;
          }
          s = Math.max(s, volume[ix+dims[0]*(iy+dims[1]*(iz))]);
        }
      }
    }
    nvolume[n++] = s;
  }
  
  return { volume: nvolume, dims:ndims };
}



================================================
FILE: Downsample/js/medianfilter.js
================================================

//Median filter
function MedianFilter(volume, dims) {
  "use strict";
  
  var ndims = new Int32Array(3);
  for(var i=0; i<3; ++i) {
    ndims[i] = Math.floor(dims[i] / 2);
  }
  
  var nvolume = new Float32Array(ndims[0] * ndims[1] * ndims[2])
    , n = 0
    , ranks = new Array(27);
  for(var k=0; k<ndims[2]; ++k)
  for(var j=0; j<ndims[1]; ++j)
  for(var i=0; i<ndims[0]; ++i) {
    var idx = 0;
    for(var dz=-1; dz<2; ++dz) {
      var iz = 2*(k)+dz;
      if(iz < 0) {
        iz = -iz;
      }
      if(iz >= dims[2]) {
        iz = 2*dims[2]-2-iz;
      }
      
      for(var dy=-1; dy<2; ++dy) {
        var iy = 2*(j)+dy;
        if(iy < 0) {
          iy = -iy;
        }
        if(iy >= dims[1]) {
          iy = 2*dims[1]-2-iy;
        }
        
        for(var dx=-1; dx<2; ++dx) {
          var ix = 2*(i)+dx;
          if(ix < 0) {
            ix = -ix;
          }
          if(ix >= dims[0]) {
            ix = 2*dims[0]-2-ix;
          }
          ranks[idx++] = volume[ix+dims[0]*(iy+dims[1]*(iz))];
        }
      }
    }
    var ranked = ranks.sort(function(a,b){ return b < a ? -1 : b>a ? 1 : 0; });
    nvolume[n++] = 0.5 * (ranked[Math.floor(idx/2)] + ranked[Math.floor(idx/2)+1]);
  }
  
  return { volume: nvolume, dims:ndims };
}



================================================
FILE: Downsample/js/minfilter.js
================================================

//Minimum filter
function MinFilter(volume, dims) {
  "use strict";
  
  var ndims = new Int32Array(3);
  for(var i=0; i<3; ++i) {
    ndims[i] = Math.floor(dims[i] / 2);
  }
  
  var nvolume = new Float32Array(ndims[0] * ndims[1] * ndims[2])
    , n = 0;
  for(var k=0; k<ndims[2]; ++k)
  for(var j=0; j<ndims[1]; ++j)
  for(var i=0; i<ndims[0]; ++i) {
    var s = 1e16;
    for(var dz=-1; dz<2; ++dz) {
      var iz = 2*(k)+dz;
      if(iz < 0 || iz >=dims[2]) {
        continue;
      }
      for(var dy=-1; dy<2; ++dy) {
        var iy = 2*(j)+dy;
        if(iy < 0 || iy >= dims[1]) {
          continue;
        }
        for(var dx=-1; dx<2; ++dx) {
          var ix = 2*(i)+dx;
          if(ix < 0 || ix >= dims[0]) {
            continue;
          }
          s = Math.min(s, volume[ix+dims[0]*(iy+dims[1]*(iz))]);
        }
      }
    }
    nvolume[n++] = s;
  }
  
  return { volume: nvolume, dims:ndims };
}



================================================
FILE: Downsample/js/nearestfilter.js
================================================

//Naive box filter for downsampling volume
function NearestFilter(volume, dims) {
  "use strict";
  
  var ndims = new Int32Array(3);
  for(var i=0; i<3; ++i) {
    ndims[i] = Math.floor(dims[i]/2);
  }
  
  var nvolume = new Float32Array(ndims[0] * ndims[1] * ndims[2])
    , n = 0;
  for(var k=0; k<ndims[2]; ++k)
  for(var j=0; j<ndims[1]; ++j)
  for(var i=0; i<ndims[0]; ++i) {
    if(2*i < dims[0] && 2*j < dims[1] && 2*k < dims[2]) {
      nvolume[n++] = volume[2*i + dims[0] * (2*j + dims[1] * (2* k))];
    } else {
      nvolume[n++] = 1.0;
    }
  }
  
  return { volume: nvolume, dims:ndims };
}



================================================
FILE: Downsample/js/opening.js
================================================

//Morophological opening filter
function OpeningFilter(volume, dims) {
  "use strict";
  

  //Erode
  var pvolume = new Float32Array(dims[0] * dims[1] * dims[2])
    , n = 0;
  for(var k=0; k<dims[2]; ++k)
  for(var j=0; j<dims[1]; ++j)
  for(var i=0; i<dims[0]; ++i) {
    var s = -1e16;
    for(var dz=-1; dz<=1; ++dz) {
      var iz = k+dz;
      if(iz < 0 || iz >=dims[2]) {
        continue;
      }
      for(var dy=-1; dy<=1; ++dy) {
        var iy = j+dy;
        if(iy < 0 || iy >= dims[1]) {
          continue;
        }
        for(var dx=-1; dx<=1; ++dx) {
          var ix = i+dx;
          if(ix < 0 || ix >= dims[0]) {
            continue;
          }
          s = Math.max(s, volume[ix+dims[0]*(iy+dims[1]*(iz))]);
        }
      }
    }
    pvolume[n++] = s;
  }
  
  //Dilate
  var ndims = new Int32Array(3);
  for(var i=0; i<3; ++i) {
    ndims[i] = Math.ceil(dims[i]/2);
  }
  var nvolume = new Float32Array(ndims[0] * ndims[1] * ndims[2]);
  n = 0;
  for(var k=0; k<ndims[2]; ++k)
  for(var j=0; j<ndims[1]; ++j)
  for(var i=0; i<ndims[0]; ++i) {
    var s = 1e16;
    for(var dz=-1; dz<=1; ++dz) {
      var iz = 2*k+dz;
      if(iz < 0 || iz >=dims[2]) {
        continue;
      }
      for(var dy=-1; dy<=1; ++dy) {
        var iy = 2*j+dy;
        if(iy < 0 || iy >= dims[1]) {
          continue;
        }
        for(var dx=-1; dx<=1; ++dx) {
          var ix = 2*i+dx;
          if(ix < 0 || ix >= dims[0]) {
            continue;
          }
          s = Math.min(s, pvolume[ix+dims[0]*(iy+dims[1]*(iz))]);
        }
      }
    }
    nvolume[n++] = s;
  }
  
  return { volume: nvolume, dims:ndims };
}



================================================
FILE: Downsample/js/perlinnoise.js
================================================

//This code is from Kas Thomas' blog:
//  http://asserttrue.blogspot.de/2011/12/perlin-noise-in-javascript_31.html

// This is a port of Ken Perlin's Java code. The
// original Java code is at http://cs.nyu.edu/%7Eperlin/noise/.
// Note that in this version, a number from 0 to 1 is returned.
PerlinNoise = new function() {

this.noise = function(x, y, z) {

   var p = new Array(512)
   var permutation = [ 151,160,137,91,90,15,
   131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
   190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
   88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
   77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,
   102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,
   135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,
   5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,
   223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,
   129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,
   251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,
   49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,
   138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180
   ];
   for (var i=0; i < 256 ; i++) 
 p[256+i] = p[i] = permutation[i]; 

      var X = Math.floor(x) & 255,                  // FIND UNIT CUBE THAT
          Y = Math.floor(y) & 255,                  // CONTAINS POINT.
          Z = Math.floor(z) & 255;
      x -= Math.floor(x);                                // FIND RELATIVE X,Y,Z
      y -= Math.floor(y);                                // OF POINT IN CUBE.
      z -= Math.floor(z);
      var    u = fade(x),                                // COMPUTE FADE CURVES
             v = fade(y),                                // FOR EACH OF X,Y,Z.
             w = fade(z);
      var A = p[X  ]+Y, AA = p[A]+Z, AB = p[A+1]+Z,      // HASH COORDINATES OF
          B = p[X+1]+Y, BA = p[B]+Z, BB = p[B+1]+Z;      // THE 8 CUBE CORNERS,

      return scale(lerp(w, lerp(v, lerp(u, grad(p[AA  ], x  , y  , z   ),  // AND ADD
                                     grad(p[BA  ], x-1, y  , z   )), // BLENDED
                             lerp(u, grad(p[AB  ], x  , y-1, z   ),  // RESULTS
                                     grad(p[BB  ], x-1, y-1, z   ))),// FROM  8
                     lerp(v, lerp(u, grad(p[AA+1], x  , y  , z-1 ),  // CORNERS
                                     grad(p[BA+1], x-1, y  , z-1 )), // OF CUBE
                             lerp(u, grad(p[AB+1], x  , y-1, z-1 ),
                                     grad(p[BB+1], x-1, y-1, z-1 )))));
   }
   function fade(t) { return t * t * t * (t * (t * 6 - 15) + 10); }
   function lerp( t, a, b) { return a + t * (b - a); }
   function grad(hash, x, y, z) {
      var h = hash & 15;                      // CONVERT LO 4 BITS OF HASH CODE
      var u = h<8 ? x : y,                 // INTO 12 GRADIENT DIRECTIONS.
             v = h<4 ? y : h==12||h==14 ? x : z;
      return ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v);
   } 
   function scale(n) { return (1 + n)/2; }
}


================================================
FILE: Downsample/js/surfacenets.js
================================================
/**
 * SurfaceNets in JavaScript
 *
 * Written by Mikola Lysenko (C) 2012
 *
 * MIT License
 *
 * Based on: S.F. Gibson, "Constrained Elastic Surface Nets". (1998) MERL Tech Report.
 */
var SurfaceNets = (function() {
"use strict";

//Precompute edge table, like Paul Bourke does.
// This saves a bit of time when computing the centroid of each boundary cell
var cube_edges = new Int32Array(24)
  , edge_table = new Int32Array(256);
(function() {

  //Initialize the cube_edges table
  // This is just the vertex number of each cube
  var k = 0;
  for(var i=0; i<8; ++i) {
    for(var j=1; j<=4; j<<=1) {
      var p = i^j;
      if(i <= p) {
        cube_edges[k++] = i;
        cube_edges[k++] = p;
      }
    }
  }

  //Initialize the intersection table.
  //  This is a 2^(cube configuration) ->  2^(edge configuration) map
  //  There is one entry for each possible cube configuration, and the output is a 12-bit vector enumerating all edges crossing the 0-level.
  for(var i=0; i<256; ++i) {
    var em = 0;
    for(var j=0; j<24; j+=2) {
      var a = !!(i & (1<<cube_edges[j]))
        , b = !!(i & (1<<cube_edges[j+1]));
      em |= a !== b ? (1 << (j >> 1)) : 0;
    }
    edge_table[i] = em;
  }
})();

//Internal buffer, this may get resized at run time
var buffer = new Int32Array(4096);

return function(data, dims) {
  
  var vertices = []
    , faces = []
    , n = 0
    , x = new Int32Array(3)
    , R = new Int32Array([1, (dims[0]+1), (dims[0]+1)*(dims[0]+1)])
    , grid = new Float32Array(8)
    , buf_no = 1;
   
  //Resize buffer if necessary 
  if(R[2] * 2 > buffer.length) {
    buffer = new Int32Array(R[2] * 2);
  }
  
  //March over the voxel grid
  for(x[2]=0; x[2]<dims[2]-1; ++x[2], n+=dims[0], buf_no ^= 1, R[2]=-R[2]) {
  
    //m is the pointer into the buffer we are going to use.  
    //This is slightly obtuse because javascript does not have good support for packed data structures, so we must use typed arrays :(
    //The contents of the buffer will be the indices of the vertices on the previous x/y slice of the volume
    var m = 1 + (dims[0]+1) * (1 + buf_no * (dims[1]+1));
    
    for(x[1]=0; x[1]<dims[1]-1; ++x[1], ++n, m+=2)
    for(x[0]=0; x[0]<dims[0]-1; ++x[0], ++n, ++m) {
    
      //Read in 8 field values around this vertex and store them in an array
      //Also calculate 8-bit mask, like in marching cubes, so we can speed up sign checks later
      var mask = 0, g = 0, idx = n;
      for(var k=0; k<2; ++k, idx += dims[0]*(dims[1]-2))
      for(var j=0; j<2; ++j, idx += dims[0]-2)      
      for(var i=0; i<2; ++i, ++g, ++idx) {
        var p = data[idx];
        grid[g] = p;
        mask |= (p < 0) ? (1<<g) : 0;
      }
      
      //Check for early termination if cell does not intersect boundary
      if(mask === 0 || mask === 0xff) {
        continue;
      }
      
      //Sum up edge intersections
      var edge_mask = edge_table[mask]
        , v = [0.0,0.0,0.0]
        , e_count = 0;
        
      //For every edge of the cube...
      for(var i=0; i<12; ++i) {
      
        //Use edge mask to check if it is crossed
        if(!(edge_mask & (1<<i))) {
          continue;
        }
        
        //If it did, increment number of edge crossings
        ++e_count;
        
        //Now find the point of intersection
        var e0 = cube_edges[ i<<1 ]       //Unpack vertices
          , e1 = cube_edges[(i<<1)+1]
          , g0 = grid[e0]                 //Unpack grid values
          , g1 = grid[e1]
          , t  = g0 - g1;                 //Compute point of intersection
        if(Math.abs(t) > 1e-6) {
          t = g0 / t;
        } else {
          continue;
        }
        
        //Interpolate vertices and add up intersections (this can be done without multiplying)
        for(var j=0, k=1; j<3; ++j, k<<=1) {
          var a = e0 & k
            , b = e1 & k;
          if(a !== b) {
            v[j] += a ? 1.0 - t : t;
          } else {
            v[j] += a ? 1.0 : 0;
          }
        }
      }
      
      //Now we just average the edge intersections and add them to coordinate
      var s = 1.0 / e_count;
      for(var i=0; i<3; ++i) {
        v[i] = x[i] + s * v[i];
      }
      
      //Add vertex to buffer, store pointer to vertex index in buffer
      buffer[m] = vertices.length;
      vertices.push(v);
      
      //Now we need to add faces together, to do this we just loop over 3 basis components
      for(var i=0; i<3; ++i) {
        //The first three entries of the edge_mask count the crossings along the edge
        if(!(edge_mask & (1<<i)) ) {
          continue;
        }
        
        // i = axes we are point along.  iu, iv = orthogonal axes
        var iu = (i+1)%3
          , iv = (i+2)%3;
          
        //If we are on a boundary, skip it
        if(x[iu] === 0 || x[iv] === 0) {
          continue;
        }
        
        //Otherwise, look up adjacent edges in buffer
        var du = R[iu]
          , dv = R[iv];
        
        //Remember to flip orientation depending on the sign of the corner.
        if(mask & 1) {
          faces.push([buffer[m], buffer[m-du], buffer[m-du-dv], buffer[m-dv]]);
        } else {
          faces.push([buffer[m], buffer[m-dv], buffer[m-du-dv], buffer[m-du]]);
        }
      }
    }
  }
  
  //All done!  Return the result
  return { vertices: vertices, faces: faces };
};
})();


================================================
FILE: Downsample/js/testdata.js
================================================
function createTestData() {
  var result = {};
  
  function triangle_wave(t) {
    var it = Math.floor(t);
    if(!!(it & 1)) {
      return t - it;
    }
    return 1 - (t-it);
  }
  
  function memoize(f) {
    var cached = null;
    return function() {
      if(cached === null) { 
        cached = f();
      }
      return cached;
    }
  }
  
  function makeVolume(dims, f) {
    return memoize(function() {
      var res = new Array(3);
      for(var i=0; i<3; ++i) {
        res[i] = 2 + Math.ceil((dims[i][1] - dims[i][0]) / dims[i][2]);
      }
      var volume = new Float32Array(res[0] * res[1] * res[2])
        , n = 0;
      for(var k=0, z=dims[2][0]-dims[2][2]; k<res[2]; ++k, z+=dims[2][2])
      for(var j=0, y=dims[1][0]-dims[1][2]; j<res[1]; ++j, y+=dims[1][2])
      for(var i=0, x=dims[0][0]-dims[0][2]; i<res[0]; ++i, x+=dims[0][2], ++n) {
        volume[n] = f(x,y,z);
      }
      return {volume: volume, dims:res};
    });
  } 

  result['Sphere'] = makeVolume(
    [[-1.55, 1.55, 0.05],
     [-1.55, 1.55, 0.05],
     [-1.55, 1.55, 0.05]],
    function(x,y,z) {
      var r = Math.sqrt(x*x + y*y + z*z);
      return r - 0.64;
    }
  )

  result['Torus'] = makeVolume(
    [[-2.2, 2.2, 4.4 / 62.0],
     [-2.2, 2.2, 4.4 / 62.0],
     [-1.4, 1.4, 4.4 / 62.0]],
    function(x,y,z) {
      return Math.pow(1.0 - Math.sqrt(x*x + y*y), 2) + z*z - 0.25;
    }
  );
  
  result['Hyperboloid'] = makeVolume(
    [[-2.1, 2.1, 4.2/94.0],
     [-2.1, 2.1, 4.2/94.0],
     [-2.1, 2.1, 4.2/94.0]],
    function(x,y,z) {
      return Math.max(-1.4-z, Math.max(z-1.4,x*x + y*y - z*z - 0.1));
    }
  );
  
  result['Paraboloid'] = makeVolume(
    [[-2.1, 2.1, 4.2/94.0],
     [-2.1, 2.1, 4.2/94.0],
     [-0.5, 2.5, 3.0/62.0]],
    function(x,y,z) {
      return Math.max(z-1.75, x*x + y*y - z);
    }
  )
  
  result['Saddle'] = makeVolume(
    [[-2.0, 2.0, 4.0/94.0],
     [-2.0, 2.0, 4.0/94.0],
     [-2.0, 2.0, 4.0/94.0]],
    function(x,y,z) {
      return x*x - y*y - z;
    }
  )
  

  
  
  result['Hyperelliptic'] = makeVolume(
    [[-2.0, 2.0, 4.0/62.0],
     [-2.0, 2.0, 4.0/62.0],
     [-2.0, 2.0, 4.0/62.0]],
    function(x,y,z) {
      return Math.pow( Math.pow(x, 6) + Math.pow(y, 6) + Math.pow(z, 6), 1.0/6.0 ) - 1.0;
    }  
  );
  
  result['Thin Plates'] = makeVolume(
    [[1, 63, 1],
     [1, 63, 1],
     [1, 63, 1]],
    function(x,y,z) {
      var t = 7.0 * triangle_wave(x / 7.0) - 0.5;
      if( x < 10 ) {
        t = Math.max(t, 10-x);
      }
      if( y < 10 ) {
        t = Math.max(t, 10-y);
      }
      if( z < 10 )  {
        t = Math.max(t, 10-z);
      }
      if( x > 54 ) {
        t = Math.max(t, x - 54);
      }
      if( y > 54 ) {
        t = Math.max(t, y - 54);
      }
      if( z > 54 ) {
        t = Math.max(t, z - 54);
      }
      return t;
    }
  );
  
  
  result["Goursat's Surface"] = makeVolume(
    [[-3.0, 3.0, 6.0/62.0],
     [-3.0, 3.0, 6.0/62.0],
     [-3.0, 3.0, 6.0/62.0]],
    function(x,y,z) {
      return Math.pow(x,4) + Math.pow(y,4) + Math.pow(z,4) - 1.5 * (x*x  + y*y + z*z) + 1;
    }
  );
  
  result["Heart"] = makeVolume(
    [[-2.0, 2.0, 4.0/62.0],
     [-2.0, 2.0, 4.0/62.0],
     [-2.0, 2.0, 4.0/62.0]],
    function(x,y,z) {
      y *= 1.5;
      z *= 1.5;
      return Math.pow(2*x*x+y*y+2*z*z-1, 3) - 0.1 * z*z*y*y*y - y*y*y*x*x;
    }
  );
  
  result['Noise (Slow)'] = makeVolume(
    [[-2.0, 2.0, 4.0/126.0],
     [-2.0, 2.0, 4.0/126.0],
     [-2.0, 2.0, 4.0/126.0]], 
    function(x,y,z) {
      if(x < -1.0 || x > 1.0 ||
         y < -1.0 || y > 1.0 ||
         z < -1.0 || z > 1.0 ) {
        return 0.6;   
      }
      return 0.6 - PerlinNoise.noise(4.0 * x, 4.0 * y, 4.0 * z);
    }
  );
    
  result['Asteroid (Slow)'] = makeVolume(
    [[-1.5, 1.5, 3.0/94.0],
     [-1.5, 1.5, 3.0/94.0],
     [-1.5, 1.5, 3.0/94.0]],
    function(x,y,z) {
      return (x*x + y*y + z*z) - PerlinNoise.noise(x*2,y*2,z*2);
    }
  );
  
  result['Terrain (Slow)'] = makeVolume(
    [[-1, 1, 1.0/62.0],
     [-1, 1, 1.0/62.0],
     [-1, 1, 1.0/62.0]],
    function(x,y,z) {
      return  y + PerlinNoise.noise(x*2+5,y*2+3,z*2+0.6);
    }
  );
  
  
  result['Empty'] = function(){ return { volume: new Float32Array(32*32*32), dims:[32,32,32] } };
  
  return result;
}


================================================
FILE: Downsample/vendor/dsp.js
================================================
/* 
 *  DSP.js - a comprehensive digital signal processing  library for javascript
 * 
 *  Created by Corban Brook <corbanbrook@gmail.com> on 2010-01-01.
 *  Copyright 2010 Corban Brook. All rights reserved.
 *
 */

////////////////////////////////////////////////////////////////////////////////
//                                  CONSTANTS                                 //
////////////////////////////////////////////////////////////////////////////////

/**
 * DSP is an object which contains general purpose utility functions and constants
 */
var DSP = {
  // Channels
  LEFT:           0,
  RIGHT:          1,
  MIX:            2,

  // Waveforms
  SINE:           1,
  TRIANGLE:       2,
  SAW:            3,
  SQUARE:         4,

  // Filters
  LOWPASS:        0,
  HIGHPASS:       1,
  BANDPASS:       2,
  NOTCH:          3,

  // Window functions
  BARTLETT:       1,
  BARTLETTHANN:   2,
  BLACKMAN:       3,
  COSINE:         4,
  GAUSS:          5,
  HAMMING:        6,
  HANN:           7,
  LANCZOS:        8,
  RECTANGULAR:    9,
  TRIANGULAR:     10,

  // Loop modes
  OFF:            0,
  FW:             1,
  BW:             2,
  FWBW:           3,

  // Math
  TWO_PI:         2*Math.PI
};

// Setup arrays for platforms which do not support byte arrays
function setupTypedArray(name, fallback) {
  // check if TypedArray exists
  // typeof on Minefield and Chrome return function, typeof on Webkit returns object.
  if (typeof this[name] !== "function" && typeof this[name] !== "object") {
    // nope.. check if WebGLArray exists
    if (typeof this[fallback] === "function" && typeof this[fallback] !== "object") {
      this[name] = this[fallback];
    } else {
      // nope.. set as Native JS array
      this[name] = function(obj) {
        if (obj instanceof Array) {
          return obj;
        } else if (typeof obj === "number") {
          return new Array(obj);
        }
      };
    }
  }
}

setupTypedArray("Float32Array", "WebGLFloatArray");
setupTypedArray("Int32Array",   "WebGLIntArray");
setupTypedArray("Uint16Array",  "WebGLUnsignedShortArray");
setupTypedArray("Uint8Array",   "WebGLUnsignedByteArray");


////////////////////////////////////////////////////////////////////////////////
//                            DSP UTILITY FUNCTIONS                           //
////////////////////////////////////////////////////////////////////////////////

/**
 * Inverts the phase of a signal
 *
 * @param {Array} buffer A sample buffer
 *
 * @returns The inverted sample buffer
 */
DSP.invert = function(buffer) {
  for (var i = 0, len = buffer.length; i < len; i++) {
    buffer[i] *= -1;
  }

  return buffer;
};

/**
 * Converts split-stereo (dual mono) sample buffers into a stereo interleaved sample buffer
 *
 * @param {Array} left  A sample buffer
 * @param {Array} right A sample buffer
 *
 * @returns The stereo interleaved buffer
 */
DSP.interleave = function(left, right) {
  if (left.length !== right.length) {
    throw "Can not interleave. Channel lengths differ.";
  }
 
  var stereoInterleaved = new Float32Array(left.length * 2);
 
  for (var i = 0, len = left.length; i < len; i++) {
    stereoInterleaved[2*i]   = left[i];
    stereoInterleaved[2*i+1] = right[i];
  }
 
  return stereoInterleaved;
};

/**
 * Converts a stereo-interleaved sample buffer into split-stereo (dual mono) sample buffers
 *
 * @param {Array} buffer A stereo-interleaved sample buffer
 *
 * @returns an Array containing left and right channels
 */
DSP.deinterleave = (function() {
  var left, right, mix, deinterleaveChannel = []; 

  deinterleaveChannel[DSP.MIX] = function(buffer) {
    for (var i = 0, len = buffer.length/2; i < len; i++) {
      mix[i] = (buffer[2*i] + buffer[2*i+1]) / 2;
    }
    return mix;
  };

  deinterleaveChannel[DSP.LEFT] = function(buffer) {
    for (var i = 0, len = buffer.length/2; i < len; i++) {
      left[i]  = buffer[2*i];
    }
    return left;
  };

  deinterleaveChannel[DSP.RIGHT] = function(buffer) {
    for (var i = 0, len = buffer.length/2; i < len; i++) {
      right[i]  = buffer[2*i+1];
    }
    return right;
  };

  return function(channel, buffer) { 
    left  = left  || new Float32Array(buffer.length/2);
    right = right || new Float32Array(buffer.length/2);
    mix   = mix   || new Float32Array(buffer.length/2);

    if (buffer.length/2 !== left.length) {
      left  = new Float32Array(buffer.length/2);
      right = new Float32Array(buffer.length/2);
      mix   = new Float32Array(buffer.length/2);
    }

    return deinterleaveChannel[channel](buffer);
  };
}());

/**
 * Separates a channel from a stereo-interleaved sample buffer
 *
 * @param {Array}  buffer A stereo-interleaved sample buffer
 * @param {Number} channel A channel constant (LEFT, RIGHT, MIX)
 *
 * @returns an Array containing a signal mono sample buffer
 */
DSP.getChannel = DSP.deinterleave;

/**
 * Helper method (for Reverb) to mix two (interleaved) samplebuffers. It's possible
 * to negate the second buffer while mixing and to perform a volume correction
 * on the final signal.
 *
 * @param {Array} sampleBuffer1 Array containing Float values or a Float32Array
 * @param {Array} sampleBuffer2 Array containing Float values or a Float32Array
 * @param {Boolean} negate When true inverts/flips the audio signal
 * @param {Number} volumeCorrection When you add multiple sample buffers, use this to tame your signal ;)
 *
 * @returns A new Float32Array interleaved buffer.
 */
DSP.mixSampleBuffers = function(sampleBuffer1, sampleBuffer2, negate, volumeCorrection){
  var outputSamples = new Float32Array(sampleBuffer1);

  for(var i = 0; i<sampleBuffer1.length; i++){
    outputSamples[i] += (negate ? -sampleBuffer2[i] : sampleBuffer2[i]) / volumeCorrection;
  }
 
  return outputSamples;
}; 

// Biquad filter types
DSP.LPF = 0;                // H(s) = 1 / (s^2 + s/Q + 1)
DSP.HPF = 1;                // H(s) = s^2 / (s^2 + s/Q + 1)
DSP.BPF_CONSTANT_SKIRT = 2; // H(s) = s / (s^2 + s/Q + 1)  (constant skirt gain, peak gain = Q)
DSP.BPF_CONSTANT_PEAK = 3;  // H(s) = (s/Q) / (s^2 + s/Q + 1)      (constant 0 dB peak gain)
DSP.NOTCH = 4;              // H(s) = (s^2 + 1) / (s^2 + s/Q + 1)
DSP.APF = 5;                // H(s) = (s^2 - s/Q + 1) / (s^2 + s/Q + 1)
DSP.PEAKING_EQ = 6;         // H(s) = (s^2 + s*(A/Q) + 1) / (s^2 + s/(A*Q) + 1)
DSP.LOW_SHELF = 7;          // H(s) = A * (s^2 + (sqrt(A)/Q)*s + A)/(A*s^2 + (sqrt(A)/Q)*s + 1)
DSP.HIGH_SHELF = 8;         // H(s) = A * (A*s^2 + (sqrt(A)/Q)*s + 1)/(s^2 + (sqrt(A)/Q)*s + A)

// Biquad filter parameter types
DSP.Q = 1;
DSP.BW = 2; // SHARED with BACKWARDS LOOP MODE
DSP.S = 3;

// Find RMS of signal
DSP.RMS = function(buffer) {
  var total = 0;
  
  for (var i = 0, n = buffer.length; i < n; i++) {
    total += buffer[i] * buffer[i];
  }
  
  return Math.sqrt(total / n);
};

// Find Peak of signal
DSP.Peak = function(buffer) {
  var peak = 0;
  
  for (var i = 0, n = buffer.length; i < n; i++) {
    peak = (Math.abs(buffer[i]) > peak) ? Math.abs(buffer[i]) : peak; 
  }
  
  return peak;
};

// Fourier Transform Module used by DFT, FFT, RFFT
function FourierTransform(bufferSize, sampleRate) {
  this.bufferSize = bufferSize;
  this.sampleRate = sampleRate;
  this.bandwidth  = 2 / bufferSize * sampleRate / 2;

  this.spectrum   = new Float32Array(bufferSize/2);
  this.real       = new Float32Array(bufferSize);
  this.imag       = new Float32Array(bufferSize);

  this.peakBand   = 0;
  this.peak       = 0;

  /**
   * Calculates the *middle* frequency of an FFT band.
   *
   * @param {Number} index The index of the FFT band.
   *
   * @returns The middle frequency in Hz.
   */
  this.getBandFrequency = function(index) {
    return this.bandwidth * index + this.bandwidth / 2;
  };

  this.calculateSpectrum = function() {
    var spectrum  = this.spectrum,
        real      = this.real,
        imag      = this.imag,
        bSi       = 2 / this.bufferSize,
        sqrt      = Math.sqrt,
        rval, 
        ival,
        mag;

    for (var i = 0, N = bufferSize/2; i < N; i++) {
      rval = real[i];
      ival = imag[i];
      mag = bSi * sqrt(rval * rval + ival * ival);

      if (mag > this.peak) {
        this.peakBand = i;
        this.peak = mag;
      }

      spectrum[i] = mag;
    }
  };
}

/**
 * DFT is a class for calculating the Discrete Fourier Transform of a signal.
 *
 * @param {Number} bufferSize The size of the sample buffer to be computed
 * @param {Number} sampleRate The sampleRate of the buffer (eg. 44100)
 *
 * @constructor
 */
function DFT(bufferSize, sampleRate) {
  FourierTransform.call(this, bufferSize, sampleRate);

  var N = bufferSize/2 * bufferSize;
  var TWO_PI = 2 * Math.PI;

  this.sinTable = new Float32Array(N);
  this.cosTable = new Float32Array(N);

  for (var i = 0; i < N; i++) {
    this.sinTable[i] = Math.sin(i * TWO_PI / bufferSize);
    this.cosTable[i] = Math.cos(i * TWO_PI / bufferSize);
  }
}

/**
 * Performs a forward transform on the sample buffer.
 * Converts a time domain signal to frequency domain spectra.
 *
 * @param {Array} buffer The sample buffer
 *
 * @returns The frequency spectrum array
 */
DFT.prototype.forward = function(buffer) {
  var real = this.real, 
      imag = this.imag,
      rval,
      ival;

  for (var k = 0; k < this.bufferSize/2; k++) {
    rval = 0.0;
    ival = 0.0;

    for (var n = 0; n < buffer.length; n++) {
      rval += this.cosTable[k*n] * buffer[n];
      ival += this.sinTable[k*n] * buffer[n];
    }

    real[k] = rval;
    imag[k] = ival;
  }

  return this.calculateSpectrum();
};


/**
 * FFT is a class for calculating the Discrete Fourier Transform of a signal
 * with the Fast Fourier Transform algorithm.
 *
 * @param {Number} bufferSize The size of the sample buffer to be computed. Must be power of 2
 * @param {Number} sampleRate The sampleRate of the buffer (eg. 44100)
 *
 * @constructor
 */
function FFT(bufferSize, sampleRate) {
  FourierTransform.call(this, bufferSize, sampleRate);
   
  this.reverseTable = new Uint32Array(bufferSize);

  var limit = 1;
  var bit = bufferSize >> 1;

  var i;

  while (limit < bufferSize) {
    for (i = 0; i < limit; i++) {
      this.reverseTable[i + limit] = this.reverseTable[i] + bit;
    }

    limit = limit << 1;
    bit = bit >> 1;
  }

  this.sinTable = new Float32Array(bufferSize);
  this.cosTable = new Float32Array(bufferSize);

  for (i = 0; i < bufferSize; i++) {
    this.sinTable[i] = Math.sin(-Math.PI/i);
    this.cosTable[i] = Math.cos(-Math.PI/i);
  }
}

/**
 * Performs a forward transform on the sample buffer.
 * Converts a time domain signal to frequency domain spectra.
 *
 * @param {Array} buffer The sample buffer. Buffer Length must be power of 2
 *
 * @returns The frequency spectrum array
 */
FFT.prototype.forward = function(buffer) {
  // Locally scope variables for speed up
  var bufferSize      = this.bufferSize,
      cosTable        = this.cosTable,
      sinTable        = this.sinTable,
      reverseTable    = this.reverseTable,
      real            = this.real,
      imag            = this.imag,
      spectrum        = this.spectrum;

  var k = Math.floor(Math.log(bufferSize) / Math.LN2);

  if (Math.pow(2, k) !== bufferSize) { throw "Invalid buffer size, must be a power of 2."; }
  if (bufferSize !== buffer.length)  { throw "Supplied buffer is not the same size as defined FFT. FFT Size: " + bufferSize + " Buffer Size: " + buffer.length; }

  var halfSize = 1,
      phaseShiftStepReal,
      phaseShiftStepImag,
      currentPhaseShiftReal,
      currentPhaseShiftImag,
      off,
      tr,
      ti,
      tmpReal,
      i;

  for (i = 0; i < bufferSize; i++) {
    real[i] = buffer[reverseTable[i]];
    imag[i] = 0;
  }

  while (halfSize < bufferSize) {
    //phaseShiftStepReal = Math.cos(-Math.PI/halfSize);
    //phaseShiftStepImag = Math.sin(-Math.PI/halfSize);
    phaseShiftStepReal = cosTable[halfSize];
    phaseShiftStepImag = sinTable[halfSize];
    
    currentPhaseShiftReal = 1;
    currentPhaseShiftImag = 0;

    for (var fftStep = 0; fftStep < halfSize; fftStep++) {
      i = fftStep;

      while (i < bufferSize) {
        off = i + halfSize;
        tr = (currentPhaseShiftReal * real[off]) - (currentPhaseShiftImag * imag[off]);
        ti = (currentPhaseShiftReal * imag[off]) + (currentPhaseShiftImag * real[off]);

        real[off] = real[i] - tr;
        imag[off] = imag[i] - ti;
        real[i] += tr;
        imag[i] += ti;

        i += halfSize << 1;
      }

      tmpReal = currentPhaseShiftReal;
      currentPhaseShiftReal = (tmpReal * phaseShiftStepReal) - (currentPhaseShiftImag * phaseShiftStepImag);
      currentPhaseShiftImag = (tmpReal * phaseShiftStepImag) + (currentPhaseShiftImag * phaseShiftStepReal);
    }

    halfSize = halfSize << 1;
  }

  return this.calculateSpectrum();
};

FFT.prototype.inverse = function(real, imag) {
  // Locally scope variables for speed up
  var bufferSize      = this.bufferSize,
      cosTable        = this.cosTable,
      sinTable        = this.sinTable,
      reverseTable    = this.reverseTable,
      spectrum        = this.spectrum;
     
      real = real || this.real;
      imag = imag || this.imag;

  var halfSize = 1,
      phaseShiftStepReal,
      phaseShiftStepImag,
      currentPhaseShiftReal,
      currentPhaseShiftImag,
      off,
      tr,
      ti,
      tmpReal,
      i;

  for (i = 0; i < bufferSize; i++) {
    imag[i] *= -1;
  }

  var revReal = new Float32Array(bufferSize);
  var revImag = new Float32Array(bufferSize);
 
  for (i = 0; i < real.length; i++) {
    revReal[i] = real[reverseTable[i]];
    revImag[i] = imag[reverseTable[i]];
  }
 
  real = revReal;
  imag = revImag;

  while (halfSize < bufferSize) {
    phaseShiftStepReal = cosTable[halfSize];
    phaseShiftStepImag = sinTable[halfSize];
    currentPhaseShiftReal = 1;
    currentPhaseShiftImag = 0;

    for (var fftStep = 0; fftStep < halfSize; fftStep++) {
      i = fftStep;

      while (i < bufferSize) {
        off = i + halfSize;
        tr = (currentPhaseShiftReal * real[off]) - (currentPhaseShiftImag * imag[off]);
        ti = (currentPhaseShiftReal * imag[off]) + (currentPhaseShiftImag * real[off]);

        real[off] = real[i] - tr;
        imag[off] = imag[i] - ti;
        real[i] += tr;
        imag[i] += ti;

        i += halfSize << 1;
      }

      tmpReal = currentPhaseShiftReal;
      currentPhaseShiftReal = (tmpReal * phaseShiftStepReal) - (currentPhaseShiftImag * phaseShiftStepImag);
      currentPhaseShiftImag = (tmpReal * phaseShiftStepImag) + (currentPhaseShiftImag * phaseShiftStepReal);
    }

    halfSize = halfSize << 1;
  }

  var buffer = new Float32Array(bufferSize); // this should be reused instead
  for (i = 0; i < bufferSize; i++) {
    buffer[i] = real[i] / bufferSize;
  }

  return buffer;
};

/**
 * RFFT is a class for calculating the Discrete Fourier Transform of a signal
 * with the Fast Fourier Transform algorithm.
 *
 * This method currently only contains a forward transform but is highly optimized.
 *
 * @param {Number} bufferSize The size of the sample buffer to be computed. Must be power of 2
 * @param {Number} sampleRate The sampleRate of the buffer (eg. 44100)
 *
 * @constructor
 */

// lookup tables don't really gain us any speed, but they do increase
// cache footprint, so don't use them in here

// also we don't use sepearate arrays for real/imaginary parts

// this one a little more than twice as fast as the one in FFT
// however I only did the forward transform

// the rest of this was translated from C, see http://www.jjj.de/fxt/
// this is the real split radix FFT

function RFFT(bufferSize, sampleRate) {
  FourierTransform.call(this, bufferSize, sampleRate);

  this.trans = new Float32Array(bufferSize);

  this.reverseTable = new Uint32Array(bufferSize);

  // don't use a lookup table to do the permute, use this instead
  this.reverseBinPermute = function (dest, source) {
    var bufferSize  = this.bufferSize, 
        halfSize    = bufferSize >>> 1, 
        nm1         = bufferSize - 1, 
        i = 1, r = 0, h;

    dest[0] = source[0];

    do {
      r += halfSize;
      dest[i] = source[r];
      dest[r] = source[i];
      
      i++;

      h = halfSize << 1;
      while (h = h >> 1, !((r ^= h) & h));

      if (r >= i) { 
        dest[i]     = source[r]; 
        dest[r]     = source[i];

        dest[nm1-i] = source[nm1-r]; 
        dest[nm1-r] = source[nm1-i];
      }
      i++;
    } while (i < halfSize);
    dest[nm1] = source[nm1];
  };

  this.generateReverseTable = function () {
    var bufferSize  = this.bufferSize, 
        halfSize    = bufferSize >>> 1, 
        nm1         = bufferSize - 1, 
        i = 1, r = 0, h;

    this.reverseTable[0] = 0;

    do {
      r += halfSize;
      
      this.reverseTable[i] = r;
      this.reverseTable[r] = i;

      i++;

      h = halfSize << 1;
      while (h = h >> 1, !((r ^= h) & h));

      if (r >= i) { 
        this.reverseTable[i] = r;
        this.reverseTable[r] = i;

        this.reverseTable[nm1-i] = nm1-r;
        this.reverseTable[nm1-r] = nm1-i;
      }
      i++;
    } while (i < halfSize);

    this.reverseTable[nm1] = nm1;
  };

  this.generateReverseTable();
}


// Ordering of output:
//
// trans[0]     = re[0] (==zero frequency, purely real)
// trans[1]     = re[1]
//             ...
// trans[n/2-1] = re[n/2-1]
// trans[n/2]   = re[n/2]    (==nyquist frequency, purely real)
//
// trans[n/2+1] = im[n/2-1]
// trans[n/2+2] = im[n/2-2]
//             ...
// trans[n-1]   = im[1] 

RFFT.prototype.forward = function(buffer) {
  var n         = this.bufferSize, 
      spectrum  = this.spectrum,
      x         = this.trans, 
      TWO_PI    = 2*Math.PI,
      sqrt      = Math.sqrt,
      i         = n >>> 1,
      bSi       = 2 / n,
      n2, n4, n8, nn, 
      t1, t2, t3, t4, 
      i1, i2, i3, i4, i5, i6, i7, i8, 
      st1, cc1, ss1, cc3, ss3,
      e, 
      a,
      rval, ival, mag; 

  this.reverseBinPermute(x, buffer);

  /*
  var reverseTable = this.reverseTable;

  for (var k = 0, len = reverseTable.length; k < len; k++) {
    x[k] = buffer[reverseTable[k]];
  }
  */

  for (var ix = 0, id = 4; ix < n; id *= 4) {
    for (var i0 = ix; i0 < n; i0 += id) {
      //sumdiff(x[i0], x[i0+1]); // {a, b}  <--| {a+b, a-b}
      st1 = x[i0] - x[i0+1];
      x[i0] += x[i0+1];
      x[i0+1] = st1;
    } 
    ix = 2*(id-1);
  }

  n2 = 2;
  nn = n >>> 1;

  while((nn = nn >>> 1)) {
    ix = 0;
    n2 = n2 << 1;
    id = n2 << 1;
    n4 = n2 >>> 2;
    n8 = n2 >>> 3;
    do {
      if(n4 !== 1) {
        for(i0 = ix; i0 < n; i0 += id) {
          i1 = i0;
          i2 = i1 + n4;
          i3 = i2 + n4;
          i4 = i3 + n4;
     
          //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}
          t1 = x[i3] + x[i4];
          x[i4] -= x[i3];
          //sumdiff3(x[i1], t1, x[i3]);   // {a, b, d} <--| {a+b, b, a-b}
          x[i3] = x[i1] - t1; 
          x[i1] += t1;
     
          i1 += n8;
          i2 += n8;
          i3 += n8;
          i4 += n8;
         
          //sumdiff(x[i3], x[i4], t1, t2); // {s, d}  <--| {a+b, a-b}
          t1 = x[i3] + x[i4];
          t2 = x[i3] - x[i4];
         
          t1 = -t1 * Math.SQRT1_2;
          t2 *= Math.SQRT1_2;
     
          // sumdiff(t1, x[i2], x[i4], x[i3]); // {s, d}  <--| {a+b, a-b}
          st1 = x[i2];
          x[i4] = t1 + st1; 
          x[i3] = t1 - st1;
          
          //sumdiff3(x[i1], t2, x[i2]); // {a, b, d} <--| {a+b, b, a-b}
          x[i2] = x[i1] - t2;
          x[i1] += t2;
        }
      } else {
        for(i0 = ix; i0 < n; i0 += id) {
          i1 = i0;
          i2 = i1 + n4;
          i3 = i2 + n4;
          i4 = i3 + n4;
     
          //diffsum3_r(x[i3], x[i4], t1); // {a, b, s} <--| {a, b-a, a+b}
          t1 = x[i3] + x[i4]; 
          x[i4] -= x[i3];
          
          //sumdiff3(x[i1], t1, x[i3]);   // {a, b, d} <--| {a+b, b, a-b}
          x[i3] = x[i1] - t1; 
          x[i1] += t1;
        }
      }
   
      ix = (id << 1) - n2;
      id = id << 2;
    } while (ix < n);
 
    e = TWO_PI / n2;

    for (var j = 1; j < n8; j++) {
      a = j * e;
      ss1 = Math.sin(a);
      cc1 = Math.cos(a);

      //ss3 = sin(3*a); cc3 = cos(3*a);
      cc3 = 4*cc1*(cc1*cc1-0.75);
      ss3 = 4*ss1*(0.75-ss1*ss1);
   
      ix = 0; id = n2 << 1;
      do {
        for (i0 = ix; i0 < n; i0 += id) {
          i1 = i0 + j;
          i2 = i1 + n4;
          i3 = i2 + n4;
          i4 = i3 + n4;
       
          i5 = i0 + n4 - j;
          i6 = i5 + n4;
          i7 = i6 + n4;
          i8 = i7 + n4;
       
          //cmult(c, s, x, y, &u, &v)
          //cmult(cc1, ss1, x[i7], x[i3], t2, t1); // {u,v} <--| {x*c-y*s, x*s+y*c}
          t2 = x[i7]*cc1 - x[i3]*ss1; 
          t1 = x[i7]*ss1 + x[i3]*cc1;
          
          //cmult(cc3, ss3, x[i8], x[i4], t4, t3);
          t4 = x[i8]*cc3 - x[i4]*ss3; 
          t3 = x[i8]*ss3 + x[i4]*cc3;
       
          //sumdiff(t2, t4);   // {a, b} <--| {a+b, a-b}
          st1 = t2 - t4;
          t2 += t4;
          t4 = st1;
          
          //sumdiff(t2, x[i6], x[i8], x[i3]); // {s, d}  <--| {a+b, a-b}
          //st1 = x[i6]; x[i8] = t2 + st1; x[i3] = t2 - st1;
          x[i8] = t2 + x[i6]; 
          x[i3] = t2 - x[i6];
         
          //sumdiff_r(t1, t3); // {a, b} <--| {a+b, b-a}
          st1 = t3 - t1;
          t1 += t3;
          t3 = st1;
          
          //sumdiff(t3, x[i2], x[i4], x[i7]); // {s, d}  <--| {a+b, a-b}
          //st1 = x[i2]; x[i4] = t3 + st1; x[i7] = t3 - st1;
          x[i4] = t3 + x[i2]; 
          x[i7] = t3 - x[i2];
         
          //sumdiff3(x[i1], t1, x[i6]);   // {a, b, d} <--| {a+b, b, a-b}
          x[i6] = x[i1] - t1; 
          x[i1] += t1;
          
          //diffsum3_r(t4, x[i5], x[i2]); // {a, b, s} <--| {a, b-a, a+b}
          x[i2] = t4 + x[i5]; 
          x[i5] -= t4;
        }
     
        ix = (id << 1) - n2;
        id = id << 2;
   
      } while (ix < n);
    }
  }

  while (--i) {
    rval = x[i];
    ival = x[n-i-1];
    mag = bSi * sqrt(rval * rval + ival * ival);

    if (mag > this.peak) {
      this.peakBand = i;
      this.peak = mag;
    }

    spectrum[i] = mag;
  }

  spectrum[0] = bSi * x[0];

  return spectrum;
};

function Sampler(file, bufferSize, sampleRate, playStart, playEnd, loopStart, loopEnd, loopMode) {
  this.file = file;
  this.bufferSize = bufferSize;
  this.sampleRate = sampleRate;
  this.playStart  = playStart || 0; // 0%
  this.playEnd    = playEnd   || 1; // 100%
  this.loopStart  = loopStart || 0;
  this.loopEnd    = loopEnd   || 1;
  this.loopMode   = loopMode  || DSP.OFF;
  this.loaded     = false;
  this.samples    = [];
  this.signal     = new Float32Array(bufferSize);
  this.frameCount = 0;
  this.envelope   = null;
  this.amplitude  = 1;
  this.rootFrequency = 110; // A2 110
  this.frequency  = 550;
  this.step       = this.frequency / this.rootFrequency;
  this.duration   = 0;
  this.samplesProcessed = 0;
  this.playhead   = 0;
 
  var audio = /* new Audio();*/ document.createElement("AUDIO");
  var self = this;
 
  this.loadSamples = function(event) {
    var buffer = DSP.getChannel(DSP.MIX, event.frameBuffer);
    for ( var i = 0; i < buffer.length; i++) {
      self.samples.push(buffer[i]);
    }
  };
 
  this.loadComplete = function() {
    // convert flexible js array into a fast typed array
    self.samples = new Float32Array(self.samples);
    self.loaded = true;
  };
 
  this.loadMetaData = function() {
    self.duration = audio.duration;
  };
 
  audio.addEventListener("MozAudioAvailable", this.loadSamples, false);
  audio.addEventListener("loadedmetadata", this.loadMetaData, false);
  audio.addEventListener("ended", this.loadComplete, false);
  audio.muted = true;
  audio.src = file;
  audio.play();
}

Sampler.prototype.applyEnvelope = function() {
  this.envelope.process(this.signal);
  return this.signal;
};

Sampler.prototype.generate = function() {
  var frameOffset = this.frameCount * this.bufferSize;
 
  var loopWidth = this.playEnd * this.samples.length - this.playStart * this.samples.length;
  var playStartSamples = this.playStart * this.samples.length; // ie 0.5 -> 50% of the length
  var playEndSamples = this.playEnd * this.samples.length; // ie 0.5 -> 50% of the length
  var offset;

  for ( var i = 0; i < this.bufferSize; i++ ) {
    switch (this.loopMode) {
      case DSP.OFF:
        this.playhead = Math.round(this.samplesProcessed * this.step + playStartSamples);
        if (this.playhead < (this.playEnd * this.samples.length) ) {
          this.signal[i] = this.samples[this.playhead] * this.amplitude;
        } else {
          this.signal[i] = 0;
        }
        break;
     
      case DSP.FW:
        this.playhead = Math.round((this.samplesProcessed * this.step) % loopWidth + playStartSamples);
        if (this.playhead < (this.playEnd * this.samples.length) ) {
          this.signal[i] = this.samples[this.playhead] * this.amplitude;
        }
        break;
       
      case DSP.BW:
        this.playhead = playEndSamples - Math.round((this.samplesProcessed * this.step) % loopWidth);
        if (this.playhead < (this.playEnd * this.samples.length) ) {
          this.signal[i] = this.samples[this.playhead] * this.amplitude;
        }
        break;
       
      case DSP.FWBW:
        if ( Math.floor(this.samplesProcessed * this.step / loopWidth) % 2 === 0 ) {
          this.playhead = Math.round((this.samplesProcessed * this.step) % loopWidth + playStartSamples);
        } else {
          this.playhead = playEndSamples - Math.round((this.samplesProcessed * this.step) % loopWidth);
        }  
        if (this.playhead < (this.playEnd * this.samples.length) ) {
          this.signal[i] = this.samples[this.playhead] * this.amplitude;
        }
        break;
    }
    this.samplesProcessed++;
  }

  this.frameCount++;

  return this.signal;
};

Sampler.prototype.setFreq = function(frequency) {
    var totalProcessed = this.samplesProcessed * this.step;
    this.frequency = frequency;
    this.step = this.frequency / this.rootFrequency;
    this.samplesProcessed = Math.round(totalProcessed/this.step);
};

Sampler.prototype.reset = function() {
  this.samplesProcessed = 0;
  this.playhead = 0;
};

/**
 * Oscillator class for generating and modifying signals
 *
 * @param {Number} type       A waveform constant (eg. DSP.SINE)
 * @param {Number} frequency  Initial frequency of the signal
 * @param {Number} amplitude  Initial amplitude of the signal
 * @param {Number} bufferSize Size of the sample buffer to generate
 * @param {Number} sampleRate The sample rate of the signal
 *
 * @contructor
 */
function Oscillator(type, frequency, amplitude, bufferSize, sampleRate) {
  this.frequency  = frequency;
  this.amplitude  = amplitude;
  this.bufferSize = bufferSize;
  this.sampleRate = sampleRate;
  //this.pulseWidth = pulseWidth;
  this.frameCount = 0;
 
  this.waveTableLength = 2048;

  this.cyclesPerSample = frequency / sampleRate;

  this.signal = new Float32Array(bufferSize);
  this.envelope = null;

  switch(parseInt(type, 10)) {
    case DSP.TRIANGLE:
      this.func = Oscillator.Triangle;
      break;

    case DSP.SAW:
      this.func = Oscillator.Saw;
      break;

    case DSP.SQUARE:
      this.func = Oscillator.Square;
      break;

    default:
    case DSP.SINE:
      this.func = Oscillator.Sine;
      break;
  }

  this.generateWaveTable = function() {
    Oscillator.waveTable[this.func] = new Float32Array(2048);
    var waveTableTime = this.waveTableLength / this.sampleRate;
    var waveTableHz = 1 / waveTableTime;

    for (var i = 0; i < this.waveTableLength; i++) {
      Oscillator.waveTable[this.func][i] = this.func(i * waveTableHz/this.sampleRate);
    }
  };

  if ( typeof Oscillator.waveTable === 'undefined' ) {
    Oscillator.waveTable = {};
  }

  if ( typeof Oscillator.waveTable[this.func] === 'undefined' ) {
    this.generateWaveTable();
  }
 
  this.waveTable = Oscillator.waveTable[this.func];
}

/**
 * Set the amplitude of the signal
 *
 * @param {Number} amplitude The amplitude of the signal (between 0 and 1)
 */
Oscillator.prototype.setAmp = function(amplitude) {
  if (amplitude >= 0 && amplitude <= 1) {
    this.amplitude = amplitude;
  } else {
    throw "Amplitude out of range (0..1).";
  }
};
  
/**
 * Set the frequency of the signal
 *
 * @param {Number} frequency The frequency of the signal
 */  
Oscillator.prototype.setFreq = function(frequency) {
  this.frequency = frequency;
  this.cyclesPerSample = frequency / this.sampleRate;
};
     
// Add an oscillator
Oscillator.prototype.add = function(oscillator) {
  for ( var i = 0; i < this.bufferSize; i++ ) {
    //this.signal[i] += oscillator.valueAt(i);
    this.signal[i] += oscillator.signal[i];
  }
 
  return this.signal;
};
     
// Add a signal to the current generated osc signal
Oscillator.prototype.addSignal = function(signal) {
  for ( var i = 0; i < signal.length; i++ ) {
    if ( i >= this.bufferSize ) {
      break;
    }
    this.signal[i] += signal[i];
   
    /*
    // Constrain amplitude
    if ( this.signal[i] > 1 ) {
      this.signal[i] = 1;
    } else if ( this.signal[i] < -1 ) {
      this.signal[i] = -1;
    }
    */
  }
  return this.signal;
};
     
// Add an envelope to the oscillator
Oscillator.prototype.addEnvelope = function(envelope) {
  this.envelope = envelope;
};

Oscillator.prototype.applyEnvelope = function() {
  this.envelope.process(this.signal);
};
     
Oscillator.prototype.valueAt = function(offset) {
  return this.waveTable[offset % this.waveTableLength];
};
     
Oscillator.prototype.generate = function() {
  var frameOffset = this.frameCount * this.bufferSize;
  var step = this.waveTableLength * this.frequency / this.sampleRate;
  var offset;

  for ( var i = 0; i < this.bufferSize; i++ ) {
    //var step = (frameOffset + i) * this.cyclesPerSample % 1;
    //this.signal[i] = this.func(step) * this.amplitude;
    //this.signal[i] = this.valueAt(Math.round((frameOffset + i) * step)) * this.amplitude;
    offset = Math.round((frameOffset + i) * step);
    this.signal[i] = this.waveTable[offset % this.waveTableLength] * this.amplitude;
  }

  this.frameCount++;

  return this.signal;
};

Oscillator.Sine = function(step) {
  return Math.sin(DSP.TWO_PI * step);
};

Oscillator.Square = function(step) {
  return step < 0.5 ? 1 : -1;
};

Oscillator.Saw = function(step) {
  return 2 * (step - Math.round(step));
};

Oscillator.Triangle = function(step) {
  return 1 - 4 * Math.abs(Math.round(step) - step);
};

Oscillator.Pulse = function(step) {
  // stub
};
 
function ADSR(attackLength, decayLength, sustainLevel, sustainLength, releaseLength, sampleRate) {
  this.sampleRate = sampleRate;
  // Length in seconds
  this.attackLength  = attackLength;
  this.decayLength   = decayLength;
  this.sustainLevel  = sustainLevel;
  this.sustainLength = sustainLength;
  this.releaseLength = releaseLength;
  this.sampleRate    = sampleRate;
 
  // Length in samples
  this.attackSamples  = attackLength  * sampleRate;
  this.decaySamples   = decayLength   * sampleRate;
  this.sustainSamples = sustainLength * sampleRate;
  this.releaseSamples = releaseLength * sampleRate;
 
  // Updates the envelope sample positions
  this.update = function() {
    this.attack         =                this.attackSamples;
    this.decay          = this.attack  + this.decaySamples;
    this.sustain        = this.decay   + this.sustainSamples;
    this.release        = this.sustain + this.releaseSamples;
  };
 
  this.update();
 
  this.samplesProcessed = 0;
}

ADSR.prototype.noteOn = function() {
  this.samplesProcessed = 0;
  this.sustainSamples = this.sustainLength * this.sampleRate;
  this.update();
};

// Send a note off when using a sustain of infinity to let the envelope enter the release phase
ADSR.prototype.noteOff = function() {
  this.sustainSamples = this.samplesProcessed - this.decaySamples;
  this.update();
};

ADSR.prototype.processSample = function(sample) {
  var amplitude = 0;

  if ( this.samplesProcessed <= this.attack ) {
    amplitude = 0 + (1 - 0) * ((this.samplesProcessed - 0) / (this.attack - 0));
  } else if ( this.samplesProcessed > this.attack && this.samplesProcessed <= this.decay ) {
    amplitude = 1 + (this.sustainLevel - 1) * ((this.samplesProcessed - this.attack) / (this.decay - this.attack));
  } else if ( this.samplesProcessed > this.decay && this.samplesProcessed <= this.sustain ) {
    amplitude = this.sustainLevel;
  } else if ( this.samplesProcessed > this.sustain && this.samplesProcessed <= this.release ) {
    amplitude = this.sustainLevel + (0 - this.sustainLevel) * ((this.samplesProcessed - this.sustain) / (this.release - this.sustain));
  }
 
  return sample * amplitude;
};

ADSR.prototype.value = function() {
  var amplitude = 0;

  if ( this.samplesProcessed <= this.attack ) {
    amplitude = 0 + (1 - 0) * ((this.samplesProcessed - 0) / (this.attack - 0));
  } else if ( this.samplesProcessed > this.attack && this.samplesProcessed <= this.decay ) {
    amplitude = 1 + (this.sustainLevel - 1) * ((this.samplesProcessed - this.attack) / (this.decay - this.attack));
  } else if ( this.samplesProcessed > this.decay && this.samplesProcessed <= this.sustain ) {
    amplitude = this.sustainLevel;
  } else if ( this.samplesProcessed > this.sustain && this.samplesProcessed <= this.release ) {
    amplitude = this.sustainLevel + (0 - this.sustainLevel) * ((this.samplesProcessed - this.sustain) / (this.release - this.sustain));
  }
 
  return amplitude;
};
     
ADSR.prototype.process = function(buffer) {
  for ( var i = 0; i < buffer.length; i++ ) {
    buffer[i] *= this.value();

    this.samplesProcessed++;
  }
 
  return buffer;
};
     
     
ADSR.prototype.isActive = function() {
  if ( this.samplesProcessed > this.release || this.samplesProcessed === -1 ) {
    return false;
  } else {
    return true;
  }
};

ADSR.prototype.disable = function() {
  this.samplesProcessed = -1;
};
 
function IIRFilter(type, cutoff, resonance, sampleRate) {
  this.sampleRate = sampleRate;

  switch(type) {
    case DSP.LOWPASS:
    case DSP.LP12:
      this.func = new IIRFilter.LP12(cutoff, resonance, sampleRate);
      break;
  }
}

IIRFilter.prototype.__defineGetter__('cutoff',
  function() {
    return this.func.cutoff;
  }
);

IIRFilter.prototype.__defineGetter__('resonance',
  function() {
    return this.func.resonance;
  }
);

IIRFilter.prototype.set = function(cutoff, resonance) {
  this.func.calcCoeff(cutoff, resonance);
};

IIRFilter.prototype.process = function(buffer) {
  this.func.process(buffer);
};

// Add an envelope to the filter
IIRFilter.prototype.addEnvelope = function(envelope) {
  if ( envelope instanceof ADSR ) {
    this.func.addEnvelope(envelope);
  } else {
    throw "Not an envelope.";
  }
};

IIRFilter.LP12 = function(cutoff, resonance, sampleRate) {
  this.sampleRate = sampleRate;
  this.vibraPos   = 0;
  this.vibraSpeed = 0;
  this.envelope = false;
 
  this.calcCoeff = function(cutoff, resonance) {
    this.w = 2.0 * Math.PI * cutoff / this.sampleRate;
    this.q = 1.0 - this.w / (2.0 * (resonance + 0.5 / (1.0 + this.w)) + this.w - 2.0);
    this.r = this.q * this.q;
    this.c = this.r + 1.0 - 2.0 * Math.cos(this.w) * this.q;
   
    this.cutoff = cutoff;
    this.resonance = resonance;
  };

  this.calcCoeff(cutoff, resonance);

  this.process = function(buffer) {
    for ( var i = 0; i < buffer.length; i++ ) {
      this.vibraSpeed += (buffer[i] - this.vibraPos) * this.c;
      this.vibraPos   += this.vibraSpeed;
      this.vibraSpeed *= this.r;
   
      /*
      var temp = this.vibraPos;
     
      if ( temp > 1.0 ) {
        temp = 1.0;
      } else if ( temp < -1.0 ) {
        temp = -1.0;
      } else if ( temp != temp ) {
        temp = 1;
      }
     
      buffer[i] = temp;
      */

      if (this.envelope) {
        buffer[i] = (buffer[i] * (1 - this.envelope.value())) + (this.vibraPos * this.envelope.value());
        this.envelope.samplesProcessed++;
      } else {
        buffer[i] = this.vibraPos;
      }
    }
  };
}; 

IIRFilter.LP12.prototype.addEnvelope = function(envelope) {
  this.envelope = envelope;
};

function IIRFilter2(type, cutoff, resonance, sampleRate) {
  this.type = type;
  this.cutoff = cutoff;
  this.resonance = resonance;
  this.sampleRate = sampleRate;

  this.f = Float32Array(4);
  this.f[0] = 0.0; // lp
  this.f[1] = 0.0; // hp
  this.f[2] = 0.0; // bp
  this.f[3] = 0.0; // br 
 
  this.calcCoeff = function(cutoff, resonance) {
    this.freq = 2 * Math.sin(Math.PI * Math.min(0.25, cutoff/(this.sampleRate*2)));  
    this.damp = Math.min(2 * (1 - Math.pow(resonance, 0.25)), Math.min(2, 2/this.freq - this.freq * 0.5));
  };

  this.calcCoeff(cutoff, resonance);
}

IIRFilter2.prototype.process = function(buffer) {
  var input, output;
  var f = this.f;

  for ( var i = 0; i < buffer.length; i++ ) {
    input = buffer[i];

    // first pass
    f[3] = input - this.damp * f[2];
    f[0] = f[0] + this.freq * f[2];
    f[1] = f[3] - f[0];
    f[2] = this.freq * f[1] + f[2];
    output = 0.5 * f[this.type];

    // second pass
    f[3] = input - this.damp * f[2];
    f[0] = f[0] + this.freq * f[2];
    f[1] = f[3] - f[0];
    f[2] = this.freq * f[1] + f[2];
    output += 0.5 * f[this.type];

    if (this.envelope) {
      buffer[i] = (buffer[i] * (1 - this.envelope.value())) + (output * this.envelope.value());
      this.envelope.samplesProcessed++;
    } else {
      buffer[i] = output;
    }
  }
};

IIRFilter2.prototype.addEnvelope = function(envelope) {
  if ( envelope instanceof ADSR ) {
    this.envelope = envelope;
  } else {
    throw "This is not an envelope.";
  }
};

IIRFilter2.prototype.set = function(cutoff, resonance) {
  this.calcCoeff(cutoff, resonance);
};



function WindowFunction(type, alpha) {
  this.alpha = alpha;
 
  switch(type) {
    case DSP.BARTLETT:
      this.func = WindowFunction.Bartlett;
      break;
     
    case DSP.BARTLETTHANN:
      this.func = WindowFunction.BartlettHann;
      break;
     
    case DSP.BLACKMAN:
      this.func = WindowFunction.Blackman;
      this.alpha = this.alpha || 0.16;
      break;
   
    case DSP.COSINE:
      this.func = WindowFunction.Cosine;
      break;
     
    case DSP.GAUSS:
      this.func = WindowFunction.Gauss;
      this.alpha = this.alpha || 0.25;
      break;
     
    case DSP.HAMMING:
      this.func = WindowFunction.Hamming;
      break;
     
    case DSP.HANN:
      this.func = WindowFunction.Hann;
      break;
   
    case DSP.LANCZOS:
      this.func = WindowFunction.Lanczoz;
      break;
     
    case DSP.RECTANGULAR:
      this.func = WindowFunction.Rectangular;
      break;
     
    case DSP.TRIANGULAR:
      this.func = WindowFunction.Triangular;
      break;
  }
}

WindowFunction.prototype.process = function(buffer) {
  var length = buffer.length;
  for ( var i = 0; i < length; i++ ) {
    buffer[i] *= this.func(length, i, this.alpha);
  }
  return buffer;
};

WindowFunction.Bartlett = function(length, index) {
  return 2 / (length - 1) * ((length - 1) / 2 - Math.abs(index - (length - 1) / 2));
};

WindowFunction.BartlettHann = function(length, index) {
  return 0.62 - 0.48 * Math.abs(index / (length - 1) - 0.5) - 0.38 * Math.cos(DSP.TWO_PI * index / (length - 1));
};

WindowFunction.Blackman = function(length, index, alpha) {
  var a0 = (1 - alpha) / 2;
  var a1 = 0.5;
  var a2 = alpha / 2;

  return a0 - a1 * Math.cos(DSP.TWO_PI * index / (length - 1)) + a2 * Math.cos(4 * Math.PI * index / (length - 1));
};

WindowFunction.Cosine = function(length, index) {
  return Math.cos(Math.PI * index / (length - 1) - Math.PI / 2);
};

WindowFunction.Gauss = function(length, index, alpha) {
  return Math.pow(Math.E, -0.5 * Math.pow((index - (length - 1) / 2) / (alpha * (length - 1) / 2), 2));
};

WindowFunction.Hamming = function(length, index) {
  return 0.54 - 0.46 * Math.cos(DSP.TWO_PI * index / (length - 1));
};

WindowFunction.Hann = function(length, index) {
  return 0.5 * (1 - Math.cos(DSP.TWO_PI * index / (length - 1)));
};

WindowFunction.Lanczos = function(length, index) {
  var x = 2 * index / (length - 1) - 1;
  return Math.sin(Math.PI * x) / (Math.PI * x);
};

WindowFunction.Rectangular = function(length, index) {
  return 1;
};

WindowFunction.Triangular = function(length, index) {
  return 2 / length * (length / 2 - Math.abs(index - (length - 1) / 2));
};

function sinh (arg) {
  // Returns the hyperbolic sine of the number, defined as (exp(number) - exp(-number))/2 
  //
  // version: 1004.2314
  // discuss at: http://phpjs.org/functions/sinh    // +   original by: Onno Marsman
  // *     example 1: sinh(-0.9834330348825909);
  // *     returns 1: -1.1497971402636502
  return (Math.exp(arg) - Math.exp(-arg))/2;
}

/* 
 *  Biquad filter
 * 
 *  Created by Ricard Marxer <email@ricardmarxer.com> on 2010-05-23.
 *  Copyright 2010 Ricard Marxer. All rights reserved.
 *
 */
// Implementation based on:
// http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
function Biquad(type, sampleRate) {
  this.Fs = sampleRate;
  this.type = type;  // type of the filter
  this.parameterType = DSP.Q; // type of the parameter

  this.x_1_l = 0;
  this.x_2_l = 0;
  this.y_1_l = 0;
  this.y_2_l = 0;

  this.x_1_r = 0;
  this.x_2_r = 0;
  this.y_1_r = 0;
  this.y_2_r = 0;

  this.b0 = 1;
  this.a0 = 1;

  this.b1 = 0;
  this.a1 = 0;

  this.b2 = 0;
  this.a2 = 0;

  this.b0a0 = this.b0 / this.a0;
  this.b1a0 = this.b1 / this.a0;
  this.b2a0 = this.b2 / this.a0;
  this.a1a0 = this.a1 / this.a0;
  this.a2a0 = this.a2 / this.a0;

  this.f0 = 3000;   // "wherever it's happenin', man."  Center Frequency or
                    // Corner Frequency, or shelf midpoint frequency, depending
                    // on which filter type.  The "significant frequency".

  this.dBgain = 12; // used only for peaking and shelving filters

  this.Q = 1;       // the EE kind of definition, except for peakingEQ in which A*Q is
                    // the classic EE Q.  That adjustment in definition was made so that
                    // a boost of N dB followed by a cut of N dB for identical Q and
                    // f0/Fs results in a precisely flat unity gain filter or "wire".

  this.BW = -3;     // the bandwidth in octaves (between -3 dB frequencies for BPF
                    // and notch or between midpoint (dBgain/2) gain frequencies for
                    // peaking EQ

  this.S = 1;       // a "shelf slope" parameter (for shelving EQ only).  When S = 1,
                    // the shelf slope is as steep as it can be and remain monotonically
                    // increasing or decreasing gain with frequency.  The shelf slope, in
                    // dB/octave, remains proportional to S for all other values for a
                    // fixed f0/Fs and dBgain.

  this.coefficients = function() {
    var b = [this.b0, this.b1, this.b2];
    var a = [this.a0, this.a1, this.a2];
    return {b: b, a:a};
  };

  this.setFilterType = function(type) {
    this.type = type;
    this.recalculateCoefficients();
  };

  this.setSampleRate = function(rate) {
    this.Fs = rate;
    this.recalculateCoefficients();
  };

  this.setQ = function(q) {
    this.parameterType = DSP.Q;
    this.Q = Math.max(Math.min(q, 115.0), 0.001);
    this.recalculateCoefficients();
  };

  this.setBW = function(bw) {
    this.parameterType = DSP.BW;
    this.BW = bw;
    this.recalculateCoefficients();
  };

  this.setS = function(s) {
    this.parameterType = DSP.S;
    this.S = Math.max(Math.min(s, 5.0), 0.0001);
    this.recalculateCoefficients();
  };

  this.setF0 = function(freq) {
    this.f0 = freq;
    this.recalculateCoefficients();
  }; 
 
  this.setDbGain = function(g) {
    this.dBgain = g;
    this.recalculateCoefficients();
  };

  this.recalculateCoefficients = function() {
    var A;
    if (type === DSP.PEAKING_EQ || type === DSP.LOW_SHELF || type === DSP.HIGH_SHELF ) {
      A = Math.pow(10, (this.dBgain/40));  // for peaking and shelving EQ filters only
    } else {
      A  = Math.sqrt( Math.pow(10, (this.dBgain/20)) );   
    }

    var w0 = DSP.TWO_PI * this.f0 / this.Fs;

    var cosw0 = Math.cos(w0);
    var sinw0 = Math.sin(w0);

    var alpha = 0;
   
    switch (this.parameterType) {
      case DSP.Q:
        alpha = sinw0/(2*this.Q);
        break;
           
      case DSP.BW:
        alpha = sinw0 * sinh( Math.LN2/2 * this.BW * w0/sinw0 );
        break;

      case DSP.S:
        alpha = sinw0/2 * Math.sqrt( (A + 1/A)*(1/this.S - 1) + 2 );
        break;
    }

    /**
        FYI: The relationship between bandwidth and Q is
             1/Q = 2*sinh(ln(2)/2*BW*w0/sin(w0))     (digital filter w BLT)
        or   1/Q = 2*sinh(ln(2)/2*BW)             (analog filter prototype)

        The relationship between shelf slope and Q is
             1/Q = sqrt((A + 1/A)*(1/S - 1) + 2)
    */

    var coeff;

    switch (this.type) {
      case DSP.LPF:       // H(s) = 1 / (s^2 + s/Q + 1)
        this.b0 =  (1 - cosw0)/2;
        this.b1 =   1 - cosw0;
        this.b2 =  (1 - cosw0)/2;
        this.a0 =   1 + alpha;
        this.a1 =  -2 * cosw0;
        this.a2 =   1 - alpha;
        break;

      case DSP.HPF:       // H(s) = s^2 / (s^2 + s/Q + 1)
        this.b0 =  (1 + cosw0)/2;
        this.b1 = -(1 + cosw0);
        this.b2 =  (1 + cosw0)/2;
        this.a0 =   1 + alpha;
        this.a1 =  -2 * cosw0;
        this.a2 =   1 - alpha;
        break;

      case DSP.BPF_CONSTANT_SKIRT:       // H(s) = s / (s^2 + s/Q + 1)  (constant skirt gain, peak gain = Q)
        this.b0 =   sinw0/2;
        this.b1 =   0;
        this.b2 =  -sinw0/2;
        this.a0 =   1 + alpha;
        this.a1 =  -2*cosw0;
        this.a2 =   1 - alpha;
        break;

      case DSP.BPF_CONSTANT_PEAK:       // H(s) = (s/Q) / (s^2 + s/Q + 1)      (constant 0 dB peak gain)
        this.b0 =   alpha;
        this.b1 =   0;
        this.b2 =  -alpha;
        this.a0 =   1 + alpha;
        this.a1 =  -2*cosw0;
        this.a2 =   1 - alpha;
        break;

      case DSP.NOTCH:     // H(s) = (s^2 + 1) / (s^2 + s/Q + 1)
        this.b0 =   1;
        this.b1 =  -2*cosw0;
        this.b2 =   1;
        this.a0 =   1 + alpha;
        this.a1 =  -2*cosw0;
        this.a2 =   1 - alpha;
        break;

      case DSP.APF:       // H(s) = (s^2 - s/Q + 1) / (s^2 + s/Q + 1)
        this.b0 =   1 - alpha;
        this.b1 =  -2*cosw0;
        this.b2 =   1 + alpha;
        this.a0 =   1 + alpha;
        this.a1 =  -2*cosw0;
        this.a2 =   1 - alpha;
        break;

      case DSP.PEAKING_EQ:  // H(s) = (s^2 + s*(A/Q) + 1) / (s^2 + s/(A*Q) + 1)
        this.b0 =   1 + alpha*A;
        this.b1 =  -2*cosw0;
        this.b2 =   1 - alpha*A;
        this.a0 =   1 + alpha/A;
        this.a1 =  -2*cosw0;
        this.a2 =   1 - alpha/A;
        break;

      case DSP.LOW_SHELF:   // H(s) = A * (s^2 + (sqrt(A)/Q)*s + A)/(A*s^2 + (sqrt(A)/Q)*s + 1)
        coeff = sinw0 * Math.sqrt( (A^2 + 1)*(1/this.S - 1) + 2*A );
        this.b0 =    A*((A+1) - (A-1)*cosw0 + coeff);
        this.b1 =  2*A*((A-1) - (A+1)*cosw0);
        this.b2 =    A*((A+1) - (A-1)*cosw0 - coeff);
        this.a0 =       (A+1) + (A-1)*cosw0 + coeff;
        this.a1 =   -2*((A-1) + (A+1)*cosw0);
        this.a2 =       (A+1) + (A-1)*cosw0 - coeff;
        break;

      case DSP.HIGH_SHELF:   // H(s) = A * (A*s^2 + (sqrt(A)/Q)*s + 1)/(s^2 + (sqrt(A)/Q)*s + A)
        coeff = sinw0 * Math.sqrt( (A^2 + 1)*(1/this.S - 1) + 2*A );
        this.b0 =    A*((A+1) + (A-1)*cosw0 + coeff);
        this.b1 = -2*A*((A-1) + (A+1)*cosw0);
        this.b2 =    A*((A+1) + (A-1)*cosw0 - coeff);
        this.a0 =       (A+1) - (A-1)*cosw0 + coeff;
        this.a1 =    2*((A-1) - (A+1)*cosw0);
        this.a2 =       (A+1) - (A-1)*cosw0 - coeff;
        break;
    }
   
    this.b0a0 = this.b0/this.a0;
    this.b1a0 = this.b1/this.a0;
    this.b2a0 = this.b2/this.a0;
    this.a1a0 = this.a1/this.a0;
    this.a2a0 = this.a2/this.a0;
  };

  this.process = function(buffer) {
      //y[n] = (b0/a0)*x[n] + (b1/a0)*x[n-1] + (b2/a0)*x[n-2]
      //       - (a1/a0)*y[n-1] - (a2/a0)*y[n-2]

      var len = buffer.length;
      var output = new Float32Array(len);

      for ( var i=0; i<buffer.length; i++ ) {
        output[i] = this.b0a0*buffer[i] + this.b1a0*this.x_1_l + this.b2a0*this.x_2_l - this.a1a0*this.y_1_l - this.a2a0*this.y_2_l;
        this.y_2_l = this.y_1_l;
        this.y_1_l = output[i];
        this.x_2_l = this.x_1_l;
        this.x_1_l = buffer[i];
      }

      return output;
  };

  this.processStereo = function(buffer) {
      //y[n] = (b0/a0)*x[n] + (b1/a0)*x[n-1] + (b2/a0)*x[n-2]
      //       - (a1/a0)*y[n-1] - (a2/a0)*y[n-2]

      var len = buffer.length;
      var output = new Float32Array(len);
     
      for (var i = 0; i < len/2; i++) {
        output[2*i] = this.b0a0*buffer[2*i] + this.b1a0*this.x_1_l + this.b2a0*this.x_2_l - this.a1a0*this.y_1_l - this.a2a0*this.y_2_l;
        this.y_2_l = this.y_1_l;
        this.y_1_l = output[2*i];
        this.x_2_l = this.x_1_l;
        this.x_1_l = buffer[2*i];

        output[2*i+1] = this.b0a0*buffer[2*i+1] + this.b1a0*this.x_1_r + this.b2a0*this.x_2_r - this.a1a0*this.y_1_r - this.a2a0*this.y_2_r;
        this.y_2_r = this.y_1_r;
        this.y_1_r = output[2*i+1];
        this.x_2_r = this.x_1_r;
        this.x_1_r = buffer[2*i+1];
      }

      return output;
  };
}

/* 
 *  Magnitude to decibels
 * 
 *  Created by Ricard Marxer <email@ricardmarxer.com> on 2010-05-23.
 *  Copyright 2010 Ricard Marxer. All rights reserved.
 *
 *  @buffer array of magnitudes to convert to decibels
 *
 *  @returns the array in decibels
 *
 */
DSP.mag2db = function(buffer) {
  var minDb = -120;
  var minMag = Math.pow(10.0, minDb / 20.0);

  var log = Math.log;
  var max = Math.max;
 
  var result = Float32Array(buffer.length);
  for (var i=0; i<buffer.length; i++) {
    result[i] = 20.0*log(max(buffer[i], minMag));
  }

  return result;
};

/* 
 *  Frequency response
 * 
 *  Created by Ricard Marxer <email@ricardmarxer.com> on 2010-05-23.
 *  Copyright 2010 Ricard Marxer. All rights reserved.
 *
 *  Calculates the frequency response at the given points.
 *
 *  @b b coefficients of the filter
 *  @a a coefficients of the filter
 *  @w w points (normally between -PI and PI) where to calculate the frequency response
 *
 *  @returns the frequency response in magnitude
 *
 */
DSP.freqz = function(b, a, w) {
  var i, j;

  if (!w) {
    w = Float32Array(200);
    for (i=0;i<w.length; i++) {
      w[i] = DSP.TWO_PI/w.length * i - Math.PI;
    }
  }

  var result = Float32Array(w.length);
 
  var sqrt = Math.sqrt;
  var cos = Math.cos;
  var sin = Math.sin;
 
  for (i=0; i<w.length; i++) {
    var numerator = {real:0.0, imag:0.0};
    for (j=0; j<b.length; j++) {
      numerator.real += b[j] * cos(-j*w[i]);
      numerator.imag += b[j] * sin(-j*w[i]);
    }

    var denominator = {real:0.0, imag:0.0};
    for (j=0; j<a.length; j++) {
      denominator.real += a[j] * cos(-j*w[i]);
      denominator.imag += a[j] * sin(-j*w[i]);
    }
 
    result[i] =  sqrt(numerator.real*numerator.real + numerator.imag*numerator.imag) / sqrt(denominator.real*denominator.real + denominator.imag*denominator.imag);
  }

  return result;
};

/* 
 *  Graphical Equalizer
 *
 *  Implementation of a graphic equalizer with a configurable bands-per-octave
 *  and minimum and maximum frequencies
 * 
 *  Created by Ricard Marxer <email@ricardmarxer.com> on 2010-05-23.
 *  Copyright 2010 Ricard Marxer. All rights reserved.
 *
 */
function GraphicalEq(sampleRate) {
  this.FS = sampleRate;
  this.minFreq = 40.0;
  this.maxFreq = 16000.0;

  this.bandsPerOctave = 1.0;

  this.filters = [];
  this.freqzs = [];

  this.calculateFreqzs = true;

  this.recalculateFilters = function() {
    var bandCount = Math.round(Math.log(this.maxFreq/this.minFreq) * this.bandsPerOctave/ Math.LN2);

    this.filters = [];
    for (var i=0; i<bandCount; i++) {
      var freq = this.minFreq*(Math.pow(2, i/this.bandsPerOctave));
      var newFilter = new Biquad(DSP.PEAKING_EQ, this.FS);
      newFilter.setDbGain(0);
      newFilter.setBW(1/this.bandsPerOctave);
      newFilter.setF0(freq);
      this.filters[i] = newFilter;
      this.recalculateFreqz(i);
    }
  };

  this.setMinimumFrequency = function(freq) {
    this.minFreq = freq;
    this.recalculateFilters();
  };

  this.setMaximumFrequency = function(freq) {
    this.maxFreq = freq;
    this.recalculateFilters();
  };

  this.setBandsPerOctave = function(bands) {
    this.bandsPerOctave = bands;
    this.recalculateFilters();
  };

  this.setBandGain = function(bandIndex, gain) {
    if (bandIndex < 0 || bandIndex > (this.filters.length-1)) {
      throw "The band index of the graphical equalizer is out of bounds.";
    }

    if (!gain) {
      throw "A gain must be passed.";
    }
   
    this.filters[bandIndex].setDbGain(gain);
    this.recalculateFreqz(bandIndex);
  };
 
  this.recalculateFreqz = function(bandIndex) {
    if (!this.calculateFreqzs) {
      return;
    }

    if (bandIndex < 0 || bandIndex > (this.filters.length-1)) {
      throw "The band index of the graphical equalizer is out of bounds. " + bandIndex + " is out of [" + 0 + ", " + this.filters.length-1 + "]";
    }
       
    if (!this.w) {
      this.w = Float32Array(400);
      for (var i=0; i<this.w.length; i++) {
         this.w[i] = Math.PI/this.w.length * i;
      }
    }
   
    var b = [this.filters[bandIndex].b0, this.filters[bandIndex].b1, this.filters[bandIndex].b2];
    var a = [this.filters[bandIndex].a0, this.filters[bandIndex].a1, this.filters[bandIndex].a2];

    this.freqzs[bandIndex] = DSP.mag2db(DSP.freqz(b, a, this.w));
  };

  this.process = function(buffer) {
    var output = buffer;

    for (var i = 0; i < this.filters.length; i++) {
      output = this.filters[i].process(output);
    }

    return output;
  };

  this.processStereo = function(buffer) {
    var output = buffer;

    for (var i = 0; i < this.filters.length; i++) {
      output = this.filters[i].processStereo(output);
    }

    return output;
  };
}

/**
 * MultiDelay effect by Almer Thie (http://code.almeros.com).
 * Copyright 2010 Almer Thie. All rights reserved.
 * Example: http://code.almeros.com/code-examples/delay-firefox-audio-api/
 *
 * This is a delay that feeds it's own delayed signal back into its circular
 * buffer. Also known as a CombFilter.
 *
 * Compatible with interleaved stereo (or more channel) buffers and
 * non-interleaved mono buffers.
 *
 * @param {Number} maxDelayInSamplesSize Maximum possible delay in samples (size of circular buffer)
 * @param {Number} delayInSamples Initial delay in samples
 * @param {Number} masterVolume Initial master volume. Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 * @param {Number} delayVolume Initial feedback delay volume. Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 *
 * @constructor
 */
function MultiDelay(maxDelayInSamplesSize, delayInSamples, masterVolume, delayVolume) {
  this.delayBufferSamples   = new Float32Array(maxDelayInSamplesSize); // The maximum size of delay
  this.delayInputPointer     = delayInSamples;
  this.delayOutputPointer   = 0;
 
  this.delayInSamples   = delayInSamples;
  this.masterVolume     = masterVolume;
  this.delayVolume     = delayVolume;
}

/**
 * Change the delay time in samples.
 *
 * @param {Number} delayInSamples Delay in samples
 */
MultiDelay.prototype.setDelayInSamples = function (delayInSamples) {
  this.delayInSamples = delayInSamples;
 
  this.delayInputPointer = this.delayOutputPointer + delayInSamples;

  if (this.delayInputPointer >= this.delayBufferSamples.length-1) {
    this.delayInputPointer = this.delayInputPointer - this.delayBufferSamples.length; 
  }
};

/**
 * Change the master volume.
 *
 * @param {Number} masterVolume Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 */
MultiDelay.prototype.setMasterVolume = function(masterVolume) {
  this.masterVolume = masterVolume;
};

/**
 * Change the delay feedback volume.
 *
 * @param {Number} delayVolume Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 */
MultiDelay.prototype.setDelayVolume = function(delayVolume) {
  this.delayVolume = delayVolume;
};

/**
 * Process a given interleaved or mono non-interleaved float value Array and adds the delayed audio.
 *
 * @param {Array} samples Array containing Float values or a Float32Array
 *
 * @returns A new Float32Array interleaved or mono non-interleaved as was fed to this function.
 */
MultiDelay.prototype.process = function(samples) {
  // NB. Make a copy to put in the output samples to return.
  var outputSamples = new Float32Array(samples.length);

  for (var i=0; i<samples.length; i++) {
    // delayBufferSamples could contain initial NULL's, return silence in that case
    var delaySample = (this.delayBufferSamples[this.delayOutputPointer] === null ? 0.0 : this.delayBufferSamples[this.delayOutputPointer]);
   
    // Mix normal audio data with delayed audio
    var sample = (delaySample * this.delayVolume) + samples[i];
   
    // Add audio data with the delay in the delay buffer
    this.delayBufferSamples[this.delayInputPointer] = sample;
   
    // Return the audio with delay mix
    outputSamples[i] = sample * this.masterVolume;
   
    // Manage circulair delay buffer pointers
    this.delayInputPointer++;
    if (this.delayInputPointer >= this.delayBufferSamples.length-1) {
      this.delayInputPointer = 0;
    }
     
    this.delayOutputPointer++;
    if (this.delayOutputPointer >= this.delayBufferSamples.length-1) {
      this.delayOutputPointer = 0; 
    } 
  }
 
  return outputSamples;
};

/**
 * SingleDelay effect by Almer Thie (http://code.almeros.com).
 * Copyright 2010 Almer Thie. All rights reserved.
 * Example: See usage in Reverb class
 *
 * This is a delay that does NOT feeds it's own delayed signal back into its 
 * circular buffer, neither does it return the original signal. Also known as
 * an AllPassFilter(?).
 *
 * Compatible with interleaved stereo (or more channel) buffers and
 * non-interleaved mono buffers.
 *
 * @param {Number} maxDelayInSamplesSize Maximum possible delay in samples (size of circular buffer)
 * @param {Number} delayInSamples Initial delay in samples
 * @param {Number} delayVolume Initial feedback delay volume. Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 *
 * @constructor
 */

function SingleDelay(maxDelayInSamplesSize, delayInSamples, delayVolume) {
  this.delayBufferSamples = new Float32Array(maxDelayInSamplesSize); // The maximum size of delay
  this.delayInputPointer  = delayInSamples;
  this.delayOutputPointer = 0;
 
  this.delayInSamples     = delayInSamples;
  this.delayVolume        = delayVolume;
}

/**
 * Change the delay time in samples.
 *
 * @param {Number} delayInSamples Delay in samples
 */
SingleDelay.prototype.setDelayInSamples = function(delayInSamples) {
  this.delayInSamples = delayInSamples;
  this.delayInputPointer = this.delayOutputPointer + delayInSamples;

  if (this.delayInputPointer >= this.delayBufferSamples.length-1) {
    this.delayInputPointer = this.delayInputPointer - this.delayBufferSamples.length; 
  }
};

/**
 * Change the return signal volume.
 *
 * @param {Number} delayVolume Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 */
SingleDelay.prototype.setDelayVolume = function(delayVolume) {
  this.delayVolume = delayVolume;
};

/**
 * Process a given interleaved or mono non-interleaved float value Array and
 * returns the delayed audio.
 *
 * @param {Array} samples Array containing Float values or a Float32Array
 *
 * @returns A new Float32Array interleaved or mono non-interleaved as was fed to this function.
 */
SingleDelay.prototype.process = function(samples) {
  // NB. Make a copy to put in the output samples to return.
  var outputSamples = new Float32Array(samples.length);

  for (var i=0; i<samples.length; i++) {

    // Add audio data with the delay in the delay buffer
    this.delayBufferSamples[this.delayInputPointer] = samples[i];
   
    // delayBufferSamples could contain initial NULL's, return silence in that case
    var delaySample = this.delayBufferSamples[this.delayOutputPointer];

    // Return the audio with delay mix
    outputSamples[i] = delaySample * this.delayVolume;

    // Manage circulair delay buffer pointers
    this.delayInputPointer++;

    if (this.delayInputPointer >= this.delayBufferSamples.length-1) {
      this.delayInputPointer = 0;
    }
     
    this.delayOutputPointer++;

    if (this.delayOutputPointer >= this.delayBufferSamples.length-1) {
      this.delayOutputPointer = 0; 
    } 
  }
 
  return outputSamples;
};

/**
 * Reverb effect by Almer Thie (http://code.almeros.com).
 * Copyright 2010 Almer Thie. All rights reserved.
 * Example: http://code.almeros.com/code-examples/reverb-firefox-audio-api/
 *
 * This reverb consists of 6 SingleDelays, 6 MultiDelays and an IIRFilter2
 * for each of the two stereo channels.
 *
 * Compatible with interleaved stereo buffers only!
 *
 * @param {Number} maxDelayInSamplesSize Maximum possible delay in samples (size of circular buffers)
 * @param {Number} delayInSamples Initial delay in samples for internal (Single/Multi)delays
 * @param {Number} masterVolume Initial master volume. Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 * @param {Number} mixVolume Initial reverb signal mix volume. Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 * @param {Number} delayVolume Initial feedback delay volume for internal (Single/Multi)delays. Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 * @param {Number} dampFrequency Initial low pass filter frequency. 0 to 44100 (depending on your maximum sampling frequency)
 *
 * @constructor
 */
function Reverb(maxDelayInSamplesSize, delayInSamples, masterVolume, mixVolume, delayVolume, dampFrequency) {
  this.delayInSamples   = delayInSamples;
  this.masterVolume     = masterVolume;
  this.mixVolume       = mixVolume;
  this.delayVolume     = delayVolume;
  this.dampFrequency     = dampFrequency;
 
  this.NR_OF_MULTIDELAYS = 6;
  this.NR_OF_SINGLEDELAYS = 6;
 
  this.LOWPASSL = new IIRFilter2(DSP.LOWPASS, dampFrequency, 0, 44100);
  this.LOWPASSR = new IIRFilter2(DSP.LOWPASS, dampFrequency, 0, 44100);
 
  this.singleDelays = [];
  
  var i, delayMultiply;

  for (i = 0; i < this.NR_OF_SINGLEDELAYS; i++) {
    delayMultiply = 1.0 + (i/7.0); // 1.0, 1.1, 1.2...
    this.singleDelays[i] = new SingleDelay(maxDelayInSamplesSize, Math.round(this.delayInSamples * delayMultiply), this.delayVolume);
  }
 
  this.multiDelays = [];

  for (i = 0; i < this.NR_OF_MULTIDELAYS; i++) {
    delayMultiply = 1.0 + (i/10.0); // 1.0, 1.1, 1.2... 
    this.multiDelays[i] = new MultiDelay(maxDelayInSamplesSize, Math.round(this.delayInSamples * delayMultiply), this.masterVolume, this.delayVolume);
  }
}

/**
 * Change the delay time in samples as a base for all delays.
 *
 * @param {Number} delayInSamples Delay in samples
 */
Reverb.prototype.setDelayInSamples = function (delayInSamples){
  this.delayInSamples = delayInSamples;

  var i, delayMultiply;
 
  for (i = 0; i < this.NR_OF_SINGLEDELAYS; i++) {
    delayMultiply = 1.0 + (i/7.0); // 1.0, 1.1, 1.2...
    this.singleDelays[i].setDelayInSamples( Math.round(this.delayInSamples * delayMultiply) );
  }
   
  for (i = 0; i < this.NR_OF_MULTIDELAYS; i++) {
    delayMultiply = 1.0 + (i/10.0); // 1.0, 1.1, 1.2...
    this.multiDelays[i].setDelayInSamples( Math.round(this.delayInSamples * delayMultiply) );
  }
};

/**
 * Change the master volume.
 *
 * @param {Number} masterVolume Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 */
Reverb.prototype.setMasterVolume = function (masterVolume){
  this.masterVolume = masterVolume;
};

/**
 * Change the reverb signal mix level.
 *
 * @param {Number} mixVolume Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 */
Reverb.prototype.setMixVolume = function (mixVolume){
  this.mixVolume = mixVolume;
};

/**
 * Change all delays feedback volume.
 *
 * @param {Number} delayVolume Float value: 0.0 (silence), 1.0 (normal), >1.0 (amplify)
 */
Reverb.prototype.setDelayVolume = function (delayVolume){
  this.delayVolume = delayVolume;
 
  var i;

  for (i = 0; i<this.NR_OF_SINGLEDELAYS; i++) {
    this.singleDelays[i].setDelayVolume(this.delayVolume);
  } 
 
  for (i = 0; i<this.NR_OF_MULTIDELAYS; i++) {
    this.multiDelays[i].setDelayVolume(this.delayVolume);
  } 
};

/**
 * Change the Low Pass filter frequency.
 *
 * @param {Number} dampFrequency low pass filter frequency. 0 to 44100 (depending on your maximum sampling frequency)
 */
Reverb.prototype.setDampFrequency = function (dampFrequency){
  this.dampFrequency = dampFrequency;
 
  this.LOWPASSL.set(dampFrequency, 0);
  this.LOWPASSR.set(dampFrequency, 0); 
};

/**
 * Process a given interleaved float value Array and copies and adds the reverb signal.
 *
 * @param {Array} samples Array containing Float values or a Float32Array
 *
 * @returns A new Float32Array interleaved buffer.
 */
Reverb.prototype.process = function (interleavedSamples){ 
  // NB. Make a copy to put in the output samples to return.
  var outputSamples = new Float32Array(interleavedSamples.length);
 
  // Perform low pass on the input samples to mimick damp
  var leftRightMix = DSP.deinterleave(interleavedSamples);
  this.LOWPASSL.process( leftRightMix[DSP.LEFT] );
  this.LOWPASSR.process( leftRightMix[DSP.RIGHT] ); 
  var filteredSamples = DSP.interleave(leftRightMix[DSP.LEFT], leftRightMix[DSP.RIGHT]);

  var i;

  // Process MultiDelays in parallel
  for (i = 0; i<this.NR_OF_MULTIDELAYS; i++) {
    // Invert the signal of every even multiDelay
    outputSamples = DSP.mixSampleBuffers(outputSamples, this.multiDelays[i].process(filteredSamples), 2%i === 0, this.NR_OF_MULTIDELAYS);
  }
 
  // Process SingleDelays in series
  var singleDelaySamples = new Float32Array(outputSamples.length);
  for (i = 0; i<this.NR_OF_SINGLEDELAYS; i++) {
    // Invert the signal of every even singleDelay
    singleDelaySamples = DSP.mixSampleBuffers(singleDelaySamples, this.singleDelays[i].process(outputSamples), 2%i === 0, 1);
  }

  // Apply the volume of the reverb signal
  for (i = 0; i<singleDelaySamples.length; i++) {
    singleDelaySamples[i] *= this.mixVolume;
  }
 
  // Mix the original signal with the reverb signal
  outputSamples = DSP.mixSampleBuffers(singleDelaySamples, interleavedSamples, 0, 1);

  // Apply the master volume to the complete signal
  for (i = 0; i<outputSamples.length; i++) {
    outputSamples[i] *= this.masterVolume;
  }
   
  return outputSamples;
};



================================================
FILE: Downsample/vendor/three.js/Detector.js
================================================
/**
 * @author alteredq / http://alteredqualia.com/
 * @author mr.doob / http://mrdoob.com/
 */

Detector = {

	canvas : !! window.CanvasRenderingContext2D,
	webgl : ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(),
	workers : !! window.Worker,
	fileapi : window.File && window.FileReader && window.FileList && window.Blob,

	getWebGLErrorMessage : function () {

		var domElement = document.createElement( 'div' );

		domElement.style.fontFamily = 'monospace';
		domElement.style.fontSize = '13px';
		domElement.style.textAlign = 'center';
		domElement.style.background = '#eee';
		domElement.style.color = '#000';
		domElement.style.padding = '1em';
		domElement.style.width = '475px';
		domElement.style.margin = '5em auto 0';

		if ( ! this.webgl ) {

			domElement.innerHTML = window.WebGLRenderingContext ? [
				'Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br />',
				'Find out how to get it <a href="http://get.webgl.org/">here</a>.'
			].join( '\n' ) : [
				'Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>.<br/>',
				'Find out how to get it <a href="http://get.webgl.org/">here</a>.'
			].join( '\n' );

		}

		return domElement;

	},

	addGetWebGLMessage : function ( parameters ) {

		var parent, id, domElement;

		parameters = parameters || {};

		parent = parameters.parent !== undefined ? parameters.parent : document.body;
		id = parameters.id !== undefined ? parameters.id : 'oldie';

		domElement = Detector.getWebGLErrorMessage();
		domElement.id = id;

		parent.appendChild( domElement );

	}

};


================================================
FILE: Downsample/vendor/three.js/ShaderExtras.js
================================================
/**
 * @author alteredq / http://alteredqualia.com/
 * @author zz85 / http://www.lab4games.net/zz85/blog
 *
 * ShaderExtras currently contains:
 *
 *	screen
 *	convolution
 *	film
 * 	bokeh
 *  sepia
 *	dotscreen
 *	vignette
 *  bleachbypass
 *	basic
 *  dofmipmap
 *  focus
 *  triangleBlur
 *  horizontalBlur + verticalBlur
 *  horizontalTiltShift + verticalTiltShift
 *  blend
 *  fxaa
 *  luminosity
 *  colorCorrection
 *  normalmap
 *  ssao
 *  colorify
 *  unpackDepthRGBA
 */

THREE.ShaderExtras = {

	/* -------------------------------------------------------------------------
	//	Full-screen textured quad shader
	 ------------------------------------------------------------------------- */

	'screen': {

		uniforms: {

			tDiffuse: { type: "t", value: 0, texture: null },
			opacity:  { type: "f", value: 1.0 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform float opacity;",

			"uniform sampler2D tDiffuse;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 texel = texture2D( tDiffuse, vUv );",
				"gl_FragColor = opacity * texel;",

			"}"

		].join("\n")

	},

	/* ------------------------------------------------------------------------
	//	Convolution shader
	//	  - ported from o3d sample to WebGL / GLSL
	//			http://o3d.googlecode.com/svn/trunk/samples/convolution.html
	------------------------------------------------------------------------ */

	'convolution': {

		uniforms: {

			"tDiffuse" : 		{ type: "t", value: 0, texture: null },
			"uImageIncrement" : { type: "v2", value: new THREE.Vector2( 0.001953125, 0.0 ) },
			"cKernel" : 		{ type: "fv1", value: [] }

		},

		vertexShader: [

			//"#define KERNEL_SIZE 25.0",

			"uniform vec2 uImageIncrement;",

			"varying vec2 vUv;",

			"void main() {",

				"vUv = uv - ( ( KERNEL_SIZE - 1.0 ) / 2.0 ) * uImageIncrement;",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			//"#define KERNEL_SIZE 25",
			"uniform float cKernel[ KERNEL_SIZE ];",

			"uniform sampler2D tDiffuse;",
			"uniform vec2 uImageIncrement;",

			"varying vec2 vUv;",

			"void main() {",

				"vec2 imageCoord = vUv;",
				"vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );",

				"for( int i = 0; i < KERNEL_SIZE; i ++ ) {",

					"sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];",
					"imageCoord += uImageIncrement;",

				"}",

				"gl_FragColor = sum;",

			"}"


		].join("\n")

	},

	/* -------------------------------------------------------------------------

	// Film grain & scanlines shader

	//	- ported from HLSL to WebGL / GLSL
	//	  http://www.truevision3d.com/forums/showcase/staticnoise_colorblackwhite_scanline_shaders-t18698.0.html

	// Screen Space Static Postprocessor
	//
	// Produces an analogue noise overlay similar to a film grain / TV static
	//
	// Original implementation and noise algorithm
	// Pat 'Hawthorne' Shearon
	//
	// Optimized scanlines + noise version with intensity scaling
	// Georg 'Leviathan' Steinrohder

	// This version is provided under a Creative Commons Attribution 3.0 License
	// http://creativecommons.org/licenses/by/3.0/
	 ------------------------------------------------------------------------- */

	'film': {

		uniforms: {

			tDiffuse:   { type: "t", value: 0, texture: null },
			time: 	    { type: "f", value: 0.0 },
			nIntensity: { type: "f", value: 0.5 },
			sIntensity: { type: "f", value: 0.05 },
			sCount: 	{ type: "f", value: 4096 },
			grayscale:  { type: "i", value: 1 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			// control parameter
			"uniform float time;",

			"uniform bool grayscale;",

			// noise effect intensity value (0 = no effect, 1 = full effect)
			"uniform float nIntensity;",

			// scanlines effect intensity value (0 = no effect, 1 = full effect)
			"uniform float sIntensity;",

			// scanlines effect count value (0 = no effect, 4096 = full effect)
			"uniform float sCount;",

			"uniform sampler2D tDiffuse;",

			"varying vec2 vUv;",

			"void main() {",

				// sample the source
				"vec4 cTextureScreen = texture2D( tDiffuse, vUv );",

				// make some noise
				"float x = vUv.x * vUv.y * time *  1000.0;",
				"x = mod( x, 13.0 ) * mod( x, 123.0 );",
				"float dx = mod( x, 0.01 );",

				// add noise
				"vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );",

				// get us a sine and cosine
				"vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );",

				// add scanlines
				"cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;",

				// interpolate between source and result by intensity
				"cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );",

				// convert to grayscale if desired
				"if( grayscale ) {",

					"cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );",

				"}",

				"gl_FragColor =  vec4( cResult, cTextureScreen.a );",

			"}"

		].join("\n")

	},


	/* -------------------------------------------------------------------------
	//	Depth-of-field shader with bokeh
	//	ported from GLSL shader by Martins Upitis
	//	http://artmartinsh.blogspot.com/2010/02/glsl-lens-blur-filter-with-bokeh.html
	 ------------------------------------------------------------------------- */

	'bokeh'	: {

	uniforms: { tColor:   { type: "t", value: 0, texture: null },
				tDepth:   { type: "t", value: 1, texture: null },
				focus:    { type: "f", value: 1.0 },
				aspect:   { type: "f", value: 1.0 },
				aperture: { type: "f", value: 0.025 },
				maxblur:  { type: "f", value: 1.0 },
			  },

	vertexShader: [

	"varying vec2 vUv;",

	"void main() {",

		"vUv = vec2( uv.x, 1.0 - uv.y );",
		"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

	"}"

	].join("\n"),

	fragmentShader: [

	"varying vec2 vUv;",

	"uniform sampler2D tColor;",
	"uniform sampler2D tDepth;",

	"uniform float maxblur;",  	// max blur amount
	"uniform float aperture;",	// aperture - bigger values for shallower depth of field

	"uniform float focus;",
	"uniform float aspect;",

	"void main() {",

		"vec2 aspectcorrect = vec2( 1.0, aspect );",

		"vec4 depth1 = texture2D( tDepth, vUv );",

		"float factor = depth1.x - focus;",

		"vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );",

		"vec2 dofblur9 = dofblur * 0.9;",
		"vec2 dofblur7 = dofblur * 0.7;",
		"vec2 dofblur4 = dofblur * 0.4;",

		"vec4 col = vec4( 0.0 );",

		"col += texture2D( tColor, vUv.xy );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.15,  0.37 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.37,  0.15 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.40,  0.0  ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.37, -0.15 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.15,  0.37 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.37,  0.15 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.15, -0.37 ) * aspectcorrect ) * dofblur );",

		"col += texture2D( tColor, vUv.xy + ( vec2(  0.15,  0.37 ) * aspectcorrect ) * dofblur9 );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.37,  0.15 ) * aspectcorrect ) * dofblur9 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.37, -0.15 ) * aspectcorrect ) * dofblur9 );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.15,  0.37 ) * aspectcorrect ) * dofblur9 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.37,  0.15 ) * aspectcorrect ) * dofblur9 );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.15, -0.37 ) * aspectcorrect ) * dofblur9 );",

		"col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur7 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.40,  0.0  ) * aspectcorrect ) * dofblur7 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur7 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur7 );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur7 );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur7 );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur7 );",

		"col += texture2D( tColor, vUv.xy + ( vec2(  0.29,  0.29 ) * aspectcorrect ) * dofblur4 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.4,   0.0  ) * aspectcorrect ) * dofblur4 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.29, -0.29 ) * aspectcorrect ) * dofblur4 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,  -0.4  ) * aspectcorrect ) * dofblur4 );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.29,  0.29 ) * aspectcorrect ) * dofblur4 );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.4,   0.0  ) * aspectcorrect ) * dofblur4 );",
		"col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );",
		"col += texture2D( tColor, vUv.xy + ( vec2(  0.0,   0.4  ) * aspectcorrect ) * dofblur4 );",

		"gl_FragColor = col / 41.0;",
		"gl_FragColor.a = 1.0;",

	"}"

	].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Depth-of-field shader using mipmaps
	//	- from Matt Handley @applmak
	//	- requires power-of-2 sized render target with enabled mipmaps
	 ------------------------------------------------------------------------- */

	'dofmipmap': {

		uniforms: {

			tColor:   { type: "t", value: 0, texture: null },
			tDepth:   { type: "t", value: 1, texture: null },
			focus:    { type: "f", value: 1.0 },
			maxblur:  { type: "f", value: 1.0 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform float focus;",
			"uniform float maxblur;",

			"uniform sampler2D tColor;",
			"uniform sampler2D tDepth;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 depth = texture2D( tDepth, vUv );",

				"float factor = depth.x - focus;",

				"vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );",

				"gl_FragColor = col;",
				"gl_FragColor.a = 1.0;",

			"}"

		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Sepia tone shader
	//  - based on glfx.js sepia shader
	//		https://github.com/evanw/glfx.js
	 ------------------------------------------------------------------------- */

	'sepia': {

		uniforms: {

			tDiffuse: { type: "t", value: 0, texture: null },
			amount:   { type: "f", value: 1.0 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform float amount;",

			"uniform sampler2D tDiffuse;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 color = texture2D( tDiffuse, vUv );",
				"vec3 c = color.rgb;",

				"color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );",
				"color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );",
				"color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );",

				"gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );",

			"}"

		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Dot screen shader
	//  - based on glfx.js sepia shader
	//		https://github.com/evanw/glfx.js
	 ------------------------------------------------------------------------- */

	'dotscreen': {

		uniforms: {

			tDiffuse: { type: "t", value: 0, texture: null },
			tSize:    { type: "v2", value: new THREE.Vector2( 256, 256 ) },
			center:   { type: "v2", value: new THREE.Vector2( 0.5, 0.5 ) },
			angle:	  { type: "f", value: 1.57 },
			scale:	  { type: "f", value: 1.0 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform vec2 center;",
			"uniform float angle;",
			"uniform float scale;",
			"uniform vec2 tSize;",

			"uniform sampler2D tDiffuse;",

			"varying vec2 vUv;",

			"float pattern() {",

				"float s = sin( angle ), c = cos( angle );",

				"vec2 tex = vUv * tSize - center;",
				"vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;",

				"return ( sin( point.x ) * sin( point.y ) ) * 4.0;",

			"}",

			"void main() {",

				"vec4 color = texture2D( tDiffuse, vUv );",

				"float average = ( color.r + color.g + color.b ) / 3.0;",

				"gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );",

			"}"

		].join("\n")

	},

	/* ------------------------------------------------------------------------------------------------
	//	Vignette shader
	//	- based on PaintEffect postprocess from ro.me
	//		http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js
	 ------------------------------------------------------------------------------------------------ */

	'vignette': {

		uniforms: {

			tDiffuse: { type: "t", value: 0, texture: null },
			offset:   { type: "f", value: 1.0 },
			darkness: { type: "f", value: 1.0 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform float offset;",
			"uniform float darkness;",

			"uniform sampler2D tDiffuse;",

			"varying vec2 vUv;",

			"void main() {",

				// Eskil's vignette

				"vec4 texel = texture2D( tDiffuse, vUv );",
				"vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );",
				"gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );",

				/*
				// alternative version from glfx.js
				// this one makes more "dusty" look (as opposed to "burned")

				"vec4 color = texture2D( tDiffuse, vUv );",
				"float dist = distance( vUv, vec2( 0.5 ) );",
				"color.rgb *= smoothstep( 0.8, offset * 0.799, dist *( darkness + offset ) );",
				"gl_FragColor = color;",
				*/

			"}"

		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Bleach bypass shader [http://en.wikipedia.org/wiki/Bleach_bypass]
	//	- based on Nvidia example
	//		http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html#post_bleach_bypass
	 ------------------------------------------------------------------------- */

	'bleachbypass': {

		uniforms: {

			tDiffuse: { type: "t", value: 0, texture: null },
			opacity:  { type: "f", value: 1.0 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform float opacity;",

			"uniform sampler2D tDiffuse;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 base = texture2D( tDiffuse, vUv );",

				"vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );",
				"float lum = dot( lumCoeff, base.rgb );",
				"vec3 blend = vec3( lum );",

				"float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );",

				"vec3 result1 = 2.0 * base.rgb * blend;",
				"vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );",

				"vec3 newColor = mix( result1, result2, L );",

				"float A2 = opacity * base.a;",
				"vec3 mixRGB = A2 * newColor.rgb;",
				"mixRGB += ( ( 1.0 - A2 ) * base.rgb );",

				"gl_FragColor = vec4( mixRGB, base.a );",

			"}"

		].join("\n")

	},

	/* --------------------------------------------------------------------------------------------------
	//	Focus shader
	//	- based on PaintEffect postprocess from ro.me
	//		http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js
	 -------------------------------------------------------------------------------------------------- */

	'focus': {

		uniforms : {

			"tDiffuse": 		{ type: "t", value: 0, texture: null },
			"screenWidth": 		{ type: "f", value: 1024 },
			"screenHeight": 	{ type: "f", value: 1024 },
			"sampleDistance": 	{ type: "f", value: 0.94 },
			"waveFactor": 		{ type: "f", value: 0.00125 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform float screenWidth;",
			"uniform float screenHeight;",
			"uniform float sampleDistance;",
			"uniform float waveFactor;",

			"uniform sampler2D tDiffuse;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 color, org, tmp, add;",
				"float sample_dist, f;",
				"vec2 vin;",
				"vec2 uv = vUv;",

				"add += color = org = texture2D( tDiffuse, uv );",

				"vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );",
				"sample_dist = dot( vin, vin ) * 2.0;",

				"f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;",

				"vec2 sampleSize = vec2(  1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );",

				"add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );",
				"if( tmp.b < color.b ) color = tmp;",

				"add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );",
				"if( tmp.b < color.b ) color = tmp;",

				"add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );",
				"if( tmp.b < color.b ) color = tmp;",

				"add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );",
				"if( tmp.b < color.b ) color = tmp;",

				"add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );",
				"if( tmp.b < color.b ) color = tmp;",

				"add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );",
				"if( tmp.b < color.b ) color = tmp;",

				"add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );",
				"if( tmp.b < color.b ) color = tmp;",

				"color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );",
				"color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );",

				"gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );",

			"}"


		].join("\n")
	},

	/* -------------------------------------------------------------------------
	//	Triangle blur shader
	//  - based on glfx.js triangle blur shader
	//		https://github.com/evanw/glfx.js

	// 	A basic blur filter, which convolves the image with a
	// 	pyramid filter. The pyramid filter is separable and is applied as two
	//  perpendicular triangle filters.
	 ------------------------------------------------------------------------- */

	'triangleBlur': {


		uniforms : {

			"texture": 	{ type: "t", value: 0, texture: null },
			"delta": 	{ type: "v2", value:new THREE.Vector2( 1, 1 )  }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

		"#define ITERATIONS 10.0",

		"uniform sampler2D texture;",
		"uniform vec2 delta;",

		"varying vec2 vUv;",

		"float random( vec3 scale, float seed ) {",

			// use the fragment position for a different seed per-pixel

			"return fract( sin( dot( gl_FragCoord.xyz + seed, scale ) ) * 43758.5453 + seed );",

		"}",

		"void main() {",

			"vec4 color = vec4( 0.0 );",

			"float total = 0.0;",

			// randomize the lookup values to hide the fixed number of samples

			"float offset = random( vec3( 12.9898, 78.233, 151.7182 ), 0.0 );",

			"for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {",

				"float percent = ( t + offset - 0.5 ) / ITERATIONS;",
				"float weight = 1.0 - abs( percent );",

				"color += texture2D( texture, vUv + delta * percent ) * weight;",
				"total += weight;",

			"}",

			"gl_FragColor = color / total;",

		"}",

		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Simple test shader
	 ------------------------------------------------------------------------- */

	'basic': {

		uniforms: {},

		vertexShader: [

			"void main() {",

				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"void main() {",

				"gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );",

			"}"

		].join("\n")

	},

	/* --------------------------------------------------------------------------------------------------
	//	Two pass Gaussian blur filter (horizontal and vertical blur shaders)
	//	- described in http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/
	//	  and used in http://www.cake23.de/traveling-wavefronts-lit-up.html
	//
	//	- 9 samples per pass
	//	- standard deviation 2.7
	//	- "h" and "v" parameters should be set to "1 / width" and "1 / height"
	 -------------------------------------------------------------------------------------------------- */

	'horizontalBlur': {

		uniforms: {

			"tDiffuse": { type: "t", value: 0, texture: null },
			"h": 		{ type: "f", value: 1.0 / 512.0 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform sampler2D tDiffuse;",
			"uniform float h;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 sum = vec4( 0.0 );",

				"sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;",
				"sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;",
				"sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;",
				"sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, 		  	vUv.y ) ) * 0.1633;",
				"sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;",
				"sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;",
				"sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;",
				"sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;",

				"gl_FragColor = sum;",

			"}"


		].join("\n")

	},

	'verticalBlur': {

		uniforms: {

			"tDiffuse": { type: "t", value: 0, texture: null },
			"v": 		{ type: "f", value: 1.0 / 512.0 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform sampler2D tDiffuse;",
			"uniform float v;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 sum = vec4( 0.0 );",

				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y			  ) ) * 0.1633;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;",

				"gl_FragColor = sum;",

			"}"


		].join("\n")

	},

	/* --------------------------------------------------------------------------------------------------
	//	Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position
	//
	//	- 9 samples per pass
	//	- standard deviation 2.7
	//	- "h" and "v" parameters should be set to "1 / width" and "1 / height"
	//	- "r" parameter control where "focused" horizontal line lies
	 -------------------------------------------------------------------------------------------------- */

	'horizontalTiltShift': {

		uniforms: {

			"tDiffuse": { type: "t", value: 0, texture: null },
			"h": 		{ type: "f", value: 1.0 / 512.0 },
			"r": 		{ type: "f", value: 0.35 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform sampler2D tDiffuse;",
			"uniform float h;",
			"uniform float r;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 sum = vec4( 0.0 );",

				"float hh = h * abs( r - vUv.y );",

				"sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;",
				"sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;",
				"sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;",
				"sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, 		  	 vUv.y ) ) * 0.1633;",
				"sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;",
				"sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;",
				"sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;",
				"sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;",

				"gl_FragColor = sum;",

			"}"


		].join("\n")

	},

	'verticalTiltShift': {

		uniforms: {

			"tDiffuse": { type: "t", value: 0, texture: null },
			"v": 		{ type: "f", value: 1.0 / 512.0 },
			"r": 		{ type: "f", value: 0.35 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform sampler2D tDiffuse;",
			"uniform float v;",
			"uniform float r;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 sum = vec4( 0.0 );",

				"float vv = v * abs( r - vUv.y );",

				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y			   ) ) * 0.1633;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;",
				"sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;",

				"gl_FragColor = sum;",

			"}"


		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Blend two textures
	 ------------------------------------------------------------------------- */

	'blend': {

		uniforms: {

			tDiffuse1: { type: "t", value: 0, texture: null },
			tDiffuse2: { type: "t", value: 1, texture: null },
			mixRatio:  { type: "f", value: 0.5 },
			opacity:   { type: "f", value: 1.0 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform float opacity;",
			"uniform float mixRatio;",

			"uniform sampler2D tDiffuse1;",
			"uniform sampler2D tDiffuse2;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 texel1 = texture2D( tDiffuse1, vUv );",
				"vec4 texel2 = texture2D( tDiffuse2, vUv );",
				"gl_FragColor = opacity * mix( texel1, texel2, mixRatio );",

			"}"

		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	NVIDIA FXAA by Timothy Lottes
	//		http://timothylottes.blogspot.com/2011/06/fxaa3-source-released.html
	//	- WebGL port by @supereggbert
	//		http://www.glge.org/demos/fxaa/
	 ------------------------------------------------------------------------- */

	'fxaa': {

		uniforms: {

			"tDiffuse": 	{ type: "t", value: 0, texture: null },
			"resolution": 	{ type: "v2", value: new THREE.Vector2( 1 / 1024, 1 / 512 )  }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",

				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform sampler2D tDiffuse;",
			"uniform vec2 resolution;",

			"varying vec2 vUv;",

			"#define FXAA_REDUCE_MIN   (1.0/128.0)",
			"#define FXAA_REDUCE_MUL   (1.0/8.0)",
			"#define FXAA_SPAN_MAX     8.0",

			"void main() {",

				"vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;",
				"vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;",
				"vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;",
				"vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;",
				"vec3 rgbM  = texture2D( tDiffuse,  gl_FragCoord.xy  * resolution ).xyz;",

				"vec3 luma = vec3( 0.299, 0.587, 0.114 );",

				"float lumaNW = dot( rgbNW, luma );",
				"float lumaNE = dot( rgbNE, luma );",
				"float lumaSW = dot( rgbSW, luma );",
				"float lumaSE = dot( rgbSE, luma );",
				"float lumaM  = dot( rgbM,  luma );",
				"float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );",
				"float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );",

				"vec2 dir;",
				"dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));",
				"dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));",

				"float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );",

				"float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );",
				"dir = min( vec2( FXAA_SPAN_MAX,  FXAA_SPAN_MAX),",
					  "max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),",
							"dir * rcpDirMin)) * resolution;",

				"vec3 rgbA = 0.5 * (",
					"texture2D( tDiffuse, gl_FragCoord.xy  * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ).xyz +",
					"texture2D( tDiffuse, gl_FragCoord.xy  * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ).xyz );",

				"vec3 rgbB = rgbA * 0.5 + 0.25 * (",
					"texture2D( tDiffuse, gl_FragCoord.xy  * resolution + dir * -0.5 ).xyz +",
					"texture2D( tDiffuse, gl_FragCoord.xy  * resolution + dir * 0.5 ).xyz );",

				"float lumaB = dot( rgbB, luma );",

				"if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {",

					"gl_FragColor = vec4( rgbA, 1.0 );",

				"} else {",

					"gl_FragColor = vec4( rgbB, 1.0 );",

				"}",

			"}",

		].join("\n"),

	},

	/* -------------------------------------------------------------------------
	//	Luminosity
	//	http://en.wikipedia.org/wiki/Luminosity
	 ------------------------------------------------------------------------- */

	'luminosity': {

		uniforms: {

			"tDiffuse": 	{ type: "t", value: 0, texture: null }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",

				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform sampler2D tDiffuse;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 texel = texture2D( tDiffuse, vUv );",

				"vec3 luma = vec3( 0.299, 0.587, 0.114 );",

				"float v = dot( texel.xyz, luma );",

				"gl_FragColor = vec4( v, v, v, texel.w );",

			"}"

		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Color correction
	 ------------------------------------------------------------------------- */

	'colorCorrection': {

		uniforms: {

			"tDiffuse" : 	{ type: "t", value: 0, texture: null },
			"powRGB" :		{ type: "v3", value: new THREE.Vector3( 2, 2, 2 ) },
			"mulRGB" :		{ type: "v3", value: new THREE.Vector3( 1, 1, 1 ) }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",

				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform sampler2D tDiffuse;",
			"uniform vec3 powRGB;",
			"uniform vec3 mulRGB;",

			"varying vec2 vUv;",

			"void main() {",

				"gl_FragColor = texture2D( tDiffuse, vUv );",
				"gl_FragColor.rgb = mulRGB * pow( gl_FragColor.rgb, powRGB );",

			"}"

		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Normal map shader
	//	- compute normals from heightmap
	 ------------------------------------------------------------------------- */

	'normalmap': {

		uniforms: {

			"heightMap"	: { type: "t", value: 0, texture: null },
			"resolution": { type: "v2", value: new THREE.Vector2( 512, 512 ) },
			"scale"		: { type: "v2", value: new THREE.Vector2( 1, 1 ) },
			"height"	: { type: "f", value: 0.05 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",

				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform float height;",
			"uniform vec2 resolution;",
			"uniform sampler2D heightMap;",

			"varying vec2 vUv;",

			"void main() {",

				"float val = texture2D( heightMap, vUv ).x;",

				"float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;",
				"float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;",

				"gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height  ) ) + 0.5 ), 1.0 );",

			"}",

		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Screen-space ambient occlusion shader
	//	- ported from
	//		SSAO GLSL shader v1.2
	//		assembled by Martins Upitis (martinsh) (http://devlog-martinsh.blogspot.com)
	//		original technique is made by ArKano22 (http://www.gamedev.net/topic/550699-ssao-no-halo-artifacts/)
	//	- modifications
	//		- modified to use RGBA packed depth texture (use clear color 1,1,1,1 for depth pass)
	//		- made fog more compatible with three.js linear fog
	//		- refactoring and optimizations
	 ------------------------------------------------------------------------- */

	'ssao': {

		uniforms: {

			"tDiffuse": 	{ type: "t", value: 0, texture: null },
			"tDepth":   	{ type: "t", value: 1, texture: null },
			"size": 		{ type: "v2", value: new THREE.Vector2( 512, 512 ) },
			"cameraNear":	{ type: "f", value: 1 },
			"cameraFar":	{ type: "f", value: 100 },
			"fogNear":		{ type: "f", value: 5 },
			"fogFar":		{ type: "f", value: 100 },
			"fogEnabled":	{ type: "i", value: 0 },
			"aoClamp":		{ type: "f", value: 0.3 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",

				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform float cameraNear;",
			"uniform float cameraFar;",

			"uniform float fogNear;",
			"uniform float fogFar;",

			"uniform bool fogEnabled;",

			"uniform vec2 size;",		// texture width, height
			"uniform float aoClamp;", 	// depth clamp - reduces haloing at screen edges

			"uniform sampler2D tDiffuse;",
			"uniform sampler2D tDepth;",

			"varying vec2 vUv;",

			//"#define PI 3.14159265",
			"#define DL 2.399963229728653", // PI * ( 3.0 - sqrt( 5.0 ) )
			"#define EULER 2.718281828459045",

			// helpers

			"float width = size.x;", 	// texture width
			"float height = size.y;", 	// texture height

			"float cameraFarPlusNear = cameraFar + cameraNear;",
			"float cameraFarMinusNear = cameraFar - cameraNear;",
			"float cameraCoef = 2.0 * cameraNear;",

			// user variables

			"const int samples = 8;", 		// ao sample count
			"const float radius = 5.0;", 	// ao radius

			"const bool useNoise = false;", 		 // use noise instead of pattern for sample dithering
			"const float noiseAmount = 0.0002;", // dithering amount

			"const float diffArea = 0.4;", 		// self-shadowing reduction
			"const float gDisplace = 0.4;", 	// gauss bell center

			"const bool onlyAO = false;", 		// use only ambient occlusion pass?
			"const float lumInfluence = 0.3;",  // how much luminance affects occlusion

			// RGBA depth

			"float unpackDepth( const in vec4 rgba_depth ) {",

				"const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );",
				"float depth = dot( rgba_depth, bit_shift );",
				"return depth;",

			"}",

			// generating noise / pattern texture for dithering

			"vec2 rand( const vec2 coord ) {",

				"vec2 noise;",

				"if ( useNoise ) {",

					"float nx = dot ( coord, vec2( 12.9898, 78.233 ) );",
					"float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );",

					"noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );",

				"} else {",

					"float ff = fract( 1.0 - coord.s * ( width / 2.0 ) );",
					"float gg = fract( coord.t * ( height / 2.0 ) );",

					"noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;",

				"}",

				"return ( noise * 2.0  - 1.0 ) * noiseAmount;",

			"}",

			"float doFog() {",

				"float zdepth = unpackDepth( texture2D( tDepth, vUv ) );",
				"float depth = -cameraFar * cameraNear / ( zdepth * cameraFarMinusNear - cameraFar );",

				"return smoothstep( fogNear, fogFar, depth );",

			"}",

			"float readDepth( const in vec2 coord ) {",

				//"return ( 2.0 * cameraNear ) / ( cameraFar + cameraNear - unpackDepth( texture2D( tDepth, coord ) ) * ( cameraFar - cameraNear ) );",
				"return cameraCoef / ( cameraFarPlusNear - unpackDepth( texture2D( tDepth, coord ) ) * cameraFarMinusNear );",


			"}",

			"float compareDepths( const in float depth1, const in float depth2, inout int far ) {",

				"float garea = 2.0;", 						 // gauss bell width
				"float diff = ( depth1 - depth2 ) * 100.0;", // depth difference (0-100)

				// reduce left bell width to avoid self-shadowing

				"if ( diff < gDisplace ) {",

					"garea = diffArea;",

				"} else {",

					"far = 1;",

				"}",

				"float dd = diff - gDisplace;",
				"float gauss = pow( EULER, -2.0 * dd * dd / ( garea * garea ) );",
				"return gauss;",

			"}",

			"float calcAO( float depth, float dw, float dh ) {",

				"float dd = radius - depth * radius;",
				"vec2 vv = vec2( dw, dh );",

				"vec2 coord1 = vUv + dd * vv;",
				"vec2 coord2 = vUv - dd * vv;",

				"float temp1 = 0.0;",
				"float temp2 = 0.0;",

				"int far = 0;",
				"temp1 = compareDepths( depth, readDepth( coord1 ), far );",

				// DEPTH EXTRAPOLATION

				"if ( far > 0 ) {",

					"temp2 = compareDepths( readDepth( coord2 ), depth, far );",
					"temp1 += ( 1.0 - temp1 ) * temp2;",

				"}",

				"return temp1;",

			"}",

			"void main() {",

				"vec2 noise = rand( vUv );",
				"float depth = readDepth( vUv );",

				"float tt = clamp( depth, aoClamp, 1.0 );",

				"float w = ( 1.0 / width )  / tt + ( noise.x * ( 1.0 - noise.x ) );",
				"float h = ( 1.0 / height ) / tt + ( noise.y * ( 1.0 - noise.y ) );",

				"float pw;",
				"float ph;",

				"float ao;",

				"float dz = 1.0 / float( samples );",
				"float z = 1.0 - dz / 2.0;",
				"float l = 0.0;",

				"for ( int i = 0; i <= samples; i ++ ) {",

					"float r = sqrt( 1.0 - z );",

					"pw = cos( l ) * r;",
					"ph = sin( l ) * r;",
					"ao += calcAO( depth, pw * w, ph * h );",
					"z = z - dz;",
					"l = l + DL;",

				"}",

				"ao /= float( samples );",
				"ao = 1.0 - ao;",

				"if ( fogEnabled ) {",

					"ao = mix( ao, 1.0, doFog() );",

				"}",

				"vec3 color = texture2D( tDiffuse, vUv ).rgb;",

				"vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );",
				"float lum = dot( color.rgb, lumcoeff );",
				"vec3 luminance = vec3( lum );",

				"vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );", // mix( color * ao, white, luminance )

				"if ( onlyAO ) {",

					"final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );", // ambient occlusion only

				"}",

				"gl_FragColor = vec4( final, 1.0 );",

			"}"

		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Colorify shader
	 ------------------------------------------------------------------------- */

	'colorify': {

		uniforms: {

			tDiffuse: { type: "t", value: 0, texture: null },
			color:    { type: "c", value: new THREE.Color( 0xffffff ) }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform vec3 color;",
			"uniform sampler2D tDiffuse;",

			"varying vec2 vUv;",

			"void main() {",

				"vec4 texel = texture2D( tDiffuse, vUv );",

				"vec3 luma = vec3( 0.299, 0.587, 0.114 );",
				"float v = dot( texel.xyz, luma );",

				"gl_FragColor = vec4( v * color, texel.w );",

			"}"

		].join("\n")

	},

	/* -------------------------------------------------------------------------
	//	Unpack RGBA depth shader
	//	- show RGBA encoded depth as monochrome color
	 ------------------------------------------------------------------------- */

	'unpackDepthRGBA': {

		uniforms: {

			tDiffuse: { type: "t", value: 0, texture: null },
			opacity:  { type: "f", value: 1.0 }

		},

		vertexShader: [

			"varying vec2 vUv;",

			"void main() {",

				"vUv = vec2( uv.x, 1.0 - uv.y );",
				"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",

			"}"

		].join("\n"),

		fragmentShader: [

			"uniform float opacity;",

			"uniform sampler2D tDiffuse;",

			"varying vec2 vUv;",

			// RGBA depth

			"float unpackDepth( const in vec4 rgba_depth ) {",

				"const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );",
				"float depth = dot( rgba_depth, bit_shift );",
				"return depth;",

			"}",

			"void main() {",

				"float depth = 1.0 - unpackDepth( texture2D( tDiffuse, vUv ) );",
				"gl_FragColor = opacity * vec4( vec3( depth ), 1.0 );",

			"}"

		].join("\n")

	},

	// METHODS

	buildKernel: function( sigma ) {

		// We lop off the sqrt(2 * pi) * sigma term, since we're going to normalize anyway.

		function gauss( x, sigma ) {

			return Math.exp( - ( x * x ) / ( 2.0 * sigma * sigma ) );

		}

		var i, values, sum, halfWidth, kMaxKernelSize = 25, kernelSize = 2 * Math.ceil( sigma * 3.0 ) + 1;

		if ( kernelSize > kMaxKernelSize ) kernelSize = kMaxKernelSize;
		halfWidth = ( kernelSize - 1 ) * 0.5

		values = new Array( kernelSize );
		sum = 0.0;
		for ( i = 0; i < kernelSize; ++i ) {

			values[ i ] = gauss( i - halfWidth, sigma );
			sum += values[ i ];

		}

		// normalize the kernel

		for ( i = 0; i < kernelSize; ++i ) values[ i ] /= sum;

		return values;

	}

};


================================================
FILE: Downsample/vendor/three.js/Stats.js
================================================
// stats.js r8 - http://github.com/mrdoob/stats.js
var Stats=function(){var h,a,n=0,o=0,i=Date.now(),u=i,p=i,l=0,q=1E3,r=0,e,j,f,b=[[16,16,48],[0,255,255]],m=0,s=1E3,t=0,d,k,g,c=[[16,48,16],[0,255,0]];h=document.createElement("div");h.style.cursor="pointer";h.style.width="80px";h.style.opacity="0.9";h.style.zIndex="10001";h.addEventListener("mousedown",function(a){a.preventDefault();n=(n+1)%2;n==0?(e.style.display="block",d.style.display="none"):(e.style.display="none",d.style.display="block")},!1);e=document.createElement("div");e.style.textAlign=
"left";e.style.lineHeight="1.2em";e.style.backgroundColor="rgb("+Math.floor(b[0][0]/2)+","+Math.floor(b[0][1]/2)+","+Math.floor(b[0][2]/2)+")";e.style.padding="0 0 3px 3px";h.appendChild(e);j=document.createElement("div");j.style.fontFamily="Helvetica, Arial, sans-serif";j.style.fontSize="9px";j.style.color="rgb("+b[1][0]+","+b[1][1]+","+b[1][2]+")";j.style.fontWeight="bold";j.innerHTML="FPS";e.appendChild(j);f=document.createElement("div");f.style.position="relative";f.style.width="74px";f.style.height=
"30px";f.style.backgroundColor="rgb("+b[1][0]+","+b[1][1]+","+b[1][2]+")";for(e.appendChild(f);f.children.length<74;)a=document.createElement("span"),a.style.width="1px",a.style.height="30px",a.style.cssFloat="left",a.style.backgroundColor="rgb("+b[0][0]+","+b[0][1]+","+b[0][2]+")",f.appendChild(a);d=document.createElement("div");d.style.textAlign="left";d.style.lineHeight="1.2em";d.style.backgroundColor="rgb("+Math.floor(c[0][0]/2)+","+Math.floor(c[0][1]/2)+","+Math.floor(c[0][2]/2)+")";d.style.padding=
"0 0 3px
Download .txt
gitextract_98ry2z6h/

├── Arrays/
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── data_structures/
│   │   ├── linked_list.js
│   │   ├── ordered_array.js
│   │   └── unordered_array.js
│   ├── particles.html
│   ├── require.js
│   └── test_cases/
│       ├── particles.js
│       ├── test_construct.js
│       └── test_particles.js
├── DataStructures/
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── index.html
│   ├── require.js
│   ├── structures/
│   │   ├── list.js
│   │   ├── pma.js
│   │   ├── unordered_vector.js
│   │   └── vector.js
│   └── tests/
│       ├── particles.js
│       └── test_particles.js
├── Downsample/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── experiment.txt
│   ├── index.html
│   ├── js/
│   │   ├── boxfilter.js
│   │   ├── closing.js
│   │   ├── marchingcubes.js
│   │   ├── marchingtetrahedra.js
│   │   ├── maxfilter.js
│   │   ├── medianfilter.js
│   │   ├── minfilter.js
│   │   ├── nearestfilter.js
│   │   ├── opening.js
│   │   ├── perlinnoise.js
│   │   ├── surfacenets.js
│   │   └── testdata.js
│   └── vendor/
│       ├── dsp.js
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── Isosurface/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── experiment.txt
│   ├── index.html
│   ├── js/
│   │   ├── benchmark.js
│   │   ├── marchingcubes.js
│   │   ├── marchingtetrahedra.js
│   │   ├── perlinnoise.js
│   │   ├── surfacenets.js
│   │   └── testdata.js
│   └── vendor/
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── LevelOfDetail/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── js/
│   │   ├── boxfilter.js
│   │   ├── closing.js
│   │   ├── marchingcubes.js
│   │   ├── marchingtetrahedra.js
│   │   ├── maxfilter.js
│   │   ├── medianfilter.js
│   │   ├── minfilter.js
│   │   ├── nearestfilter.js
│   │   ├── opening.js
│   │   ├── perlinnoise.js
│   │   ├── surfacenets.js
│   │   └── testdata.js
│   └── vendor/
│       ├── dsp.js
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── MeshLife/
│   ├── bundle.js
│   ├── index.html
│   └── main.css
├── MeshSimplify/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── experiment.txt
│   ├── index.html
│   ├── js/
│   │   ├── marchingcubes.js
│   │   ├── marchingtetrahedra.js
│   │   ├── montecarlo.js
│   │   ├── surfacenets.js
│   │   ├── testdata.js
│   │   └── triangle_index.js
│   └── vendor/
│       ├── dsp.js
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── MinecraftMeshes/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── index.html
│   ├── js/
│   │   ├── culled.js
│   │   ├── greedy.js
│   │   ├── stupid.js
│   │   └── testdata.js
│   └── vendor/
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── MinecraftMeshes2/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── experiments.txt
│   ├── index.html
│   ├── js/
│   │   ├── benchmark.js
│   │   ├── culled.js
│   │   ├── greedy.js
│   │   ├── greedy_tri.js
│   │   ├── monotone.js
│   │   ├── stupid.js
│   │   └── testdata.js
│   └── vendor/
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── Pictures/
│   └── test_smooth.py
├── Resources/
│   ├── brep.js
│   ├── glow_shell.js
│   ├── lib/
│   │   └── GLOW.js
│   ├── models/
│   │   ├── bunny.js
│   │   ├── bunny.obj
│   │   ├── convert_three.js
│   │   └── teapot.js
│   ├── surfacenets.js
│   └── tools/
│       └── convert_obj.js
├── ShapeCarving/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── experiments.txt
│   ├── index.html
│   ├── js/
│   │   ├── benchmark.js
│   │   ├── culled.js
│   │   ├── greedy.js
│   │   ├── greedy_tri.js
│   │   ├── monotone.js
│   │   ├── shapecarve.js
│   │   ├── stupid.js
│   │   └── testdata.js
│   ├── jscolor/
│   │   ├── demo.html
│   │   └── jscolor.js
│   └── vendor/
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── TJunctions/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── index.html
│   └── vendor/
│       ├── three.js/
│       │   ├── Detector.js
│       │   ├── ShaderExtras.js
│       │   ├── Stats.js
│       │   ├── Three.js
│       │   └── postprocessing/
│       │       ├── BloomPass.js
│       │       ├── DotScreenPass.js
│       │       ├── EffectComposer.js
│       │       ├── FilmPass.js
│       │       ├── MaskPass.js
│       │       ├── RenderPass.js
│       │       ├── SavePass.js
│       │       ├── ShaderPass.js
│       │       └── TexturePass.js
│       ├── threex/
│       │   ├── Makefile
│       │   ├── README.md
│       │   ├── THREEx.CelShader.js
│       │   ├── THREEx.DeviceOrientationState.js
│       │   ├── THREEx.FullScreen.js
│       │   ├── THREEx.GeometryUtils.js
│       │   ├── THREEx.GeometryWobble.js
│       │   ├── THREEx.KeyboardState.js
│       │   ├── THREEx.LogoTurtle.js
│       │   ├── THREEx.PlasmaShader.js
│       │   ├── THREEx.SkyMap.js
│       │   ├── THREEx.WindowResize.js
│       │   ├── THREEx.glCapability.js
│       │   ├── THREEx.requestAnimationFrame.js
│       │   ├── THREEx.screenshot.js
│       │   ├── docs/
│       │   │   ├── THREEx.CelShader.html
│       │   │   ├── THREEx.CubeMap.html
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.FullScreen.html
│       │   │   ├── THREEx.GeometryUtils.html
│       │   │   ├── THREEx.GeometryWobble.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── THREEx.LogoTurtle.html
│       │   │   ├── THREEx.PlasmaShader.html
│       │   │   ├── THREEx.SkyMap.html
│       │   │   ├── THREEx.WindowResize.html
│       │   │   ├── THREEx.glCapability.html
│       │   │   ├── THREEx.requestAnimationFrame.html
│       │   │   ├── THREEx.screenshot.html
│       │   │   └── docco.css
│       │   ├── examples/
│       │   │   ├── THREEx.DeviceOrientationState.html
│       │   │   ├── THREEx.KeyboardState.html
│       │   │   ├── threex.embedded/
│       │   │   │   ├── noshield-host.html
│       │   │   │   ├── noshield-iframe.html
│       │   │   │   ├── withshield-host.html
│       │   │   │   └── withshield-iframe.html
│       │   │   └── threex.fullscreen.html
│       │   ├── threex.chromeWebStoreInstall.js
│       │   ├── threex.embedded.js
│       │   ├── threex.sparks.js
│       │   └── threex.texturePoolBall.js
│       └── threex.dragpancontrols.js
├── Terrain/
│   ├── MIT-LICENSE.txt
│   ├── Makefile
│   ├── css/
│   │   └── main.css
│   ├── index.html
│   ├── index.html~
│   ├── js/
│   │   ├── dualcontour.js
│   │   ├── events.js
│   │   ├── perlinnoise.js
│   │   ├── testdata.js
│   │   └── webgl.js
│   └── require.js
└── resume.html
Download .txt
SYMBOL INDEX (1134 symbols across 82 files)

FILE: Arrays/data_structures/linked_list.js
  function Cell (line 1) | function Cell(prev, next, value) {
  function List (line 7) | function List(head, tail) {

FILE: Arrays/test_cases/particles.js
  function Particle (line 2) | function Particle() {

FILE: DataStructures/structures/list.js
  function Cell (line 3) | function Cell(next, prev, value) {

FILE: DataStructures/structures/pma.js
  function set_levels (line 14) | function set_levels(nlevels) {
  function rebalance (line 26) | function rebalance(lo, hi) {

FILE: DataStructures/structures/vector.js
  function check_resize (line 11) | function check_resize() {

FILE: Downsample/js/boxfilter.js
  function BoxFilter (line 3) | function BoxFilter(volume, dims) {

FILE: Downsample/js/closing.js
  function ClosingFilter (line 3) | function ClosingFilter(volume, dims) {

FILE: Downsample/js/marchingtetrahedra.js
  function interp (line 38) | function interp(i0, i1) {

FILE: Downsample/js/maxfilter.js
  function MaxFilter (line 3) | function MaxFilter(volume, dims) {

FILE: Downsample/js/medianfilter.js
  function MedianFilter (line 3) | function MedianFilter(volume, dims) {

FILE: Downsample/js/minfilter.js
  function MinFilter (line 3) | function MinFilter(volume, dims) {

FILE: Downsample/js/nearestfilter.js
  function NearestFilter (line 3) | function NearestFilter(volume, dims) {

FILE: Downsample/js/opening.js
  function OpeningFilter (line 3) | function OpeningFilter(volume, dims) {

FILE: Downsample/js/perlinnoise.js
  function fade (line 51) | function fade(t) { return t * t * t * (t * (t * 6 - 15) + 10); }
  function lerp (line 52) | function lerp( t, a, b) { return a + t * (b - a); }
  function grad (line 53) | function grad(hash, x, y, z) {
  function scale (line 59) | function scale(n) { return (1 + n)/2; }

FILE: Downsample/js/testdata.js
  function createTestData (line 1) | function createTestData() {

FILE: Downsample/vendor/dsp.js
  function setupTypedArray (line 57) | function setupTypedArray(name, fallback) {
  function FourierTransform (line 242) | function FourierTransform(bufferSize, sampleRate) {
  function DFT (line 298) | function DFT(bufferSize, sampleRate) {
  function FFT (line 353) | function FFT(bufferSize, sampleRate) {
  function RFFT (line 554) | function RFFT(bufferSize, sampleRate) {
  function Sampler (line 830) | function Sampler(file, bufferSize, sampleRate, playStart, playEnd, loopS...
  function Oscillator (line 960) | function Oscillator(type, frequency, amplitude, bufferSize, sampleRate) {
  function ADSR (line 1119) | function ADSR(attackLength, decayLength, sustainLevel, sustainLength, re...
  function IIRFilter (line 1215) | function IIRFilter(type, cutoff, resonance, sampleRate) {
  function IIRFilter2 (line 1307) | function IIRFilter2(type, cutoff, resonance, sampleRate) {
  function WindowFunction (line 1371) | function WindowFunction(type, alpha) {
  function sinh (line 1472) | function sinh (arg) {
  function Biquad (line 1491) | function Biquad(type, sampleRate) {
  function GraphicalEq (line 1847) | function GraphicalEq(sampleRate) {
  function MultiDelay (line 1963) | function MultiDelay(maxDelayInSamplesSize, delayInSamples, masterVolume,...
  function SingleDelay (line 2064) | function SingleDelay(maxDelayInSamplesSize, delayInSamples, delayVolume) {
  function Reverb (line 2155) | function Reverb(maxDelayInSamplesSize, delayInSamples, masterVolume, mix...

FILE: Downsample/vendor/three.js/ShaderExtras.js
  function gauss (line 1751) | function gauss( x, sigma ) {

FILE: Downsample/vendor/three.js/Three.js
  function c (line 24) | function c(a,b,c){q.sub(c,a);u=q.dot(b);t=n.add(a,r.copy(b).multiplyScal...
  function d (line 24) | function d(a,b,c,d){q.sub(d,b);n.sub(c,b);r.sub(a,b);s=q.dot(q);w=q.dot(...
  function a (line 29) | function a(){f=d-b;g=e-c}
  function a (line 66) | function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}
  function b (line 66) | function b(){var a=l[j]=l[j]||new THREE.RenderableVertex;j++;return a}
  function c (line 66) | function c(a,b){return b.z-a.z}
  function d (line 66) | function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if...
  function a (line 97) | function a(a,b,c,d,e,f,F){h=a.vertices[b];j=a.vertices[c];
  function b (line 104) | function b(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+...
  function c (line 119) | function c(a){a=
  function d (line 120) | function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}
  function e (line 120) | function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!...
  function f (line 120) | function f(a,c,d,f,g,h){var j=document.createElement("canvas");a[c]=new ...
  function g (line 121) | function g(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}
  function w (line 130) | function w(a){return a%4?4-a%4:0}
  function H (line 130) | function H(a,b){return(new Uint8Array(a,b,1))[0]}
  function E (line 130) | function E(a,b){return(new Uint32Array(a,b,1))[0]}
  function z (line 130) | function z(b,c){var d,e,f,g,h,i,j,k,l=new Uint32Array(a,c,3*b);for(d=0;d...
  function v (line 131) | function v(b,c){var d,e,f,g,h,i,j,k,l,m,n=new Uint32Array(a,c,4*b);for(d...
  function A (line 131) | function A(b,c,d){for(var e,f,g,h,c=new Uint32Array(a,c,3*b),i=new Uint1...
  function J (line 132) | function J(b,c,d){for(var e,f,g,h,i,c=new Uint32Array(a,c,4*b),j=new Uin...
  function K (line 132) | function K(b,c,d,e){for(var f,g,h,i,j,k,l,c=new Uint32Array(a,c,3*b),d=n...
  function R (line 133) | function R(b,c,d,e){for(var f,g,h,i,j,k,l,m,n,c=new Uint32Array(a,c,4*b)...
  function d (line 149) | function d(a,b){return b=="relativeToHTML"?a:l+"/"+a}
  function e (line 149) | function e(){var a;for(m in D.objects)if(!C.objects[m]){u=D.objects[m];i...
  function f (line 151) | function f(a){return function(b){C.geometries[a]=b;e();G=G-1;j.onLoadCom...
  function g (line 151) | function g(a){return function(b){C.geometries[a]=b}}
  function h (line 151) | function h(){j.callbackProgress({totalModels:T,totalTextures:U,loadedMod...
  function b (line 221) | function b(a){if(t!=a)n.globalAlpha=t=a}
  function c (line 221) | function c(a){if(y!=a){switch(a){case THREE.NormalBlending:n.globalCompo...
  function d (line 221) | function d(a){if(s!=a)n.strokeStyle=s=a}
  function e (line 221) | function e(a){if(w!=a)n.fillStyle=w=a}
  function m (line 225) | function m(a){var b,c,d,e;aa.setRGB(0,0,0);Ta.setRGB(0,0,0);Qa.setRGB(0,...
  function p (line 226) | function p(a,b,c,d){var e,f,g,i,h,j;e=0;for(f=a.length;e<f;e++){g=a[e];i...
  function r (line 227) | function r(a,f,g){b(g.opacity);c(g.blending);var i,h,j,k,l,m;if(g instan...
  function s (line 228) | function s(a,e,f,g){b(g.opacity);c(g.blending);n.beginPath();n.moveTo(a....
  function t (line 229) | function t(a,d,e,g,h,l,m,n){f.info.render.vertices=f.info.render.vertice...
  function u (line 234) | function u(a,d,e,g,h,l,n,m,o){f.info.render.vertices=f.info.render.verti...
  function w (line 239) | function w(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c,
  function y (line 240) | function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n....
  function Mb (line 240) | function Mb(a,b,c,e){if(H!=b)n.lineWidth=H=b;if(E!=c)n.lineCap=E=c;if(z!...
  function Eb (line 240) | function Eb(a){e(a.getContextStyle());n.fill()}
  function ad (line 240) | function ad(a,b,c,d,f,g,i,h,j,k,l,m,p){if(p.image.width!=0){if(p.needsUp...
  function gc (line 242) | function gc(a,b,c,d,e,f,g,i,h,j,k,l,m){var p,o;p=m.width-1;o=m.height-1;...
  function Cc (line 243) | function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(...
  function ac (line 244) | function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}
  function hc (line 244) | function hc(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function Nb (line 244) | function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqr...
  function a (line 250) | function a(a,b,c,d){var e,f,g,h,j,k;e=0;for(f=a.length;e<f;e++){g=a[e];h...
  function b (line 251) | function b(a){if(A[a]==null){A[a]=document.createElementNS("http://www.w...
  function c (line 251) | function c(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function b (line 299) | function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if...
  function c (line 300) | function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMat...
  function d (line 300) | function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a ...
  function e (line 300) | function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMateria...
  function f (line 300) | function f(a,b,c){var d,e,f,g,h=a.vertices;g=h.length;
  function g (line 305) | function g(a,b){return b.z-a.z}
  function h (line 305) | function h(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++){ea=U=null;...
  function j (line 305) | function j(a,b,c,d,e,f,g,h){var i,j,k,l;if(b){j=a.length-1;l=b=-1}else{j...
  function l (line 306) | function l(a,b,c,d,e,f,g){for(var h,i,j=0,k=a.length;j<k;j++){h=a[j];i=h...
  function k (line 307) | function k(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}
  function p (line 307) | function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)r...
  function m (line 307) | function m(a){for(var b in a.attributes)a.attributes[b].needsUpdate=false}
  function o (line 307) | function o(a,b){for(var c=a.length-1;c>=0;c--)a[c].object===
  function q (line 308) | function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}
  function n (line 308) | function n(a,b,c,d,e){if(!d.program||d.needsUpdate){G.initMaterial(d,b,c...
  function r (line 324) | function r(a,b){a._modelViewMatrix.multiply(b.matrixWorldInverse,a.matri...
  function u (line 324) | function u(a,b,c){if(Ra!==
  function t (line 325) | function t(a,b){var c;a==="fragment"?c=i.createShader(i.FRAGMENT_SHADER)...
  function y (line 325) | function y(a,b,c){if(c){i.texParameteri(a,i.TEXTURE_WRAP_S,H(b.wrapS));i...
  function s (line 326) | function s(a,b){i.bindRenderbuffer(i.RENDERBUFFER,a);if(b.depthBuffer&&!...
  function w (line 327) | function w(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMa...
  function H (line 328) | function H(a){switch(a){case THREE.RepeatWrapping:return i.REPEAT;case T...
  function c (line 442) | function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2...
  function c (line 564) | function c(a,b){return function(){b.apply(a,arguments)}}
  function c (line 573) | function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}
  function d (line 573) | function d(a,b){return function(){b.apply(a,arguments)}}
  function e (line 573) | function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.g...
  function f (line 574) | function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b...
  function c (line 582) | function c(a,b){return function(){b.apply(a,arguments)}}
  function j (line 607) | function j(a,b,c,g,h,j,k,m){var n,p=d||1,o=e||1,q=h/2,r=j/2,t=l.vertices...
  function c (line 616) | function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(...
  function d (line 616) | function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeomet...
  function e (line 617) | function e(c,d){var e,f;for(F=c.length;--F>=0;){e=F;f=F-1;f<0&&(f=
  function f (line 618) | function f(a,b,c){A.vertices.push(new THREE.Vector3(a,b,c))}
  function g (line 618) | function g(c,d,e,f){c=c+J;d=d+J;e=e+J;A.faces.push(new THREE.Face3(c,d,e...
  function h (line 646) | function h(a,b,c,d,e,f){var g=Math.cos(a);Math.cos(b);b=Math.sin(a);a=c/...
  function e (line 656) | function e(a){var b=a.normalize().clone();b.index=j.vertices.push(b)-1;v...
  function f (line 656) | function f(a,b,c,d){if(d<1){d=new THREE.Face3(a.index,b.index,c.index,[a...
  function g (line 657) | function g(a,b){p[a.index]||(p[a.index]=[]);p[b.index]||(p[b.index]=[]);...
  function h (line 657) | function h(a,b,c){c<0&&a.u===1&&(a=new THREE.UV(a.u-1,a.v));b.x===0&&b.z...
  function b (line 669) | function b(a,b,d){c(a,d);c(b,d)}
  function c (line 669) | function c(a,b){d.lineGeometry.vertices.push(new THREE.Vector3);d.lineGe...
  function a (line 672) | function a(a,d,e,f){THREE.CameraHelper.__v.set(d,e,f);THREE.CameraHelper...
  function b (line 675) | function b(){m.debug&&console.log.apply(console,arguments)}
  function c (line 675) | function c(){console&&console.log.apply(console,arguments)}
  function d (line 675) | function d(a,c,d,e,g,h,i){var j=new THREE.Face4(a,c,d,e,null,g.color,g.m...
  function e (line 676) | function e(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}
  function f (line 676) | function f(a,d){var e=a+":"+d,f=t[e];if(!f){a>=y&&a<y+q.length?b("face p...
  function g (line 676) | function g(a,b,d){var e=a+":"+b;e in t?c("dup vertexNo",a,"oldFaceNo",b,...
  function h (line 676) | function h(a,
  function j (line 677) | function j(a,b,c){P[a]===void 0&&(P[a]={});P[a][b]=c}
  function b (line 678) | function b(a,c){h[a]===void 0&&(h[a]=[]);h[a].push(c)}
  function a (line 695) | function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER...
  function a (line 715) | function a(a,b){return b.z-a.z}

FILE: Isosurface/js/benchmark.js
  function init_volume (line 13) | function init_volume(freq) {

FILE: Isosurface/js/marchingtetrahedra.js
  function interp (line 60) | function interp(i0, i1) {

FILE: Isosurface/js/perlinnoise.js
  function fade (line 51) | function fade(t) { return t * t * t * (t * (t * 6 - 15) + 10); }
  function lerp (line 52) | function lerp( t, a, b) { return a + t * (b - a); }
  function grad (line 53) | function grad(hash, x, y, z) {
  function scale (line 59) | function scale(n) { return (1 + n)/2; }

FILE: Isosurface/js/testdata.js
  function createTestData (line 1) | function createTestData() {

FILE: Isosurface/vendor/three.js/ShaderExtras.js
  function gauss (line 1751) | function gauss( x, sigma ) {

FILE: Isosurface/vendor/three.js/Three.js
  function c (line 24) | function c(a,b,c){q.sub(c,a);u=q.dot(b);t=n.add(a,r.copy(b).multiplyScal...
  function d (line 24) | function d(a,b,c,d){q.sub(d,b);n.sub(c,b);r.sub(a,b);s=q.dot(q);w=q.dot(...
  function a (line 29) | function a(){f=d-b;g=e-c}
  function a (line 66) | function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}
  function b (line 66) | function b(){var a=l[j]=l[j]||new THREE.RenderableVertex;j++;return a}
  function c (line 66) | function c(a,b){return b.z-a.z}
  function d (line 66) | function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if...
  function a (line 97) | function a(a,b,c,d,e,f,F){h=a.vertices[b];j=a.vertices[c];
  function b (line 104) | function b(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+...
  function c (line 119) | function c(a){a=
  function d (line 120) | function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}
  function e (line 120) | function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!...
  function f (line 120) | function f(a,c,d,f,g,h){var j=document.createElement("canvas");a[c]=new ...
  function g (line 121) | function g(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}
  function w (line 130) | function w(a){return a%4?4-a%4:0}
  function H (line 130) | function H(a,b){return(new Uint8Array(a,b,1))[0]}
  function E (line 130) | function E(a,b){return(new Uint32Array(a,b,1))[0]}
  function z (line 130) | function z(b,c){var d,e,f,g,h,i,j,k,l=new Uint32Array(a,c,3*b);for(d=0;d...
  function v (line 131) | function v(b,c){var d,e,f,g,h,i,j,k,l,m,n=new Uint32Array(a,c,4*b);for(d...
  function A (line 131) | function A(b,c,d){for(var e,f,g,h,c=new Uint32Array(a,c,3*b),i=new Uint1...
  function J (line 132) | function J(b,c,d){for(var e,f,g,h,i,c=new Uint32Array(a,c,4*b),j=new Uin...
  function K (line 132) | function K(b,c,d,e){for(var f,g,h,i,j,k,l,c=new Uint32Array(a,c,3*b),d=n...
  function R (line 133) | function R(b,c,d,e){for(var f,g,h,i,j,k,l,m,n,c=new Uint32Array(a,c,4*b)...
  function d (line 149) | function d(a,b){return b=="relativeToHTML"?a:l+"/"+a}
  function e (line 149) | function e(){var a;for(m in D.objects)if(!C.objects[m]){u=D.objects[m];i...
  function f (line 151) | function f(a){return function(b){C.geometries[a]=b;e();G=G-1;j.onLoadCom...
  function g (line 151) | function g(a){return function(b){C.geometries[a]=b}}
  function h (line 151) | function h(){j.callbackProgress({totalModels:T,totalTextures:U,loadedMod...
  function b (line 221) | function b(a){if(t!=a)n.globalAlpha=t=a}
  function c (line 221) | function c(a){if(y!=a){switch(a){case THREE.NormalBlending:n.globalCompo...
  function d (line 221) | function d(a){if(s!=a)n.strokeStyle=s=a}
  function e (line 221) | function e(a){if(w!=a)n.fillStyle=w=a}
  function m (line 225) | function m(a){var b,c,d,e;aa.setRGB(0,0,0);Ta.setRGB(0,0,0);Qa.setRGB(0,...
  function p (line 226) | function p(a,b,c,d){var e,f,g,i,h,j;e=0;for(f=a.length;e<f;e++){g=a[e];i...
  function r (line 227) | function r(a,f,g){b(g.opacity);c(g.blending);var i,h,j,k,l,m;if(g instan...
  function s (line 228) | function s(a,e,f,g){b(g.opacity);c(g.blending);n.beginPath();n.moveTo(a....
  function t (line 229) | function t(a,d,e,g,h,l,m,n){f.info.render.vertices=f.info.render.vertice...
  function u (line 234) | function u(a,d,e,g,h,l,n,m,o){f.info.render.vertices=f.info.render.verti...
  function w (line 239) | function w(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c,
  function y (line 240) | function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n....
  function Mb (line 240) | function Mb(a,b,c,e){if(H!=b)n.lineWidth=H=b;if(E!=c)n.lineCap=E=c;if(z!...
  function Eb (line 240) | function Eb(a){e(a.getContextStyle());n.fill()}
  function ad (line 240) | function ad(a,b,c,d,f,g,i,h,j,k,l,m,p){if(p.image.width!=0){if(p.needsUp...
  function gc (line 242) | function gc(a,b,c,d,e,f,g,i,h,j,k,l,m){var p,o;p=m.width-1;o=m.height-1;...
  function Cc (line 243) | function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(...
  function ac (line 244) | function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}
  function hc (line 244) | function hc(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function Nb (line 244) | function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqr...
  function a (line 250) | function a(a,b,c,d){var e,f,g,h,j,k;e=0;for(f=a.length;e<f;e++){g=a[e];h...
  function b (line 251) | function b(a){if(A[a]==null){A[a]=document.createElementNS("http://www.w...
  function c (line 251) | function c(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function b (line 299) | function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if...
  function c (line 300) | function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMat...
  function d (line 300) | function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a ...
  function e (line 300) | function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMateria...
  function f (line 300) | function f(a,b,c){var d,e,f,g,h=a.vertices;g=h.length;
  function g (line 305) | function g(a,b){return b.z-a.z}
  function h (line 305) | function h(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++){ea=U=null;...
  function j (line 305) | function j(a,b,c,d,e,f,g,h){var i,j,k,l;if(b){j=a.length-1;l=b=-1}else{j...
  function l (line 306) | function l(a,b,c,d,e,f,g){for(var h,i,j=0,k=a.length;j<k;j++){h=a[j];i=h...
  function k (line 307) | function k(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}
  function p (line 307) | function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)r...
  function m (line 307) | function m(a){for(var b in a.attributes)a.attributes[b].needsUpdate=false}
  function o (line 307) | function o(a,b){for(var c=a.length-1;c>=0;c--)a[c].object===
  function q (line 308) | function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}
  function n (line 308) | function n(a,b,c,d,e){if(!d.program||d.needsUpdate){G.initMaterial(d,b,c...
  function r (line 324) | function r(a,b){a._modelViewMatrix.multiply(b.matrixWorldInverse,a.matri...
  function u (line 324) | function u(a,b,c){if(Ra!==
  function t (line 325) | function t(a,b){var c;a==="fragment"?c=i.createShader(i.FRAGMENT_SHADER)...
  function y (line 325) | function y(a,b,c){if(c){i.texParameteri(a,i.TEXTURE_WRAP_S,H(b.wrapS));i...
  function s (line 326) | function s(a,b){i.bindRenderbuffer(i.RENDERBUFFER,a);if(b.depthBuffer&&!...
  function w (line 327) | function w(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMa...
  function H (line 328) | function H(a){switch(a){case THREE.RepeatWrapping:return i.REPEAT;case T...
  function c (line 442) | function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2...
  function c (line 564) | function c(a,b){return function(){b.apply(a,arguments)}}
  function c (line 573) | function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}
  function d (line 573) | function d(a,b){return function(){b.apply(a,arguments)}}
  function e (line 573) | function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.g...
  function f (line 574) | function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b...
  function c (line 582) | function c(a,b){return function(){b.apply(a,arguments)}}
  function j (line 607) | function j(a,b,c,g,h,j,k,m){var n,p=d||1,o=e||1,q=h/2,r=j/2,t=l.vertices...
  function c (line 616) | function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(...
  function d (line 616) | function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeomet...
  function e (line 617) | function e(c,d){var e,f;for(F=c.length;--F>=0;){e=F;f=F-1;f<0&&(f=
  function f (line 618) | function f(a,b,c){A.vertices.push(new THREE.Vector3(a,b,c))}
  function g (line 618) | function g(c,d,e,f){c=c+J;d=d+J;e=e+J;A.faces.push(new THREE.Face3(c,d,e...
  function h (line 646) | function h(a,b,c,d,e,f){var g=Math.cos(a);Math.cos(b);b=Math.sin(a);a=c/...
  function e (line 656) | function e(a){var b=a.normalize().clone();b.index=j.vertices.push(b)-1;v...
  function f (line 656) | function f(a,b,c,d){if(d<1){d=new THREE.Face3(a.index,b.index,c.index,[a...
  function g (line 657) | function g(a,b){p[a.index]||(p[a.index]=[]);p[b.index]||(p[b.index]=[]);...
  function h (line 657) | function h(a,b,c){c<0&&a.u===1&&(a=new THREE.UV(a.u-1,a.v));b.x===0&&b.z...
  function b (line 669) | function b(a,b,d){c(a,d);c(b,d)}
  function c (line 669) | function c(a,b){d.lineGeometry.vertices.push(new THREE.Vector3);d.lineGe...
  function a (line 672) | function a(a,d,e,f){THREE.CameraHelper.__v.set(d,e,f);THREE.CameraHelper...
  function b (line 675) | function b(){m.debug&&console.log.apply(console,arguments)}
  function c (line 675) | function c(){console&&console.log.apply(console,arguments)}
  function d (line 675) | function d(a,c,d,e,g,h,i){var j=new THREE.Face4(a,c,d,e,null,g.color,g.m...
  function e (line 676) | function e(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}
  function f (line 676) | function f(a,d){var e=a+":"+d,f=t[e];if(!f){a>=y&&a<y+q.length?b("face p...
  function g (line 676) | function g(a,b,d){var e=a+":"+b;e in t?c("dup vertexNo",a,"oldFaceNo",b,...
  function h (line 676) | function h(a,
  function j (line 677) | function j(a,b,c){P[a]===void 0&&(P[a]={});P[a][b]=c}
  function b (line 678) | function b(a,c){h[a]===void 0&&(h[a]=[]);h[a].push(c)}
  function a (line 695) | function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER...
  function a (line 715) | function a(a,b){return b.z-a.z}

FILE: LevelOfDetail/js/boxfilter.js
  function BoxFilter (line 3) | function BoxFilter(volume, dims) {

FILE: LevelOfDetail/js/closing.js
  function ClosingFilter (line 3) | function ClosingFilter(volume, dims) {

FILE: LevelOfDetail/js/marchingtetrahedra.js
  function interp (line 38) | function interp(i0, i1) {

FILE: LevelOfDetail/js/maxfilter.js
  function MaxFilter (line 3) | function MaxFilter(volume, dims) {

FILE: LevelOfDetail/js/medianfilter.js
  function MedianFilter (line 3) | function MedianFilter(volume, dims) {

FILE: LevelOfDetail/js/minfilter.js
  function MinFilter (line 3) | function MinFilter(volume, dims) {

FILE: LevelOfDetail/js/nearestfilter.js
  function NearestFilter (line 3) | function NearestFilter(volume, dims) {

FILE: LevelOfDetail/js/opening.js
  function OpeningFilter (line 3) | function OpeningFilter(volume, dims) {

FILE: LevelOfDetail/js/perlinnoise.js
  function fade (line 51) | function fade(t) { return t * t * t * (t * (t * 6 - 15) + 10); }
  function lerp (line 52) | function lerp( t, a, b) { return a + t * (b - a); }
  function grad (line 53) | function grad(hash, x, y, z) {
  function scale (line 59) | function scale(n) { return (1 + n)/2; }

FILE: LevelOfDetail/js/testdata.js
  function createTestData (line 1) | function createTestData() {

FILE: LevelOfDetail/vendor/dsp.js
  function setupTypedArray (line 57) | function setupTypedArray(name, fallback) {
  function FourierTransform (line 242) | function FourierTransform(bufferSize, sampleRate) {
  function DFT (line 298) | function DFT(bufferSize, sampleRate) {
  function FFT (line 353) | function FFT(bufferSize, sampleRate) {
  function RFFT (line 554) | function RFFT(bufferSize, sampleRate) {
  function Sampler (line 830) | function Sampler(file, bufferSize, sampleRate, playStart, playEnd, loopS...
  function Oscillator (line 960) | function Oscillator(type, frequency, amplitude, bufferSize, sampleRate) {
  function ADSR (line 1119) | function ADSR(attackLength, decayLength, sustainLevel, sustainLength, re...
  function IIRFilter (line 1215) | function IIRFilter(type, cutoff, resonance, sampleRate) {
  function IIRFilter2 (line 1307) | function IIRFilter2(type, cutoff, resonance, sampleRate) {
  function WindowFunction (line 1371) | function WindowFunction(type, alpha) {
  function sinh (line 1472) | function sinh (arg) {
  function Biquad (line 1491) | function Biquad(type, sampleRate) {
  function GraphicalEq (line 1847) | function GraphicalEq(sampleRate) {
  function MultiDelay (line 1963) | function MultiDelay(maxDelayInSamplesSize, delayInSamples, masterVolume,...
  function SingleDelay (line 2064) | function SingleDelay(maxDelayInSamplesSize, delayInSamples, delayVolume) {
  function Reverb (line 2155) | function Reverb(maxDelayInSamplesSize, delayInSamples, masterVolume, mix...

FILE: LevelOfDetail/vendor/three.js/ShaderExtras.js
  function gauss (line 1751) | function gauss( x, sigma ) {

FILE: LevelOfDetail/vendor/three.js/Three.js
  function c (line 24) | function c(a,b,c){q.sub(c,a);u=q.dot(b);t=n.add(a,r.copy(b).multiplyScal...
  function d (line 24) | function d(a,b,c,d){q.sub(d,b);n.sub(c,b);r.sub(a,b);s=q.dot(q);w=q.dot(...
  function a (line 29) | function a(){f=d-b;g=e-c}
  function a (line 66) | function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}
  function b (line 66) | function b(){var a=l[j]=l[j]||new THREE.RenderableVertex;j++;return a}
  function c (line 66) | function c(a,b){return b.z-a.z}
  function d (line 66) | function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if...
  function a (line 97) | function a(a,b,c,d,e,f,F){h=a.vertices[b];j=a.vertices[c];
  function b (line 104) | function b(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+...
  function c (line 119) | function c(a){a=
  function d (line 120) | function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}
  function e (line 120) | function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!...
  function f (line 120) | function f(a,c,d,f,g,h){var j=document.createElement("canvas");a[c]=new ...
  function g (line 121) | function g(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}
  function w (line 130) | function w(a){return a%4?4-a%4:0}
  function H (line 130) | function H(a,b){return(new Uint8Array(a,b,1))[0]}
  function E (line 130) | function E(a,b){return(new Uint32Array(a,b,1))[0]}
  function z (line 130) | function z(b,c){var d,e,f,g,h,i,j,k,l=new Uint32Array(a,c,3*b);for(d=0;d...
  function v (line 131) | function v(b,c){var d,e,f,g,h,i,j,k,l,m,n=new Uint32Array(a,c,4*b);for(d...
  function A (line 131) | function A(b,c,d){for(var e,f,g,h,c=new Uint32Array(a,c,3*b),i=new Uint1...
  function J (line 132) | function J(b,c,d){for(var e,f,g,h,i,c=new Uint32Array(a,c,4*b),j=new Uin...
  function K (line 132) | function K(b,c,d,e){for(var f,g,h,i,j,k,l,c=new Uint32Array(a,c,3*b),d=n...
  function R (line 133) | function R(b,c,d,e){for(var f,g,h,i,j,k,l,m,n,c=new Uint32Array(a,c,4*b)...
  function d (line 149) | function d(a,b){return b=="relativeToHTML"?a:l+"/"+a}
  function e (line 149) | function e(){var a;for(m in D.objects)if(!C.objects[m]){u=D.objects[m];i...
  function f (line 151) | function f(a){return function(b){C.geometries[a]=b;e();G=G-1;j.onLoadCom...
  function g (line 151) | function g(a){return function(b){C.geometries[a]=b}}
  function h (line 151) | function h(){j.callbackProgress({totalModels:T,totalTextures:U,loadedMod...
  function b (line 221) | function b(a){if(t!=a)n.globalAlpha=t=a}
  function c (line 221) | function c(a){if(y!=a){switch(a){case THREE.NormalBlending:n.globalCompo...
  function d (line 221) | function d(a){if(s!=a)n.strokeStyle=s=a}
  function e (line 221) | function e(a){if(w!=a)n.fillStyle=w=a}
  function m (line 225) | function m(a){var b,c,d,e;aa.setRGB(0,0,0);Ta.setRGB(0,0,0);Qa.setRGB(0,...
  function p (line 226) | function p(a,b,c,d){var e,f,g,i,h,j;e=0;for(f=a.length;e<f;e++){g=a[e];i...
  function r (line 227) | function r(a,f,g){b(g.opacity);c(g.blending);var i,h,j,k,l,m;if(g instan...
  function s (line 228) | function s(a,e,f,g){b(g.opacity);c(g.blending);n.beginPath();n.moveTo(a....
  function t (line 229) | function t(a,d,e,g,h,l,m,n){f.info.render.vertices=f.info.render.vertice...
  function u (line 234) | function u(a,d,e,g,h,l,n,m,o){f.info.render.vertices=f.info.render.verti...
  function w (line 239) | function w(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c,
  function y (line 240) | function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n....
  function Mb (line 240) | function Mb(a,b,c,e){if(H!=b)n.lineWidth=H=b;if(E!=c)n.lineCap=E=c;if(z!...
  function Eb (line 240) | function Eb(a){e(a.getContextStyle());n.fill()}
  function ad (line 240) | function ad(a,b,c,d,f,g,i,h,j,k,l,m,p){if(p.image.width!=0){if(p.needsUp...
  function gc (line 242) | function gc(a,b,c,d,e,f,g,i,h,j,k,l,m){var p,o;p=m.width-1;o=m.height-1;...
  function Cc (line 243) | function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(...
  function ac (line 244) | function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}
  function hc (line 244) | function hc(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function Nb (line 244) | function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqr...
  function a (line 250) | function a(a,b,c,d){var e,f,g,h,j,k;e=0;for(f=a.length;e<f;e++){g=a[e];h...
  function b (line 251) | function b(a){if(A[a]==null){A[a]=document.createElementNS("http://www.w...
  function c (line 251) | function c(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function b (line 299) | function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if...
  function c (line 300) | function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMat...
  function d (line 300) | function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a ...
  function e (line 300) | function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMateria...
  function f (line 300) | function f(a,b,c){var d,e,f,g,h=a.vertices;g=h.length;
  function g (line 305) | function g(a,b){return b.z-a.z}
  function h (line 305) | function h(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++){ea=U=null;...
  function j (line 305) | function j(a,b,c,d,e,f,g,h){var i,j,k,l;if(b){j=a.length-1;l=b=-1}else{j...
  function l (line 306) | function l(a,b,c,d,e,f,g){for(var h,i,j=0,k=a.length;j<k;j++){h=a[j];i=h...
  function k (line 307) | function k(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}
  function p (line 307) | function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)r...
  function m (line 307) | function m(a){for(var b in a.attributes)a.attributes[b].needsUpdate=false}
  function o (line 307) | function o(a,b){for(var c=a.length-1;c>=0;c--)a[c].object===
  function q (line 308) | function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}
  function n (line 308) | function n(a,b,c,d,e){if(!d.program||d.needsUpdate){G.initMaterial(d,b,c...
  function r (line 324) | function r(a,b){a._modelViewMatrix.multiply(b.matrixWorldInverse,a.matri...
  function u (line 324) | function u(a,b,c){if(Ra!==
  function t (line 325) | function t(a,b){var c;a==="fragment"?c=i.createShader(i.FRAGMENT_SHADER)...
  function y (line 325) | function y(a,b,c){if(c){i.texParameteri(a,i.TEXTURE_WRAP_S,H(b.wrapS));i...
  function s (line 326) | function s(a,b){i.bindRenderbuffer(i.RENDERBUFFER,a);if(b.depthBuffer&&!...
  function w (line 327) | function w(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMa...
  function H (line 328) | function H(a){switch(a){case THREE.RepeatWrapping:return i.REPEAT;case T...
  function c (line 442) | function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2...
  function c (line 564) | function c(a,b){return function(){b.apply(a,arguments)}}
  function c (line 573) | function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}
  function d (line 573) | function d(a,b){return function(){b.apply(a,arguments)}}
  function e (line 573) | function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.g...
  function f (line 574) | function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b...
  function c (line 582) | function c(a,b){return function(){b.apply(a,arguments)}}
  function j (line 607) | function j(a,b,c,g,h,j,k,m){var n,p=d||1,o=e||1,q=h/2,r=j/2,t=l.vertices...
  function c (line 616) | function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(...
  function d (line 616) | function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeomet...
  function e (line 617) | function e(c,d){var e,f;for(F=c.length;--F>=0;){e=F;f=F-1;f<0&&(f=
  function f (line 618) | function f(a,b,c){A.vertices.push(new THREE.Vector3(a,b,c))}
  function g (line 618) | function g(c,d,e,f){c=c+J;d=d+J;e=e+J;A.faces.push(new THREE.Face3(c,d,e...
  function h (line 646) | function h(a,b,c,d,e,f){var g=Math.cos(a);Math.cos(b);b=Math.sin(a);a=c/...
  function e (line 656) | function e(a){var b=a.normalize().clone();b.index=j.vertices.push(b)-1;v...
  function f (line 656) | function f(a,b,c,d){if(d<1){d=new THREE.Face3(a.index,b.index,c.index,[a...
  function g (line 657) | function g(a,b){p[a.index]||(p[a.index]=[]);p[b.index]||(p[b.index]=[]);...
  function h (line 657) | function h(a,b,c){c<0&&a.u===1&&(a=new THREE.UV(a.u-1,a.v));b.x===0&&b.z...
  function b (line 669) | function b(a,b,d){c(a,d);c(b,d)}
  function c (line 669) | function c(a,b){d.lineGeometry.vertices.push(new THREE.Vector3);d.lineGe...
  function a (line 672) | function a(a,d,e,f){THREE.CameraHelper.__v.set(d,e,f);THREE.CameraHelper...
  function b (line 675) | function b(){m.debug&&console.log.apply(console,arguments)}
  function c (line 675) | function c(){console&&console.log.apply(console,arguments)}
  function d (line 675) | function d(a,c,d,e,g,h,i){var j=new THREE.Face4(a,c,d,e,null,g.color,g.m...
  function e (line 676) | function e(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}
  function f (line 676) | function f(a,d){var e=a+":"+d,f=t[e];if(!f){a>=y&&a<y+q.length?b("face p...
  function g (line 676) | function g(a,b,d){var e=a+":"+b;e in t?c("dup vertexNo",a,"oldFaceNo",b,...
  function h (line 676) | function h(a,
  function j (line 677) | function j(a,b,c){P[a]===void 0&&(P[a]={});P[a][b]=c}
  function b (line 678) | function b(a,c){h[a]===void 0&&(h[a]=[]);h[a].push(c)}
  function a (line 695) | function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER...
  function a (line 715) | function a(a,b){return b.z-a.z}

FILE: MeshLife/bundle.js
  function loadAsFileSync (line 45) | function loadAsFileSync (x) {
  function loadAsDirectorySync (line 57) | function loadAsDirectorySync (x) {
  function loadNodeModulesSync (line 80) | function loadNodeModulesSync (x, start) {
  function nodeModulesPathsSync (line 94) | function nodeModulesPathsSync (start) {
  function filter (line 199) | function filter (xs, fn) {
  function normalizeArray (line 211) | function normalizeArray(parts, allowAboveRoot) {
  function vmax (line 430) | function vmax(faces) {
  function fuse_vertices (line 519) | function fuse_vertices(args) {
  function interp (line 1004) | function interp(i0, i1) {
  function quadratic_distance (line 1484) | function quadratic_distance(a, b, c, dpa, dpb, orientation) {
  function Pair (line 1533) | function Pair(d,v) {
  function dijkstra (line 1539) | function dijkstra(p, stars, faces, positions, max_distance) {
  function refine_distances (line 1585) | function refine_distances(p, distances, positions, stars, faces, max_dis...
  function geodesic_distance (line 1649) | function geodesic_distance(args) {
  function replacer (line 1705) | function replacer(key, value) {
  function truncate (line 1718) | function truncate(s, n) {
  function fail (line 1754) | function fail(actual, expected, message, operator, stackStartFunction) {
  function ok (line 1774) | function ok(value, message) {
  function _deepEqual (line 1805) | function _deepEqual(actual, expected) {
  function isUndefinedOrNull (line 1840) | function isUndefinedOrNull(value) {
  function isArguments (line 1844) | function isArguments(object) {
  function objEquiv (line 1848) | function objEquiv(a, b) {
  function expectedException (line 1918) | function expectedException(actual, expected) {
  function _throws (line 1934) | function _throws(shouldThrow, block, expected, message) {
  function format (line 2029) | function format(value, recurseTimes) {
  function isArray (line 2204) | function isArray(ar) {
  function isRegExp (line 2211) | function isRegExp(re) {
  function isDate (line 2217) | function isDate(d) {
  function pad (line 2225) | function pad(n) {
  function timestamp (line 2233) | function timestamp() {
  function indexOf (line 2339) | function indexOf (xs, x) {
  function SlowBuffer (line 2517) | function SlowBuffer (size) {
  function toHex (line 2526) | function toHex(n) {
  function utf8ToBytes (line 2531) | function utf8ToBytes(str) {
  function asciiToBytes (line 2545) | function asciiToBytes(str) {
  function base64ToBytes (line 2554) | function base64ToBytes(str) {
  function blitBuffer (line 2578) | function blitBuffer(src, dst, offset, length) {
  function decodeUtf8Char (line 2610) | function decodeUtf8Char(str) {
  function coerce (line 2819) | function coerce(length) {
  function Buffer (line 2830) | function Buffer(subject, encoding, offset) {
  function isArrayIsh (line 2888) | function isArrayIsh(subject) {
  function allocPool (line 2900) | function allocPool() {
  function readUInt16 (line 3211) | function readUInt16(buffer, offset, isBigEndian, noAssert) {
  function readUInt32 (line 3245) | function readUInt32(buffer, offset, isBigEndian, noAssert) {
  function readInt16 (line 3348) | function readInt16(buffer, offset, isBigEndian, noAssert) {
  function readInt32 (line 3379) | function readInt32(buffer, offset, isBigEndian, noAssert) {
  function readFloat (line 3410) | function readFloat(buffer, offset, isBigEndian, noAssert) {
  function readDouble (line 3431) | function readDouble(buffer, offset, isBigEndian, noAssert) {
  function verifuint (line 3462) | function verifuint(value, max) {
  function writeUInt16 (line 3493) | function writeUInt16(buffer, value, offset, isBigEndian, noAssert) {
  function writeUInt32 (line 3527) | function writeUInt32(buffer, value, offset, isBigEndian, noAssert) {
  function verifsint (line 3606) | function verifsint(value, max, min) {
  function verifIEEE754 (line 3617) | function verifIEEE754(value, max, min) {
  function writeInt16 (line 3649) | function writeInt16(buffer, value, offset, isBigEndian, noAssert) {
  function writeInt32 (line 3681) | function writeInt32(buffer, value, offset, isBigEndian, noAssert) {
  function writeFloat (line 3713) | function writeFloat(buffer, value, offset, isBigEndian, noAssert) {
  function writeDouble (line 3742) | function writeDouble(buffer, value, offset, isBigEndian, noAssert) {
  function b64ToByteArray (line 3810) | function b64ToByteArray(b64) {
  function uint8ToBase64 (line 3850) | function uint8ToBase64(uint8) {
  function BinaryHeap (line 3983) | function BinaryHeap(scoreFunction){
  function grid_mesh (line 4112) | function grid_mesh(args) {
  function cube_mesh (line 4139) | function cube_mesh(args) {
  function sphere_mesh (line 4198) | function sphere_mesh(args) {
  function opposite (line 4228) | function opposite(u, v, f) {
  function sigmoid (line 4344) | function sigmoid(x, a, b) {
  function sigmoid_n (line 4348) | function sigmoid_n(x, a, b, alpha_n) {
  function ColumnEntry (line 4352) | function ColumnEntry(c, v) {
  function perp (line 4368) | function perp(a, b) {
  function area (line 4380) | function area(a, b, c) {
  function weight (line 4392) | function weight(a, b, c, da, db, dc, r) {
  function stiffness_matrix (line 4463) | function stiffness_matrix(args) {
  function MeshLife (line 4589) | function MeshLife(params) {
  function qmult (line 4698) | function qmult(a, b) {
  function qmatrix (line 4705) | function qmatrix(q) {
  function qcross (line 4711) | function qcross(a, b) {
  function qnormalize (line 4746) | function qnormalize(q) {
  function ArcballCamera (line 4764) | function ArcballCamera() {
  function createMoebius (line 4831) | function createMoebius(u_res, v_res) {
  function createSphere (line 4871) | function createSphere(res) {
  function createTorus (line 4881) | function createTorus(u_res, v_res) {
  function createKlein (line 4915) | function createKlein(u_res, v_res) {
  function hex2rgb (line 5002) | function hex2rgb(hex) {
  function printVec3 (line 5028) | function printVec3(vec) {
  function flatten (line 5033) | function flatten(arr) {
  function getParams (line 5057) | function getParams() {
  function reset (line 5074) | function reset() {
  function rebuild (line 5085) | function rebuild() {
  function init (line 5200) | function init() {
  function render (line 5279) | function render() {

FILE: MeshSimplify/js/marchingtetrahedra.js
  function interp (line 38) | function interp(i0, i1) {

FILE: MeshSimplify/js/montecarlo.js
  function MonteCarloSimplification (line 1) | function MonteCarloSimplification(mesh) {

FILE: MeshSimplify/js/testdata.js
  function createTestData (line 1) | function createTestData() {

FILE: MeshSimplify/js/triangle_index.js
  function TriangleIndex (line 1) | function TriangleIndex(mesh) {

FILE: MeshSimplify/vendor/dsp.js
  function setupTypedArray (line 57) | function setupTypedArray(name, fallback) {
  function FourierTransform (line 242) | function FourierTransform(bufferSize, sampleRate) {
  function DFT (line 298) | function DFT(bufferSize, sampleRate) {
  function FFT (line 353) | function FFT(bufferSize, sampleRate) {
  function RFFT (line 554) | function RFFT(bufferSize, sampleRate) {
  function Sampler (line 830) | function Sampler(file, bufferSize, sampleRate, playStart, playEnd, loopS...
  function Oscillator (line 960) | function Oscillator(type, frequency, amplitude, bufferSize, sampleRate) {
  function ADSR (line 1119) | function ADSR(attackLength, decayLength, sustainLevel, sustainLength, re...
  function IIRFilter (line 1215) | function IIRFilter(type, cutoff, resonance, sampleRate) {
  function IIRFilter2 (line 1307) | function IIRFilter2(type, cutoff, resonance, sampleRate) {
  function WindowFunction (line 1371) | function WindowFunction(type, alpha) {
  function sinh (line 1472) | function sinh (arg) {
  function Biquad (line 1491) | function Biquad(type, sampleRate) {
  function GraphicalEq (line 1847) | function GraphicalEq(sampleRate) {
  function MultiDelay (line 1963) | function MultiDelay(maxDelayInSamplesSize, delayInSamples, masterVolume,...
  function SingleDelay (line 2064) | function SingleDelay(maxDelayInSamplesSize, delayInSamples, delayVolume) {
  function Reverb (line 2155) | function Reverb(maxDelayInSamplesSize, delayInSamples, masterVolume, mix...

FILE: MeshSimplify/vendor/three.js/ShaderExtras.js
  function gauss (line 1751) | function gauss( x, sigma ) {

FILE: MeshSimplify/vendor/three.js/Three.js
  function c (line 24) | function c(a,b,c){q.sub(c,a);u=q.dot(b);t=n.add(a,r.copy(b).multiplyScal...
  function d (line 24) | function d(a,b,c,d){q.sub(d,b);n.sub(c,b);r.sub(a,b);s=q.dot(q);w=q.dot(...
  function a (line 29) | function a(){f=d-b;g=e-c}
  function a (line 66) | function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}
  function b (line 66) | function b(){var a=l[j]=l[j]||new THREE.RenderableVertex;j++;return a}
  function c (line 66) | function c(a,b){return b.z-a.z}
  function d (line 66) | function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if...
  function a (line 97) | function a(a,b,c,d,e,f,F){h=a.vertices[b];j=a.vertices[c];
  function b (line 104) | function b(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+...
  function c (line 119) | function c(a){a=
  function d (line 120) | function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}
  function e (line 120) | function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!...
  function f (line 120) | function f(a,c,d,f,g,h){var j=document.createElement("canvas");a[c]=new ...
  function g (line 121) | function g(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}
  function w (line 130) | function w(a){return a%4?4-a%4:0}
  function H (line 130) | function H(a,b){return(new Uint8Array(a,b,1))[0]}
  function E (line 130) | function E(a,b){return(new Uint32Array(a,b,1))[0]}
  function z (line 130) | function z(b,c){var d,e,f,g,h,i,j,k,l=new Uint32Array(a,c,3*b);for(d=0;d...
  function v (line 131) | function v(b,c){var d,e,f,g,h,i,j,k,l,m,n=new Uint32Array(a,c,4*b);for(d...
  function A (line 131) | function A(b,c,d){for(var e,f,g,h,c=new Uint32Array(a,c,3*b),i=new Uint1...
  function J (line 132) | function J(b,c,d){for(var e,f,g,h,i,c=new Uint32Array(a,c,4*b),j=new Uin...
  function K (line 132) | function K(b,c,d,e){for(var f,g,h,i,j,k,l,c=new Uint32Array(a,c,3*b),d=n...
  function R (line 133) | function R(b,c,d,e){for(var f,g,h,i,j,k,l,m,n,c=new Uint32Array(a,c,4*b)...
  function d (line 149) | function d(a,b){return b=="relativeToHTML"?a:l+"/"+a}
  function e (line 149) | function e(){var a;for(m in D.objects)if(!C.objects[m]){u=D.objects[m];i...
  function f (line 151) | function f(a){return function(b){C.geometries[a]=b;e();G=G-1;j.onLoadCom...
  function g (line 151) | function g(a){return function(b){C.geometries[a]=b}}
  function h (line 151) | function h(){j.callbackProgress({totalModels:T,totalTextures:U,loadedMod...
  function b (line 221) | function b(a){if(t!=a)n.globalAlpha=t=a}
  function c (line 221) | function c(a){if(y!=a){switch(a){case THREE.NormalBlending:n.globalCompo...
  function d (line 221) | function d(a){if(s!=a)n.strokeStyle=s=a}
  function e (line 221) | function e(a){if(w!=a)n.fillStyle=w=a}
  function m (line 225) | function m(a){var b,c,d,e;aa.setRGB(0,0,0);Ta.setRGB(0,0,0);Qa.setRGB(0,...
  function p (line 226) | function p(a,b,c,d){var e,f,g,i,h,j;e=0;for(f=a.length;e<f;e++){g=a[e];i...
  function r (line 227) | function r(a,f,g){b(g.opacity);c(g.blending);var i,h,j,k,l,m;if(g instan...
  function s (line 228) | function s(a,e,f,g){b(g.opacity);c(g.blending);n.beginPath();n.moveTo(a....
  function t (line 229) | function t(a,d,e,g,h,l,m,n){f.info.render.vertices=f.info.render.vertice...
  function u (line 234) | function u(a,d,e,g,h,l,n,m,o){f.info.render.vertices=f.info.render.verti...
  function w (line 239) | function w(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c,
  function y (line 240) | function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n....
  function Mb (line 240) | function Mb(a,b,c,e){if(H!=b)n.lineWidth=H=b;if(E!=c)n.lineCap=E=c;if(z!...
  function Eb (line 240) | function Eb(a){e(a.getContextStyle());n.fill()}
  function ad (line 240) | function ad(a,b,c,d,f,g,i,h,j,k,l,m,p){if(p.image.width!=0){if(p.needsUp...
  function gc (line 242) | function gc(a,b,c,d,e,f,g,i,h,j,k,l,m){var p,o;p=m.width-1;o=m.height-1;...
  function Cc (line 243) | function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(...
  function ac (line 244) | function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}
  function hc (line 244) | function hc(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function Nb (line 244) | function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqr...
  function a (line 250) | function a(a,b,c,d){var e,f,g,h,j,k;e=0;for(f=a.length;e<f;e++){g=a[e];h...
  function b (line 251) | function b(a){if(A[a]==null){A[a]=document.createElementNS("http://www.w...
  function c (line 251) | function c(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function b (line 299) | function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if...
  function c (line 300) | function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMat...
  function d (line 300) | function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a ...
  function e (line 300) | function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMateria...
  function f (line 300) | function f(a,b,c){var d,e,f,g,h=a.vertices;g=h.length;
  function g (line 305) | function g(a,b){return b.z-a.z}
  function h (line 305) | function h(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++){ea=U=null;...
  function j (line 305) | function j(a,b,c,d,e,f,g,h){var i,j,k,l;if(b){j=a.length-1;l=b=-1}else{j...
  function l (line 306) | function l(a,b,c,d,e,f,g){for(var h,i,j=0,k=a.length;j<k;j++){h=a[j];i=h...
  function k (line 307) | function k(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}
  function p (line 307) | function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)r...
  function m (line 307) | function m(a){for(var b in a.attributes)a.attributes[b].needsUpdate=false}
  function o (line 307) | function o(a,b){for(var c=a.length-1;c>=0;c--)a[c].object===
  function q (line 308) | function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}
  function n (line 308) | function n(a,b,c,d,e){if(!d.program||d.needsUpdate){G.initMaterial(d,b,c...
  function r (line 324) | function r(a,b){a._modelViewMatrix.multiply(b.matrixWorldInverse,a.matri...
  function u (line 324) | function u(a,b,c){if(Ra!==
  function t (line 325) | function t(a,b){var c;a==="fragment"?c=i.createShader(i.FRAGMENT_SHADER)...
  function y (line 325) | function y(a,b,c){if(c){i.texParameteri(a,i.TEXTURE_WRAP_S,H(b.wrapS));i...
  function s (line 326) | function s(a,b){i.bindRenderbuffer(i.RENDERBUFFER,a);if(b.depthBuffer&&!...
  function w (line 327) | function w(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMa...
  function H (line 328) | function H(a){switch(a){case THREE.RepeatWrapping:return i.REPEAT;case T...
  function c (line 442) | function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2...
  function c (line 564) | function c(a,b){return function(){b.apply(a,arguments)}}
  function c (line 573) | function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}
  function d (line 573) | function d(a,b){return function(){b.apply(a,arguments)}}
  function e (line 573) | function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.g...
  function f (line 574) | function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b...
  function c (line 582) | function c(a,b){return function(){b.apply(a,arguments)}}
  function j (line 607) | function j(a,b,c,g,h,j,k,m){var n,p=d||1,o=e||1,q=h/2,r=j/2,t=l.vertices...
  function c (line 616) | function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(...
  function d (line 616) | function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeomet...
  function e (line 617) | function e(c,d){var e,f;for(F=c.length;--F>=0;){e=F;f=F-1;f<0&&(f=
  function f (line 618) | function f(a,b,c){A.vertices.push(new THREE.Vector3(a,b,c))}
  function g (line 618) | function g(c,d,e,f){c=c+J;d=d+J;e=e+J;A.faces.push(new THREE.Face3(c,d,e...
  function h (line 646) | function h(a,b,c,d,e,f){var g=Math.cos(a);Math.cos(b);b=Math.sin(a);a=c/...
  function e (line 656) | function e(a){var b=a.normalize().clone();b.index=j.vertices.push(b)-1;v...
  function f (line 656) | function f(a,b,c,d){if(d<1){d=new THREE.Face3(a.index,b.index,c.index,[a...
  function g (line 657) | function g(a,b){p[a.index]||(p[a.index]=[]);p[b.index]||(p[b.index]=[]);...
  function h (line 657) | function h(a,b,c){c<0&&a.u===1&&(a=new THREE.UV(a.u-1,a.v));b.x===0&&b.z...
  function b (line 669) | function b(a,b,d){c(a,d);c(b,d)}
  function c (line 669) | function c(a,b){d.lineGeometry.vertices.push(new THREE.Vector3);d.lineGe...
  function a (line 672) | function a(a,d,e,f){THREE.CameraHelper.__v.set(d,e,f);THREE.CameraHelper...
  function b (line 675) | function b(){m.debug&&console.log.apply(console,arguments)}
  function c (line 675) | function c(){console&&console.log.apply(console,arguments)}
  function d (line 675) | function d(a,c,d,e,g,h,i){var j=new THREE.Face4(a,c,d,e,null,g.color,g.m...
  function e (line 676) | function e(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}
  function f (line 676) | function f(a,d){var e=a+":"+d,f=t[e];if(!f){a>=y&&a<y+q.length?b("face p...
  function g (line 676) | function g(a,b,d){var e=a+":"+b;e in t?c("dup vertexNo",a,"oldFaceNo",b,...
  function h (line 676) | function h(a,
  function j (line 677) | function j(a,b,c){P[a]===void 0&&(P[a]={});P[a][b]=c}
  function b (line 678) | function b(a,c){h[a]===void 0&&(h[a]=[]);h[a].push(c)}
  function a (line 695) | function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER...
  function a (line 715) | function a(a,b){return b.z-a.z}

FILE: MinecraftMeshes/js/culled.js
  function CulledMesh (line 24) | function CulledMesh(volume, dims) {

FILE: MinecraftMeshes/js/greedy.js
  function GreedyMesh (line 23) | function GreedyMesh(volume, dims) {

FILE: MinecraftMeshes/js/stupid.js
  function StupidMesh (line 24) | function StupidMesh(volume, dims) {

FILE: MinecraftMeshes/js/testdata.js
  function createTestData (line 1) | function createTestData() {

FILE: MinecraftMeshes/vendor/three.js/ShaderExtras.js
  function gauss (line 1751) | function gauss( x, sigma ) {

FILE: MinecraftMeshes/vendor/three.js/Three.js
  function c (line 24) | function c(a,b,c){q.sub(c,a);u=q.dot(b);t=n.add(a,r.copy(b).multiplyScal...
  function d (line 24) | function d(a,b,c,d){q.sub(d,b);n.sub(c,b);r.sub(a,b);s=q.dot(q);w=q.dot(...
  function a (line 29) | function a(){f=d-b;g=e-c}
  function a (line 66) | function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}
  function b (line 66) | function b(){var a=l[j]=l[j]||new THREE.RenderableVertex;j++;return a}
  function c (line 66) | function c(a,b){return b.z-a.z}
  function d (line 66) | function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if...
  function a (line 97) | function a(a,b,c,d,e,f,F){h=a.vertices[b];j=a.vertices[c];
  function b (line 104) | function b(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+...
  function c (line 119) | function c(a){a=
  function d (line 120) | function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}
  function e (line 120) | function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!...
  function f (line 120) | function f(a,c,d,f,g,h){var j=document.createElement("canvas");a[c]=new ...
  function g (line 121) | function g(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}
  function w (line 130) | function w(a){return a%4?4-a%4:0}
  function H (line 130) | function H(a,b){return(new Uint8Array(a,b,1))[0]}
  function E (line 130) | function E(a,b){return(new Uint32Array(a,b,1))[0]}
  function z (line 130) | function z(b,c){var d,e,f,g,h,i,j,k,l=new Uint32Array(a,c,3*b);for(d=0;d...
  function v (line 131) | function v(b,c){var d,e,f,g,h,i,j,k,l,m,n=new Uint32Array(a,c,4*b);for(d...
  function A (line 131) | function A(b,c,d){for(var e,f,g,h,c=new Uint32Array(a,c,3*b),i=new Uint1...
  function J (line 132) | function J(b,c,d){for(var e,f,g,h,i,c=new Uint32Array(a,c,4*b),j=new Uin...
  function K (line 132) | function K(b,c,d,e){for(var f,g,h,i,j,k,l,c=new Uint32Array(a,c,3*b),d=n...
  function R (line 133) | function R(b,c,d,e){for(var f,g,h,i,j,k,l,m,n,c=new Uint32Array(a,c,4*b)...
  function d (line 149) | function d(a,b){return b=="relativeToHTML"?a:l+"/"+a}
  function e (line 149) | function e(){var a;for(m in D.objects)if(!C.objects[m]){u=D.objects[m];i...
  function f (line 151) | function f(a){return function(b){C.geometries[a]=b;e();G=G-1;j.onLoadCom...
  function g (line 151) | function g(a){return function(b){C.geometries[a]=b}}
  function h (line 151) | function h(){j.callbackProgress({totalModels:T,totalTextures:U,loadedMod...
  function b (line 221) | function b(a){if(t!=a)n.globalAlpha=t=a}
  function c (line 221) | function c(a){if(y!=a){switch(a){case THREE.NormalBlending:n.globalCompo...
  function d (line 221) | function d(a){if(s!=a)n.strokeStyle=s=a}
  function e (line 221) | function e(a){if(w!=a)n.fillStyle=w=a}
  function m (line 225) | function m(a){var b,c,d,e;aa.setRGB(0,0,0);Ta.setRGB(0,0,0);Qa.setRGB(0,...
  function p (line 226) | function p(a,b,c,d){var e,f,g,i,h,j;e=0;for(f=a.length;e<f;e++){g=a[e];i...
  function r (line 227) | function r(a,f,g){b(g.opacity);c(g.blending);var i,h,j,k,l,m;if(g instan...
  function s (line 228) | function s(a,e,f,g){b(g.opacity);c(g.blending);n.beginPath();n.moveTo(a....
  function t (line 229) | function t(a,d,e,g,h,l,m,n){f.info.render.vertices=f.info.render.vertice...
  function u (line 234) | function u(a,d,e,g,h,l,n,m,o){f.info.render.vertices=f.info.render.verti...
  function w (line 239) | function w(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c,
  function y (line 240) | function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n....
  function Mb (line 240) | function Mb(a,b,c,e){if(H!=b)n.lineWidth=H=b;if(E!=c)n.lineCap=E=c;if(z!...
  function Eb (line 240) | function Eb(a){e(a.getContextStyle());n.fill()}
  function ad (line 240) | function ad(a,b,c,d,f,g,i,h,j,k,l,m,p){if(p.image.width!=0){if(p.needsUp...
  function gc (line 242) | function gc(a,b,c,d,e,f,g,i,h,j,k,l,m){var p,o;p=m.width-1;o=m.height-1;...
  function Cc (line 243) | function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(...
  function ac (line 244) | function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}
  function hc (line 244) | function hc(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function Nb (line 244) | function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqr...
  function a (line 250) | function a(a,b,c,d){var e,f,g,h,j,k;e=0;for(f=a.length;e<f;e++){g=a[e];h...
  function b (line 251) | function b(a){if(A[a]==null){A[a]=document.createElementNS("http://www.w...
  function c (line 251) | function c(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function b (line 299) | function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if...
  function c (line 300) | function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMat...
  function d (line 300) | function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a ...
  function e (line 300) | function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMateria...
  function f (line 300) | function f(a,b,c){var d,e,f,g,h=a.vertices;g=h.length;
  function g (line 305) | function g(a,b){return b.z-a.z}
  function h (line 305) | function h(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++){ea=U=null;...
  function j (line 305) | function j(a,b,c,d,e,f,g,h){var i,j,k,l;if(b){j=a.length-1;l=b=-1}else{j...
  function l (line 306) | function l(a,b,c,d,e,f,g){for(var h,i,j=0,k=a.length;j<k;j++){h=a[j];i=h...
  function k (line 307) | function k(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}
  function p (line 307) | function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)r...
  function m (line 307) | function m(a){for(var b in a.attributes)a.attributes[b].needsUpdate=false}
  function o (line 307) | function o(a,b){for(var c=a.length-1;c>=0;c--)a[c].object===
  function q (line 308) | function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}
  function n (line 308) | function n(a,b,c,d,e){if(!d.program||d.needsUpdate){G.initMaterial(d,b,c...
  function r (line 324) | function r(a,b){a._modelViewMatrix.multiply(b.matrixWorldInverse,a.matri...
  function u (line 324) | function u(a,b,c){if(Ra!==
  function t (line 325) | function t(a,b){var c;a==="fragment"?c=i.createShader(i.FRAGMENT_SHADER)...
  function y (line 325) | function y(a,b,c){if(c){i.texParameteri(a,i.TEXTURE_WRAP_S,H(b.wrapS));i...
  function s (line 326) | function s(a,b){i.bindRenderbuffer(i.RENDERBUFFER,a);if(b.depthBuffer&&!...
  function w (line 327) | function w(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMa...
  function H (line 328) | function H(a){switch(a){case THREE.RepeatWrapping:return i.REPEAT;case T...
  function c (line 442) | function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2...
  function c (line 564) | function c(a,b){return function(){b.apply(a,arguments)}}
  function c (line 573) | function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}
  function d (line 573) | function d(a,b){return function(){b.apply(a,arguments)}}
  function e (line 573) | function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.g...
  function f (line 574) | function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b...
  function c (line 582) | function c(a,b){return function(){b.apply(a,arguments)}}
  function j (line 607) | function j(a,b,c,g,h,j,k,m){var n,p=d||1,o=e||1,q=h/2,r=j/2,t=l.vertices...
  function c (line 616) | function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(...
  function d (line 616) | function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeomet...
  function e (line 617) | function e(c,d){var e,f;for(F=c.length;--F>=0;){e=F;f=F-1;f<0&&(f=
  function f (line 618) | function f(a,b,c){A.vertices.push(new THREE.Vector3(a,b,c))}
  function g (line 618) | function g(c,d,e,f){c=c+J;d=d+J;e=e+J;A.faces.push(new THREE.Face3(c,d,e...
  function h (line 646) | function h(a,b,c,d,e,f){var g=Math.cos(a);Math.cos(b);b=Math.sin(a);a=c/...
  function e (line 656) | function e(a){var b=a.normalize().clone();b.index=j.vertices.push(b)-1;v...
  function f (line 656) | function f(a,b,c,d){if(d<1){d=new THREE.Face3(a.index,b.index,c.index,[a...
  function g (line 657) | function g(a,b){p[a.index]||(p[a.index]=[]);p[b.index]||(p[b.index]=[]);...
  function h (line 657) | function h(a,b,c){c<0&&a.u===1&&(a=new THREE.UV(a.u-1,a.v));b.x===0&&b.z...
  function b (line 669) | function b(a,b,d){c(a,d);c(b,d)}
  function c (line 669) | function c(a,b){d.lineGeometry.vertices.push(new THREE.Vector3);d.lineGe...
  function a (line 672) | function a(a,d,e,f){THREE.CameraHelper.__v.set(d,e,f);THREE.CameraHelper...
  function b (line 675) | function b(){m.debug&&console.log.apply(console,arguments)}
  function c (line 675) | function c(){console&&console.log.apply(console,arguments)}
  function d (line 675) | function d(a,c,d,e,g,h,i){var j=new THREE.Face4(a,c,d,e,null,g.color,g.m...
  function e (line 676) | function e(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}
  function f (line 676) | function f(a,d){var e=a+":"+d,f=t[e];if(!f){a>=y&&a<y+q.length?b("face p...
  function g (line 676) | function g(a,b,d){var e=a+":"+b;e in t?c("dup vertexNo",a,"oldFaceNo",b,...
  function h (line 676) | function h(a,
  function j (line 677) | function j(a,b,c){P[a]===void 0&&(P[a]={});P[a][b]=c}
  function b (line 678) | function b(a,c){h[a]===void 0&&(h[a]=[]);h[a].push(c)}
  function a (line 695) | function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER...
  function a (line 715) | function a(a,b){return b.z-a.z}

FILE: MinecraftMeshes2/js/benchmark.js
  function init_volume (line 10) | function init_volume(freq) {

FILE: MinecraftMeshes2/js/culled.js
  function CulledMesh (line 24) | function CulledMesh(volume, dims) {

FILE: MinecraftMeshes2/js/greedy.js
  function f (line 29) | function f(i,j,k) {

FILE: MinecraftMeshes2/js/greedy_tri.js
  function f (line 28) | function f(i,j,k) {

FILE: MinecraftMeshes2/js/monotone.js
  function MonotonePolygon (line 27) | function MonotonePolygon(c, v, ul, ur) {
  function f (line 53) | function f(i,j,k) {

FILE: MinecraftMeshes2/js/stupid.js
  function StupidMesh (line 24) | function StupidMesh(volume, dims) {

FILE: MinecraftMeshes2/js/testdata.js
  function createTestData (line 1) | function createTestData() {

FILE: MinecraftMeshes2/vendor/three.js/ShaderExtras.js
  function gauss (line 1751) | function gauss( x, sigma ) {

FILE: MinecraftMeshes2/vendor/three.js/Three.js
  function c (line 24) | function c(a,b,c){q.sub(c,a);u=q.dot(b);t=n.add(a,r.copy(b).multiplyScal...
  function d (line 24) | function d(a,b,c,d){q.sub(d,b);n.sub(c,b);r.sub(a,b);s=q.dot(q);w=q.dot(...
  function a (line 29) | function a(){f=d-b;g=e-c}
  function a (line 66) | function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}
  function b (line 66) | function b(){var a=l[j]=l[j]||new THREE.RenderableVertex;j++;return a}
  function c (line 66) | function c(a,b){return b.z-a.z}
  function d (line 66) | function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if...
  function a (line 97) | function a(a,b,c,d,e,f,F){h=a.vertices[b];j=a.vertices[c];
  function b (line 104) | function b(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+...
  function c (line 119) | function c(a){a=
  function d (line 120) | function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}
  function e (line 120) | function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!...
  function f (line 120) | function f(a,c,d,f,g,h){var j=document.createElement("canvas");a[c]=new ...
  function g (line 121) | function g(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}
  function w (line 130) | function w(a){return a%4?4-a%4:0}
  function H (line 130) | function H(a,b){return(new Uint8Array(a,b,1))[0]}
  function E (line 130) | function E(a,b){return(new Uint32Array(a,b,1))[0]}
  function z (line 130) | function z(b,c){var d,e,f,g,h,i,j,k,l=new Uint32Array(a,c,3*b);for(d=0;d...
  function v (line 131) | function v(b,c){var d,e,f,g,h,i,j,k,l,m,n=new Uint32Array(a,c,4*b);for(d...
  function A (line 131) | function A(b,c,d){for(var e,f,g,h,c=new Uint32Array(a,c,3*b),i=new Uint1...
  function J (line 132) | function J(b,c,d){for(var e,f,g,h,i,c=new Uint32Array(a,c,4*b),j=new Uin...
  function K (line 132) | function K(b,c,d,e){for(var f,g,h,i,j,k,l,c=new Uint32Array(a,c,3*b),d=n...
  function R (line 133) | function R(b,c,d,e){for(var f,g,h,i,j,k,l,m,n,c=new Uint32Array(a,c,4*b)...
  function d (line 149) | function d(a,b){return b=="relativeToHTML"?a:l+"/"+a}
  function e (line 149) | function e(){var a;for(m in D.objects)if(!C.objects[m]){u=D.objects[m];i...
  function f (line 151) | function f(a){return function(b){C.geometries[a]=b;e();G=G-1;j.onLoadCom...
  function g (line 151) | function g(a){return function(b){C.geometries[a]=b}}
  function h (line 151) | function h(){j.callbackProgress({totalModels:T,totalTextures:U,loadedMod...
  function b (line 221) | function b(a){if(t!=a)n.globalAlpha=t=a}
  function c (line 221) | function c(a){if(y!=a){switch(a){case THREE.NormalBlending:n.globalCompo...
  function d (line 221) | function d(a){if(s!=a)n.strokeStyle=s=a}
  function e (line 221) | function e(a){if(w!=a)n.fillStyle=w=a}
  function m (line 225) | function m(a){var b,c,d,e;aa.setRGB(0,0,0);Ta.setRGB(0,0,0);Qa.setRGB(0,...
  function p (line 226) | function p(a,b,c,d){var e,f,g,i,h,j;e=0;for(f=a.length;e<f;e++){g=a[e];i...
  function r (line 227) | function r(a,f,g){b(g.opacity);c(g.blending);var i,h,j,k,l,m;if(g instan...
  function s (line 228) | function s(a,e,f,g){b(g.opacity);c(g.blending);n.beginPath();n.moveTo(a....
  function t (line 229) | function t(a,d,e,g,h,l,m,n){f.info.render.vertices=f.info.render.vertice...
  function u (line 234) | function u(a,d,e,g,h,l,n,m,o){f.info.render.vertices=f.info.render.verti...
  function w (line 239) | function w(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c,
  function y (line 240) | function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n....
  function Mb (line 240) | function Mb(a,b,c,e){if(H!=b)n.lineWidth=H=b;if(E!=c)n.lineCap=E=c;if(z!...
  function Eb (line 240) | function Eb(a){e(a.getContextStyle());n.fill()}
  function ad (line 240) | function ad(a,b,c,d,f,g,i,h,j,k,l,m,p){if(p.image.width!=0){if(p.needsUp...
  function gc (line 242) | function gc(a,b,c,d,e,f,g,i,h,j,k,l,m){var p,o;p=m.width-1;o=m.height-1;...
  function Cc (line 243) | function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(...
  function ac (line 244) | function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}
  function hc (line 244) | function hc(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function Nb (line 244) | function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqr...
  function a (line 250) | function a(a,b,c,d){var e,f,g,h,j,k;e=0;for(f=a.length;e<f;e++){g=a[e];h...
  function b (line 251) | function b(a){if(A[a]==null){A[a]=document.createElementNS("http://www.w...
  function c (line 251) | function c(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function b (line 299) | function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if...
  function c (line 300) | function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMat...
  function d (line 300) | function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a ...
  function e (line 300) | function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMateria...
  function f (line 300) | function f(a,b,c){var d,e,f,g,h=a.vertices;g=h.length;
  function g (line 305) | function g(a,b){return b.z-a.z}
  function h (line 305) | function h(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++){ea=U=null;...
  function j (line 305) | function j(a,b,c,d,e,f,g,h){var i,j,k,l;if(b){j=a.length-1;l=b=-1}else{j...
  function l (line 306) | function l(a,b,c,d,e,f,g){for(var h,i,j=0,k=a.length;j<k;j++){h=a[j];i=h...
  function k (line 307) | function k(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}
  function p (line 307) | function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)r...
  function m (line 307) | function m(a){for(var b in a.attributes)a.attributes[b].needsUpdate=false}
  function o (line 307) | function o(a,b){for(var c=a.length-1;c>=0;c--)a[c].object===
  function q (line 308) | function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}
  function n (line 308) | function n(a,b,c,d,e){if(!d.program||d.needsUpdate){G.initMaterial(d,b,c...
  function r (line 324) | function r(a,b){a._modelViewMatrix.multiply(b.matrixWorldInverse,a.matri...
  function u (line 324) | function u(a,b,c){if(Ra!==
  function t (line 325) | function t(a,b){var c;a==="fragment"?c=i.createShader(i.FRAGMENT_SHADER)...
  function y (line 325) | function y(a,b,c){if(c){i.texParameteri(a,i.TEXTURE_WRAP_S,H(b.wrapS));i...
  function s (line 326) | function s(a,b){i.bindRenderbuffer(i.RENDERBUFFER,a);if(b.depthBuffer&&!...
  function w (line 327) | function w(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMa...
  function H (line 328) | function H(a){switch(a){case THREE.RepeatWrapping:return i.REPEAT;case T...
  function c (line 442) | function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2...
  function c (line 564) | function c(a,b){return function(){b.apply(a,arguments)}}
  function c (line 573) | function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}
  function d (line 573) | function d(a,b){return function(){b.apply(a,arguments)}}
  function e (line 573) | function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.g...
  function f (line 574) | function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b...
  function c (line 582) | function c(a,b){return function(){b.apply(a,arguments)}}
  function j (line 607) | function j(a,b,c,g,h,j,k,m){var n,p=d||1,o=e||1,q=h/2,r=j/2,t=l.vertices...
  function c (line 616) | function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(...
  function d (line 616) | function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeomet...
  function e (line 617) | function e(c,d){var e,f;for(F=c.length;--F>=0;){e=F;f=F-1;f<0&&(f=
  function f (line 618) | function f(a,b,c){A.vertices.push(new THREE.Vector3(a,b,c))}
  function g (line 618) | function g(c,d,e,f){c=c+J;d=d+J;e=e+J;A.faces.push(new THREE.Face3(c,d,e...
  function h (line 646) | function h(a,b,c,d,e,f){var g=Math.cos(a);Math.cos(b);b=Math.sin(a);a=c/...
  function e (line 656) | function e(a){var b=a.normalize().clone();b.index=j.vertices.push(b)-1;v...
  function f (line 656) | function f(a,b,c,d){if(d<1){d=new THREE.Face3(a.index,b.index,c.index,[a...
  function g (line 657) | function g(a,b){p[a.index]||(p[a.index]=[]);p[b.index]||(p[b.index]=[]);...
  function h (line 657) | function h(a,b,c){c<0&&a.u===1&&(a=new THREE.UV(a.u-1,a.v));b.x===0&&b.z...
  function b (line 669) | function b(a,b,d){c(a,d);c(b,d)}
  function c (line 669) | function c(a,b){d.lineGeometry.vertices.push(new THREE.Vector3);d.lineGe...
  function a (line 672) | function a(a,d,e,f){THREE.CameraHelper.__v.set(d,e,f);THREE.CameraHelper...
  function b (line 675) | function b(){m.debug&&console.log.apply(console,arguments)}
  function c (line 675) | function c(){console&&console.log.apply(console,arguments)}
  function d (line 675) | function d(a,c,d,e,g,h,i){var j=new THREE.Face4(a,c,d,e,null,g.color,g.m...
  function e (line 676) | function e(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}
  function f (line 676) | function f(a,d){var e=a+":"+d,f=t[e];if(!f){a>=y&&a<y+q.length?b("face p...
  function g (line 676) | function g(a,b,d){var e=a+":"+b;e in t?c("dup vertexNo",a,"oldFaceNo",b,...
  function h (line 676) | function h(a,
  function j (line 677) | function j(a,b,c){P[a]===void 0&&(P[a]={});P[a][b]=c}
  function b (line 678) | function b(a,c){h[a]===void 0&&(h[a]=[]);h[a].push(c)}
  function a (line 695) | function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER...
  function a (line 715) | function a(a,b){return b.z-a.z}

FILE: Pictures/test_smooth.py
  function sigmoid (line 9) | def sigmoid(t):
  function shallow (line 12) | def shallow(t):
  function steep (line 15) | def steep(t):
  function zero (line 18) | def zero(t):
  function downsample (line 21) | def downsample(f):
  function make_gif (line 25) | def make_gif():
  function make_gif2 (line 42) | def make_gif2():

FILE: Resources/brep.js
  function compute_stars (line 13) | function compute_stars(mesh) {
  function UOPair (line 29) | function UOPair(a, b) {
  function compare_uopair (line 40) | function compare_uopair(s, t) {
  function merge_loops (line 49) | function merge_loops(a, b) {
  function face_loop (line 61) | function face_loop(f) {
  function compute_links (line 75) | function compute_links(mesh) {
  function estimate_normals (line 135) | function estimate_normals(mesh) {

FILE: Resources/glow_shell.js
  function makeShader (line 134) | function makeShader(frag_src, buf_num) {
  function render (line 176) | function render() {

FILE: Resources/lib/GLOW.js
  function b (line 2) | function b(a,c,b){this.flags=a;this.callback=c;this.context=b}
  function b (line 5) | function b(a){a===void 0&&(a={});this.id=a.id!==void 0?a.id:GLOW.uniqueI...
  function b (line 28) | function b(a,c,b,e,g){this.program=a;this.uniforms=c||{};this.attributes...
  function b (line 33) | function b(){this.highestAttributeNumber=-1;this.uniformByLocation=[];th...
  function b (line 38) | function b(a){a=a!==void 0?a:{};this.id=GLOW.uniqueId();this.width=a.wid...
  function b (line 54) | function b(a){if(a.url!==void 0)a.data=a.url;this.id=GLOW.uniqueId();thi...
  function b (line 66) | function b(a){this.id=GLOW.uniqueId();this.compiledData=a.use?a.use.clon...
  function b (line 72) | function b(a,b,f,e){this.id=GLOW.uniqueId();this.type=b!==void 0?b:GL.TR...
  function b (line 74) | function b(){f[GL.INT]=function(){GL.uniform1iv(this.location,this.getNa...
  function a (line 77) | function a(a,g){c||(c=!0,b());this.id=GLOW.uniqueId();this.data=g;this.n...
  function b (line 79) | function b(b,e,g,h){a||(a=!0,c[GL.INT]=1,c[GL.INT_VEC2]=2,c[GL.INT_VEC3]...
  function b (line 83) | function b(a){this.id=GLOW.uniqueId();this.attributes=a;var b,f=a[0].dat...
  function b (line 86) | function b(a){a!==void 0&&a.length?this.value=new Float32Array(a):(this....
  function b (line 88) | function b(a){a!==void 0&&a.length?this.value=new Int32Array(a):(this.va...
  function b (line 89) | function b(a){this.value=[];this.value[0]=a!==void 0?!!a:!1}
  function b (line 89) | function b(a,b){this.value=[];this.value[0]=a!==void 0?!!a:!1;this.value...
  function b (line 90) | function b(a,b,f){this.value=[];this.value[0]=a!==void 0?!!a:!1;this.val...
  function b (line 91) | function b(a,b,f,e){this.value=[];this.value[0]=a!==void 0?!!a:!1;this.v...
  function b (line 92) | function b(a,b){this.value=new Float32Array(2);this.value[0]=a!==void 0?...
  function b (line 95) | function b(a,b,f){this.value=new Float32Array(3);this.value[0]=a!==void ...
  function b (line 102) | function b(a,b,f,e){this.value=new Float32Array(4);this.value[0]=a!==voi...
  function b (line 106) | function b(){this.value=new Float32Array(9);this.identity()}
  function b (line 108) | function b(){this.value=new Float32Array(16);this.rotation=new GLOW.Vect...
  function b (line 126) | function b(a,b,f){this.value=new Float32Array(3);b===void 0&&f===void 0?...
  function b (line 148) | function b(a){this.parameters=a;this.onLoadComplete=void 0;this.onLoadCo...

FILE: ShapeCarving/js/benchmark.js
  function init_volume (line 10) | function init_volume(freq) {

FILE: ShapeCarving/js/culled.js
  function CulledMesh (line 2) | function CulledMesh(volume, dims) {

FILE: ShapeCarving/js/greedy.js
  function f (line 6) | function f(i,j,k) {

FILE: ShapeCarving/js/greedy_tri.js
  function f (line 6) | function f(i,j,k) {

FILE: ShapeCarving/js/monotone.js
  function MonotonePolygon (line 5) | function MonotonePolygon(c, v, ul, ur) {
  function f (line 31) | function f(i,j,k) {

FILE: ShapeCarving/js/shapecarve.js
  function ShapeCarve (line 3) | function ShapeCarve(dims, views, mask_color, skip) {

FILE: ShapeCarving/js/stupid.js
  function StupidMesh (line 2) | function StupidMesh(volume, dims) {

FILE: ShapeCarving/js/testdata.js
  function createTestData (line 1) | function createTestData() {

FILE: ShapeCarving/jscolor/jscolor.js
  function removeDotSegments (line 293) | function removeDotSegments(path) {
  function RGB_HSV (line 544) | function RGB_HSV(r, g, b) {
  function HSV_RGB (line 554) | function HSV_RGB(h, s, v) {
  function removePicker (line 572) | function removePicker() {
  function drawPicker (line 578) | function drawPicker(x, y) {
  function getPickerDims (line 759) | function getPickerDims(o) {
  function redrawPad (line 771) | function redrawPad() {
  function redrawSld (line 823) | function redrawSld() {
  function isPickerOwner (line 835) | function isPickerOwner() {
  function blurTarget (line 840) | function blurTarget() {
  function blurValue (line 850) | function blurValue() {
  function setPad (line 857) | function setPad(e) {
  function setSld (line 868) | function setSld(e) {
  function dispatchImmediateChange (line 878) | function dispatchImmediateChange() {

FILE: ShapeCarving/vendor/three.js/ShaderExtras.js
  function gauss (line 1751) | function gauss( x, sigma ) {

FILE: ShapeCarving/vendor/three.js/Three.js
  function c (line 24) | function c(a,b,c){q.sub(c,a);u=q.dot(b);t=n.add(a,r.copy(b).multiplyScal...
  function d (line 24) | function d(a,b,c,d){q.sub(d,b);n.sub(c,b);r.sub(a,b);s=q.dot(q);w=q.dot(...
  function a (line 29) | function a(){f=d-b;g=e-c}
  function a (line 66) | function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}
  function b (line 66) | function b(){var a=l[j]=l[j]||new THREE.RenderableVertex;j++;return a}
  function c (line 66) | function c(a,b){return b.z-a.z}
  function d (line 66) | function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if...
  function a (line 97) | function a(a,b,c,d,e,f,F){h=a.vertices[b];j=a.vertices[c];
  function b (line 104) | function b(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+...
  function c (line 119) | function c(a){a=
  function d (line 120) | function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}
  function e (line 120) | function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!...
  function f (line 120) | function f(a,c,d,f,g,h){var j=document.createElement("canvas");a[c]=new ...
  function g (line 121) | function g(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}
  function w (line 130) | function w(a){return a%4?4-a%4:0}
  function H (line 130) | function H(a,b){return(new Uint8Array(a,b,1))[0]}
  function E (line 130) | function E(a,b){return(new Uint32Array(a,b,1))[0]}
  function z (line 130) | function z(b,c){var d,e,f,g,h,i,j,k,l=new Uint32Array(a,c,3*b);for(d=0;d...
  function v (line 131) | function v(b,c){var d,e,f,g,h,i,j,k,l,m,n=new Uint32Array(a,c,4*b);for(d...
  function A (line 131) | function A(b,c,d){for(var e,f,g,h,c=new Uint32Array(a,c,3*b),i=new Uint1...
  function J (line 132) | function J(b,c,d){for(var e,f,g,h,i,c=new Uint32Array(a,c,4*b),j=new Uin...
  function K (line 132) | function K(b,c,d,e){for(var f,g,h,i,j,k,l,c=new Uint32Array(a,c,3*b),d=n...
  function R (line 133) | function R(b,c,d,e){for(var f,g,h,i,j,k,l,m,n,c=new Uint32Array(a,c,4*b)...
  function d (line 149) | function d(a,b){return b=="relativeToHTML"?a:l+"/"+a}
  function e (line 149) | function e(){var a;for(m in D.objects)if(!C.objects[m]){u=D.objects[m];i...
  function f (line 151) | function f(a){return function(b){C.geometries[a]=b;e();G=G-1;j.onLoadCom...
  function g (line 151) | function g(a){return function(b){C.geometries[a]=b}}
  function h (line 151) | function h(){j.callbackProgress({totalModels:T,totalTextures:U,loadedMod...
  function b (line 221) | function b(a){if(t!=a)n.globalAlpha=t=a}
  function c (line 221) | function c(a){if(y!=a){switch(a){case THREE.NormalBlending:n.globalCompo...
  function d (line 221) | function d(a){if(s!=a)n.strokeStyle=s=a}
  function e (line 221) | function e(a){if(w!=a)n.fillStyle=w=a}
  function m (line 225) | function m(a){var b,c,d,e;aa.setRGB(0,0,0);Ta.setRGB(0,0,0);Qa.setRGB(0,...
  function p (line 226) | function p(a,b,c,d){var e,f,g,i,h,j;e=0;for(f=a.length;e<f;e++){g=a[e];i...
  function r (line 227) | function r(a,f,g){b(g.opacity);c(g.blending);var i,h,j,k,l,m;if(g instan...
  function s (line 228) | function s(a,e,f,g){b(g.opacity);c(g.blending);n.beginPath();n.moveTo(a....
  function t (line 229) | function t(a,d,e,g,h,l,m,n){f.info.render.vertices=f.info.render.vertice...
  function u (line 234) | function u(a,d,e,g,h,l,n,m,o){f.info.render.vertices=f.info.render.verti...
  function w (line 239) | function w(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c,
  function y (line 240) | function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n....
  function Mb (line 240) | function Mb(a,b,c,e){if(H!=b)n.lineWidth=H=b;if(E!=c)n.lineCap=E=c;if(z!...
  function Eb (line 240) | function Eb(a){e(a.getContextStyle());n.fill()}
  function ad (line 240) | function ad(a,b,c,d,f,g,i,h,j,k,l,m,p){if(p.image.width!=0){if(p.needsUp...
  function gc (line 242) | function gc(a,b,c,d,e,f,g,i,h,j,k,l,m){var p,o;p=m.width-1;o=m.height-1;...
  function Cc (line 243) | function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(...
  function ac (line 244) | function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}
  function hc (line 244) | function hc(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function Nb (line 244) | function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqr...
  function a (line 250) | function a(a,b,c,d){var e,f,g,h,j,k;e=0;for(f=a.length;e<f;e++){g=a[e];h...
  function b (line 251) | function b(a){if(A[a]==null){A[a]=document.createElementNS("http://www.w...
  function c (line 251) | function c(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function b (line 299) | function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if...
  function c (line 300) | function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMat...
  function d (line 300) | function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a ...
  function e (line 300) | function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMateria...
  function f (line 300) | function f(a,b,c){var d,e,f,g,h=a.vertices;g=h.length;
  function g (line 305) | function g(a,b){return b.z-a.z}
  function h (line 305) | function h(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++){ea=U=null;...
  function j (line 305) | function j(a,b,c,d,e,f,g,h){var i,j,k,l;if(b){j=a.length-1;l=b=-1}else{j...
  function l (line 306) | function l(a,b,c,d,e,f,g){for(var h,i,j=0,k=a.length;j<k;j++){h=a[j];i=h...
  function k (line 307) | function k(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}
  function p (line 307) | function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)r...
  function m (line 307) | function m(a){for(var b in a.attributes)a.attributes[b].needsUpdate=false}
  function o (line 307) | function o(a,b){for(var c=a.length-1;c>=0;c--)a[c].object===
  function q (line 308) | function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}
  function n (line 308) | function n(a,b,c,d,e){if(!d.program||d.needsUpdate){G.initMaterial(d,b,c...
  function r (line 324) | function r(a,b){a._modelViewMatrix.multiply(b.matrixWorldInverse,a.matri...
  function u (line 324) | function u(a,b,c){if(Ra!==
  function t (line 325) | function t(a,b){var c;a==="fragment"?c=i.createShader(i.FRAGMENT_SHADER)...
  function y (line 325) | function y(a,b,c){if(c){i.texParameteri(a,i.TEXTURE_WRAP_S,H(b.wrapS));i...
  function s (line 326) | function s(a,b){i.bindRenderbuffer(i.RENDERBUFFER,a);if(b.depthBuffer&&!...
  function w (line 327) | function w(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMa...
  function H (line 328) | function H(a){switch(a){case THREE.RepeatWrapping:return i.REPEAT;case T...
  function c (line 442) | function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2...
  function c (line 564) | function c(a,b){return function(){b.apply(a,arguments)}}
  function c (line 573) | function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}
  function d (line 573) | function d(a,b){return function(){b.apply(a,arguments)}}
  function e (line 573) | function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.g...
  function f (line 574) | function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b...
  function c (line 582) | function c(a,b){return function(){b.apply(a,arguments)}}
  function j (line 607) | function j(a,b,c,g,h,j,k,m){var n,p=d||1,o=e||1,q=h/2,r=j/2,t=l.vertices...
  function c (line 616) | function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(...
  function d (line 616) | function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeomet...
  function e (line 617) | function e(c,d){var e,f;for(F=c.length;--F>=0;){e=F;f=F-1;f<0&&(f=
  function f (line 618) | function f(a,b,c){A.vertices.push(new THREE.Vector3(a,b,c))}
  function g (line 618) | function g(c,d,e,f){c=c+J;d=d+J;e=e+J;A.faces.push(new THREE.Face3(c,d,e...
  function h (line 646) | function h(a,b,c,d,e,f){var g=Math.cos(a);Math.cos(b);b=Math.sin(a);a=c/...
  function e (line 656) | function e(a){var b=a.normalize().clone();b.index=j.vertices.push(b)-1;v...
  function f (line 656) | function f(a,b,c,d){if(d<1){d=new THREE.Face3(a.index,b.index,c.index,[a...
  function g (line 657) | function g(a,b){p[a.index]||(p[a.index]=[]);p[b.index]||(p[b.index]=[]);...
  function h (line 657) | function h(a,b,c){c<0&&a.u===1&&(a=new THREE.UV(a.u-1,a.v));b.x===0&&b.z...
  function b (line 669) | function b(a,b,d){c(a,d);c(b,d)}
  function c (line 669) | function c(a,b){d.lineGeometry.vertices.push(new THREE.Vector3);d.lineGe...
  function a (line 672) | function a(a,d,e,f){THREE.CameraHelper.__v.set(d,e,f);THREE.CameraHelper...
  function b (line 675) | function b(){m.debug&&console.log.apply(console,arguments)}
  function c (line 675) | function c(){console&&console.log.apply(console,arguments)}
  function d (line 675) | function d(a,c,d,e,g,h,i){var j=new THREE.Face4(a,c,d,e,null,g.color,g.m...
  function e (line 676) | function e(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}
  function f (line 676) | function f(a,d){var e=a+":"+d,f=t[e];if(!f){a>=y&&a<y+q.length?b("face p...
  function g (line 676) | function g(a,b,d){var e=a+":"+b;e in t?c("dup vertexNo",a,"oldFaceNo",b,...
  function h (line 676) | function h(a,
  function j (line 677) | function j(a,b,c){P[a]===void 0&&(P[a]={});P[a][b]=c}
  function b (line 678) | function b(a,c){h[a]===void 0&&(h[a]=[]);h[a].push(c)}
  function a (line 695) | function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER...
  function a (line 715) | function a(a,b){return b.z-a.z}

FILE: TJunctions/vendor/three.js/ShaderExtras.js
  function gauss (line 1751) | function gauss( x, sigma ) {

FILE: TJunctions/vendor/three.js/Three.js
  function c (line 24) | function c(a,b,c){q.sub(c,a);u=q.dot(b);t=n.add(a,r.copy(b).multiplyScal...
  function d (line 24) | function d(a,b,c,d){q.sub(d,b);n.sub(c,b);r.sub(a,b);s=q.dot(q);w=q.dot(...
  function a (line 29) | function a(){f=d-b;g=e-c}
  function a (line 66) | function a(){var a=g[f]=g[f]||new THREE.RenderableObject;f++;return a}
  function b (line 66) | function b(){var a=l[j]=l[j]||new THREE.RenderableVertex;j++;return a}
  function c (line 66) | function c(a,b){return b.z-a.z}
  function d (line 66) | function d(a,b){var c=0,d=1,e=a.z+a.w,f=b.z+b.w,g=-a.z+a.w,h=-b.z+b.w;if...
  function a (line 97) | function a(a,b,c,d,e,f,F){h=a.vertices[b];j=a.vertices[c];
  function b (line 104) | function b(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+...
  function c (line 119) | function c(a){a=
  function d (line 120) | function d(a){a=Math.log(a)/Math.LN2;return Math.pow(2,Math.round(a))}
  function e (line 120) | function e(a,b){var e=new Image;e.onload=function(){if(!c(this.width)||!...
  function f (line 120) | function f(a,c,d,f,g,h){var j=document.createElement("canvas");a[c]=new ...
  function g (line 121) | function g(a){return(a[0]*255<<16)+(a[1]*255<<8)+a[2]*255}
  function w (line 130) | function w(a){return a%4?4-a%4:0}
  function H (line 130) | function H(a,b){return(new Uint8Array(a,b,1))[0]}
  function E (line 130) | function E(a,b){return(new Uint32Array(a,b,1))[0]}
  function z (line 130) | function z(b,c){var d,e,f,g,h,i,j,k,l=new Uint32Array(a,c,3*b);for(d=0;d...
  function v (line 131) | function v(b,c){var d,e,f,g,h,i,j,k,l,m,n=new Uint32Array(a,c,4*b);for(d...
  function A (line 131) | function A(b,c,d){for(var e,f,g,h,c=new Uint32Array(a,c,3*b),i=new Uint1...
  function J (line 132) | function J(b,c,d){for(var e,f,g,h,i,c=new Uint32Array(a,c,4*b),j=new Uin...
  function K (line 132) | function K(b,c,d,e){for(var f,g,h,i,j,k,l,c=new Uint32Array(a,c,3*b),d=n...
  function R (line 133) | function R(b,c,d,e){for(var f,g,h,i,j,k,l,m,n,c=new Uint32Array(a,c,4*b)...
  function d (line 149) | function d(a,b){return b=="relativeToHTML"?a:l+"/"+a}
  function e (line 149) | function e(){var a;for(m in D.objects)if(!C.objects[m]){u=D.objects[m];i...
  function f (line 151) | function f(a){return function(b){C.geometries[a]=b;e();G=G-1;j.onLoadCom...
  function g (line 151) | function g(a){return function(b){C.geometries[a]=b}}
  function h (line 151) | function h(){j.callbackProgress({totalModels:T,totalTextures:U,loadedMod...
  function b (line 221) | function b(a){if(t!=a)n.globalAlpha=t=a}
  function c (line 221) | function c(a){if(y!=a){switch(a){case THREE.NormalBlending:n.globalCompo...
  function d (line 221) | function d(a){if(s!=a)n.strokeStyle=s=a}
  function e (line 221) | function e(a){if(w!=a)n.fillStyle=w=a}
  function m (line 225) | function m(a){var b,c,d,e;aa.setRGB(0,0,0);Ta.setRGB(0,0,0);Qa.setRGB(0,...
  function p (line 226) | function p(a,b,c,d){var e,f,g,i,h,j;e=0;for(f=a.length;e<f;e++){g=a[e];i...
  function r (line 227) | function r(a,f,g){b(g.opacity);c(g.blending);var i,h,j,k,l,m;if(g instan...
  function s (line 228) | function s(a,e,f,g){b(g.opacity);c(g.blending);n.beginPath();n.moveTo(a....
  function t (line 229) | function t(a,d,e,g,h,l,m,n){f.info.render.vertices=f.info.render.vertice...
  function u (line 234) | function u(a,d,e,g,h,l,n,m,o){f.info.render.vertices=f.info.render.verti...
  function w (line 239) | function w(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c,
  function y (line 240) | function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n....
  function Mb (line 240) | function Mb(a,b,c,e){if(H!=b)n.lineWidth=H=b;if(E!=c)n.lineCap=E=c;if(z!...
  function Eb (line 240) | function Eb(a){e(a.getContextStyle());n.fill()}
  function ad (line 240) | function ad(a,b,c,d,f,g,i,h,j,k,l,m,p){if(p.image.width!=0){if(p.needsUp...
  function gc (line 242) | function gc(a,b,c,d,e,f,g,i,h,j,k,l,m){var p,o;p=m.width-1;o=m.height-1;...
  function Cc (line 243) | function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(...
  function ac (line 244) | function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}
  function hc (line 244) | function hc(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function Nb (line 244) | function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqr...
  function a (line 250) | function a(a,b,c,d){var e,f,g,h,j,k;e=0;for(f=a.length;e<f;e++){g=a[e];h...
  function b (line 251) | function b(a){if(A[a]==null){A[a]=document.createElementNS("http://www.w...
  function c (line 251) | function c(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}
  function b (line 299) | function b(a,b){var c=a.vertices.length,d=b.material;if(d.attributes){if...
  function c (line 300) | function c(a,b){if(a.material&&!(a.material instanceof THREE.MeshFaceMat...
  function d (line 300) | function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a ...
  function e (line 300) | function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMateria...
  function f (line 300) | function f(a,b,c){var d,e,f,g,h=a.vertices;g=h.length;
  function g (line 305) | function g(a,b){return b.z-a.z}
  function h (line 305) | function h(a,b,c){if(a.length)for(var d=0,e=a.length;d<e;d++){ea=U=null;...
  function j (line 305) | function j(a,b,c,d,e,f,g,h){var i,j,k,l;if(b){j=a.length-1;l=b=-1}else{j...
  function l (line 306) | function l(a,b,c,d,e,f,g){for(var h,i,j=0,k=a.length;j<k;j++){h=a[j];i=h...
  function k (line 307) | function k(a,b,c){a.push({buffer:b,object:c,opaque:null,transparent:null})}
  function p (line 307) | function p(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)r...
  function m (line 307) | function m(a){for(var b in a.attributes)a.attributes[b].needsUpdate=false}
  function o (line 307) | function o(a,b){for(var c=a.length-1;c>=0;c--)a[c].object===
  function q (line 308) | function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}
  function n (line 308) | function n(a,b,c,d,e){if(!d.program||d.needsUpdate){G.initMaterial(d,b,c...
  function r (line 324) | function r(a,b){a._modelViewMatrix.multiply(b.matrixWorldInverse,a.matri...
  function u (line 324) | function u(a,b,c){if(Ra!==
  function t (line 325) | function t(a,b){var c;a==="fragment"?c=i.createShader(i.FRAGMENT_SHADER)...
  function y (line 325) | function y(a,b,c){if(c){i.texParameteri(a,i.TEXTURE_WRAP_S,H(b.wrapS));i...
  function s (line 326) | function s(a,b){i.bindRenderbuffer(i.RENDERBUFFER,a);if(b.depthBuffer&&!...
  function w (line 327) | function w(a){switch(a){case THREE.NearestFilter:case THREE.NearestMipMa...
  function H (line 328) | function H(a){switch(a){case THREE.RepeatWrapping:return i.REPEAT;case T...
  function c (line 442) | function c(a){function b(c,d){if(d<c)return c;var e=c+Math.floor((d-c)/2...
  function c (line 564) | function c(a,b){return function(){b.apply(a,arguments)}}
  function c (line 573) | function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}
  function d (line 573) | function d(a,b){return function(){b.apply(a,arguments)}}
  function e (line 573) | function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.g...
  function f (line 574) | function f(a,b){var c,d,e=new THREE.Geometry;for(c=0;c<a.points.length*b...
  function c (line 582) | function c(a,b){return function(){b.apply(a,arguments)}}
  function j (line 607) | function j(a,b,c,g,h,j,k,m){var n,p=d||1,o=e||1,q=h/2,r=j/2,t=l.vertices...
  function c (line 616) | function c(a,b,c){b||console.log("die");return b.clone().multiplyScalar(...
  function d (line 616) | function d(a,b,c){var d=THREE.ExtrudeGeometry.__v1,e=THREE.ExtrudeGeomet...
  function e (line 617) | function e(c,d){var e,f;for(F=c.length;--F>=0;){e=F;f=F-1;f<0&&(f=
  function f (line 618) | function f(a,b,c){A.vertices.push(new THREE.Vector3(a,b,c))}
  function g (line 618) | function g(c,d,e,f){c=c+J;d=d+J;e=e+J;A.faces.push(new THREE.Face3(c,d,e...
  function h (line 646) | function h(a,b,c,d,e,f){var g=Math.cos(a);Math.cos(b);b=Math.sin(a);a=c/...
  function e (line 656) | function e(a){var b=a.normalize().clone();b.index=j.vertices.push(b)-1;v...
  function f (line 656) | function f(a,b,c,d){if(d<1){d=new THREE.Face3(a.index,b.index,c.index,[a...
  function g (line 657) | function g(a,b){p[a.index]||(p[a.index]=[]);p[b.index]||(p[b.index]=[]);...
  function h (line 657) | function h(a,b,c){c<0&&a.u===1&&(a=new THREE.UV(a.u-1,a.v));b.x===0&&b.z...
  function b (line 669) | function b(a,b,d){c(a,d);c(b,d)}
  function c (line 669) | function c(a,b){d.lineGeometry.vertices.push(new THREE.Vector3);d.lineGe...
  function a (line 672) | function a(a,d,e,f){THREE.CameraHelper.__v.set(d,e,f);THREE.CameraHelper...
  function b (line 675) | function b(){m.debug&&console.log.apply(console,arguments)}
  function c (line 675) | function c(){console&&console.log.apply(console,arguments)}
  function d (line 675) | function d(a,c,d,e,g,h,i){var j=new THREE.Face4(a,c,d,e,null,g.color,g.m...
  function e (line 676) | function e(a,b){return Math.min(a,b)+"_"+Math.max(a,b)}
  function f (line 676) | function f(a,d){var e=a+":"+d,f=t[e];if(!f){a>=y&&a<y+q.length?b("face p...
  function g (line 676) | function g(a,b,d){var e=a+":"+b;e in t?c("dup vertexNo",a,"oldFaceNo",b,...
  function h (line 676) | function h(a,
  function j (line 677) | function j(a,b,c){P[a]===void 0&&(P[a]={});P[a][b]=c}
  function b (line 678) | function b(a,c){h[a]===void 0&&(h[a]=[]);h[a].push(c)}
  function a (line 695) | function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER...
  function a (line 715) | function a(a,b){return b.z-a.z}

FILE: Terrain/js/events.js
  function init (line 8) | function init() {
  function configure (line 12) | function configure(conf) {
  function EventEmitter (line 22) | function EventEmitter(conf) {
  function searchListenerTree (line 32) | function searchListenerTree(handlers, type, tree, i) {
  function growListenerTree (line 138) | function growListenerTree(type, listener) {
  function listener (line 228) | function listener() {

FILE: Terrain/js/perlinnoise.js
  function fade (line 51) | function fade(t) { return t * t * t * (t * (t * 6 - 15) + 10); }
  function lerp (line 52) | function lerp( t, a, b) { return a + t * (b - a); }
  function grad (line 53) | function grad(hash, x, y, z) {
  function scale (line 59) | function scale(n) { return (1 + n)/2; }

FILE: Terrain/js/testdata.js
  function createTestData (line 1) | function createTestData() {

FILE: Terrain/js/webgl.js
  function VertexBuffer (line 20) | function VertexBuffer(args) {
  function createShaderObject (line 91) | function createShaderObject (src, type) {
  function getParams (line 129) | function getParams(src, uniforms, attributes) {
  function addUniform (line 140) | function addUniform(container, program, uniform, type) {
  function addAttribute (line 172) | function addAttribute(container, program, attribute, type) {
  function Shader (line 201) | function Shader(vertex_shader, fragment_shader) {
  function check_error (line 283) | function check_error() {
  function onWindowResize (line 292) | function onWindowResize (event) {
  function animate (line 329) | function animate () {

FILE: Terrain/require.js
  function normalizeArray (line 8) | function normalizeArray (v, keepBlanks) {
  function normalizeId (line 35) | function normalizeId(id, parentId) {
  function normalizeUrl (line 41) | function normalizeUrl(url, baseLocation) {
  function require (line 70) | function require (id, parentId) {
  function define (line 96) | function define (id, uri, block) {
  function load (line 139) | function load (spec, callback) {
Condensed preview — 581 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (7,035K chars).
[
  {
    "path": "Arrays/Makefile",
    "chars": 353,
    "preview": "# makefile to automatize simple operations\n\nserver:\n\tpython -m SimpleHTTPServer\n\ndeploy:\n\t# assume there is something to"
  },
  {
    "path": "Arrays/css/main.css",
    "chars": 434,
    "preview": "body {\n\toverflow\t: hidden;\n\tpadding\t\t: 0;\n\tmargin\t\t: 0;\n\n\tcolor\t\t: #222;\n\tbackground-color: #BBB;\n\tfont-family\t: arial;\n"
  },
  {
    "path": "Arrays/data_structures/linked_list.js",
    "chars": 1270,
    "preview": "function Cell(prev, next, value) {\n  this.prev = prev;\n  this.next = next;\n  this.value = value;\n}\n\nfunction List(head, "
  },
  {
    "path": "Arrays/data_structures/ordered_array.js",
    "chars": 559,
    "preview": "exports.create = function() {\n  return [];\n}\n\nexports.insert = function(array, iter, value) {\n  array.splice(iter, 0, va"
  },
  {
    "path": "Arrays/data_structures/unordered_array.js",
    "chars": 670,
    "preview": "exports.create = function() {\n  return [];\n}\n\nexports.insert = function(array, iter, value) {\n  //Not supported  \n  thro"
  },
  {
    "path": "Arrays/particles.html",
    "chars": 3946,
    "preview": "<html>\n  <head>\n    <title>Particle Test</title>\n    <script src=\"require.js\"></script>\n    <link rel=\"stylesheet\" type="
  },
  {
    "path": "Arrays/require.js",
    "chars": 2330,
    "preview": "// ==Closure.compiler==\n// @compilation_level SIMPLE_OPTIMIZATIONS\n// ==/Closure.compiler==\n\n// Require() 0.3.2 unstable"
  },
  {
    "path": "Arrays/test_cases/particles.js",
    "chars": 1016,
    "preview": "\nfunction Particle() {\n  this.x = 0.0;\n  this.y = 0.0;  \n  var t = Math.random() * Math.PI * 2.0\n    , r = Math.random()"
  },
  {
    "path": "Arrays/test_cases/test_construct.js",
    "chars": 697,
    "preview": "var Seq = require(process.argv[2]);\n\n//Create initial data structure\nfor(var i=5; i<23; ++i) {\n  var n = (1<<i)\n    , d "
  },
  {
    "path": "Arrays/test_cases/test_particles.js",
    "chars": 501,
    "preview": "var particles = require('./particles.js').create_particle_system({\n    data_structure: require(process.argv[2]).create\n "
  },
  {
    "path": "DataStructures/Makefile",
    "chars": 353,
    "preview": "# makefile to automatize simple operations\n\nserver:\n\tpython -m SimpleHTTPServer\n\ndeploy:\n\t# assume there is something to"
  },
  {
    "path": "DataStructures/css/main.css",
    "chars": 434,
    "preview": "body {\n\toverflow\t: hidden;\n\tpadding\t\t: 0;\n\tmargin\t\t: 0;\n\n\tcolor\t\t: #222;\n\tbackground-color: #BBB;\n\tfont-family\t: arial;\n"
  },
  {
    "path": "DataStructures/index.html",
    "chars": 3681,
    "preview": "<html>\n  <head>\n    <title>Particle Test</title>\n    <script src=\"require.js\"></script>\n    <link rel=\"stylesheet\" type="
  },
  {
    "path": "DataStructures/require.js",
    "chars": 3206,
    "preview": "// ==Closure.compiler==\n// @compilation_level SIMPLE_OPTIMIZATIONS\n// ==/Closure.compiler==\n\n// Require() 0.3.2 unstable"
  },
  {
    "path": "DataStructures/structures/list.js",
    "chars": 1976,
    "preview": "exports.create = function(ArrayType, item_size) {\n\n  function Cell(next, prev, value) {\n    this.next   = next;\n    this"
  },
  {
    "path": "DataStructures/structures/pma.js",
    "chars": 1330,
    "preview": "//Packed memory array\n//\n// Supports fast iteration like vector, but O(log^2(n)) insert/delete like linked list\n//\nexpor"
  },
  {
    "path": "DataStructures/structures/unordered_vector.js",
    "chars": 353,
    "preview": "var vector = require('./vector.js');\n\nexports.create = function(ArrayType, item_size) {\n  var vec = vector.create(ArrayT"
  },
  {
    "path": "DataStructures/structures/vector.js",
    "chars": 2047,
    "preview": "//A flat array of fixed size items stored in a packed type array.\n//\n// Basically this class is a workaround for the lac"
  },
  {
    "path": "DataStructures/tests/particles.js",
    "chars": 1379,
    "preview": "exports.create_particle_system = function(options) {\n  var particles   = options.data_structure(Float32Array, 5)\n    , a"
  },
  {
    "path": "DataStructures/tests/test_particles.js",
    "chars": 598,
    "preview": "var particles = require('./particles.js').create_particle_system({\n    data_structure: require(process.argv[2]).create\n "
  },
  {
    "path": "Downsample/MIT-LICENSE.txt",
    "chars": 1078,
    "preview": "Copyright (c) 2011 Jerome Etienne, http://jetienne.com\n\nPermission is hereby granted, free of charge, to any person obta"
  },
  {
    "path": "Downsample/Makefile",
    "chars": 353,
    "preview": "# makefile to automatize simple operations\n\nserver:\n\tpython -m SimpleHTTPServer\n\ndeploy:\n\t# assume there is something to"
  },
  {
    "path": "Downsample/css/main.css",
    "chars": 524,
    "preview": "body {\n\toverflow\t: hidden;\n\tpadding\t\t: 0;\n\tmargin\t\t: 0;\n\n\tcolor\t\t: #222;\n\tbackground-color: #BBB;\n\tfont-family\t: arial;\n"
  },
  {
    "path": "Downsample/experiment.txt",
    "chars": 1736,
    "preview": "\nMethod:  tested each algorithm on 65^3 grid.  Plotted the function\n\n  sin(omega * x) + sin(omega * y) + sin(omega * z)\n"
  },
  {
    "path": "Downsample/index.html",
    "chars": 8894,
    "preview": "<!doctype html>\n<html>\n\t<head>\n\t\t<title>Volume Sampling Toolbox</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\""
  },
  {
    "path": "Downsample/js/boxfilter.js",
    "chars": 1174,
    "preview": "\n//Naive box filter for downsampling volume\nfunction BoxFilter(volume, dims) {\n  \"use strict\";\n  \n  var ndims = new Int3"
  },
  {
    "path": "Downsample/js/closing.js",
    "chars": 1658,
    "preview": "\n//Morophological closing filter\nfunction ClosingFilter(volume, dims) {\n  \"use strict\";\n  \n\n  //Dilate\n  var pvolume = n"
  },
  {
    "path": "Downsample/js/marchingcubes.js",
    "chars": 13789,
    "preview": "/**\n * Javascript Marching Cubes\n *\n * Based on Paul Bourke's classic implementation:\n *    http://local.wasp.uwa.edu.au"
  },
  {
    "path": "Downsample/js/marchingtetrahedra.js",
    "chars": 4497,
    "preview": "/**\n * Marching Tetrahedra in Javascript\n *\n * Based on Paul Bourke's implementation\n *  http://local.wasp.uwa.edu.au/~p"
  },
  {
    "path": "Downsample/js/maxfilter.js",
    "chars": 924,
    "preview": "\n//Maximum filter\nfunction MaxFilter(volume, dims) {\n  \"use strict\";\n  \n  var ndims = new Int32Array(3);\n  for(var i=0; "
  },
  {
    "path": "Downsample/js/medianfilter.js",
    "chars": 1267,
    "preview": "\n//Median filter\nfunction MedianFilter(volume, dims) {\n  \"use strict\";\n  \n  var ndims = new Int32Array(3);\n  for(var i=0"
  },
  {
    "path": "Downsample/js/minfilter.js",
    "chars": 925,
    "preview": "\n//Minimum filter\nfunction MinFilter(volume, dims) {\n  \"use strict\";\n  \n  var ndims = new Int32Array(3);\n  for(var i=0; "
  },
  {
    "path": "Downsample/js/nearestfilter.js",
    "chars": 609,
    "preview": "\n//Naive box filter for downsampling volume\nfunction NearestFilter(volume, dims) {\n  \"use strict\";\n  \n  var ndims = new "
  },
  {
    "path": "Downsample/js/opening.js",
    "chars": 1642,
    "preview": "\n//Morophological opening filter\nfunction OpeningFilter(volume, dims) {\n  \"use strict\";\n  \n\n  //Erode\n  var pvolume = ne"
  },
  {
    "path": "Downsample/js/perlinnoise.js",
    "chars": 3276,
    "preview": "\n//This code is from Kas Thomas' blog:\n//  http://asserttrue.blogspot.de/2011/12/perlin-noise-in-javascript_31.html\n\n// "
  },
  {
    "path": "Downsample/js/surfacenets.js",
    "chars": 5381,
    "preview": "/**\n * SurfaceNets in JavaScript\n *\n * Written by Mikola Lysenko (C) 2012\n *\n * MIT License\n *\n * Based on: S.F. Gibson,"
  },
  {
    "path": "Downsample/js/testdata.js",
    "chars": 4262,
    "preview": "function createTestData() {\n  var result = {};\n  \n  function triangle_wave(t) {\n    var it = Math.floor(t);\n    if(!!(it"
  },
  {
    "path": "Downsample/vendor/dsp.js",
    "chars": 66759,
    "preview": "/* \n *  DSP.js - a comprehensive digital signal processing  library for javascript\n * \n *  Created by Corban Brook <corb"
  },
  {
    "path": "Downsample/vendor/three.js/Detector.js",
    "chars": 1800,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author mr.doob / http://mrdoob.com/\n */\n\nDetector = {\n\n\tcanvas :"
  },
  {
    "path": "Downsample/vendor/three.js/ShaderExtras.js",
    "chars": 45162,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author zz85 / http://www.lab4games.net/zz85/blog\n *\n * ShaderExt"
  },
  {
    "path": "Downsample/vendor/three.js/Stats.js",
    "chars": 2670,
    "preview": "// stats.js r8 - http://github.com/mrdoob/stats.js\nvar Stats=function(){var h,a,n=0,o=0,i=Date.now(),u=i,p=i,l=0,q=1E3,r"
  },
  {
    "path": "Downsample/vendor/three.js/Three.js",
    "chars": 364242,
    "preview": "// Three.js - http://github.com/mrdoob/three.js\n'use strict';var THREE=THREE||{REVISION:\"49\"};self.Int32Array||(self.Int"
  },
  {
    "path": "Downsample/vendor/three.js/postprocessing/BloomPass.js",
    "chars": 3213,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.BloomPass = function( strength, kernelSize, sigma, resolu"
  },
  {
    "path": "Downsample/vendor/three.js/postprocessing/DotScreenPass.js",
    "chars": 1205,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.DotScreenPass = function( center, angle, scale ) {\n\n\tvar "
  },
  {
    "path": "Downsample/vendor/three.js/postprocessing/EffectComposer.js",
    "chars": 3290,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.EffectComposer = function( renderer, renderTarget ) {\n\n\tt"
  },
  {
    "path": "Downsample/vendor/three.js/postprocessing/FilmPass.js",
    "chars": 1319,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.FilmPass = function( noiseIntensity, scanlinesIntensity, "
  },
  {
    "path": "Downsample/vendor/three.js/postprocessing/MaskPass.js",
    "chars": 1622,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.MaskPass = function ( scene, camera ) {\n\n\tthis.scene = sc"
  },
  {
    "path": "Downsample/vendor/three.js/postprocessing/RenderPass.js",
    "chars": 1052,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.RenderPass = function ( scene, camera, overrideMaterial, "
  },
  {
    "path": "Downsample/vendor/three.js/postprocessing/SavePass.js",
    "chars": 1199,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.SavePass = function( renderTarget ) {\n\n\tvar shader = THRE"
  },
  {
    "path": "Downsample/vendor/three.js/postprocessing/ShaderPass.js",
    "chars": 1008,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ShaderPass = function( shader, textureID ) {\n\n\tthis.textu"
  },
  {
    "path": "Downsample/vendor/three.js/postprocessing/TexturePass.js",
    "chars": 810,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.TexturePass = function( texture, opacity ) {\n\n\tvar shader"
  },
  {
    "path": "Downsample/vendor/threex/Makefile",
    "chars": 470,
    "preview": "# simple makefile to avoid repeatitive tasks\n\nbuildDoc:\n\tdocco *.js\n\nmonitorDoc: build\n\t(while inotifywait -r -e modify,"
  },
  {
    "path": "Downsample/vendor/threex/README.md",
    "chars": 591,
    "preview": "* This should be the root of a git repository but i dunno how to handle submodule\n\n# TODO\n* document those\n  * you write"
  },
  {
    "path": "Downsample/vendor/threex/THREEx.CelShader.js",
    "chars": 2235,
    "preview": "// define namespaces\nvar THREEx\t\t= THREEx || {};\nTHREEx.ShaderLib\t= THREEx.ShaderLib\t|| {};\nTHREEx.UniformsLib\t= THREEx."
  },
  {
    "path": "Downsample/vendor/threex/THREEx.DeviceOrientationState.js",
    "chars": 1193,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx \t\t|| {};\n\nTHREEx.DeviceOrientationState\t= function()\n{\n\t// to store the current st"
  },
  {
    "path": "Downsample/vendor/threex/THREEx.FullScreen.js",
    "chars": 3376,
    "preview": "// This THREEx helper makes it easy to handle the fullscreen API\n// * it hides the prefix for each browser\n// * it hides"
  },
  {
    "path": "Downsample/vendor/threex/THREEx.GeometryUtils.js",
    "chars": 3423,
    "preview": "// This THREEx helper provide various basic functions for ```THREE.Geometry```.\n// It is able to scale, translate, cente"
  },
  {
    "path": "Downsample/vendor/threex/THREEx.GeometryWobble.js",
    "chars": 1768,
    "preview": "var THREEx\t\t= THREEx || {};\n\nTHREEx.GeometryWobble\t= {};\n\n// Geometry Wobble\n// based on paul lewis / areotwist - http:/"
  },
  {
    "path": "Downsample/vendor/threex/THREEx.KeyboardState.js",
    "chars": 3173,
    "preview": "// THREEx.KeyboardState.js keep the current state of the keyboard.\n// It is possible to query it at any time. No need of"
  },
  {
    "path": "Downsample/vendor/threex/THREEx.LogoTurtle.js",
    "chars": 1001,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx\t|| {};\n\n// TODO should those relative polar coord function be INSIDE path already "
  },
  {
    "path": "Downsample/vendor/threex/THREEx.PlasmaShader.js",
    "chars": 3118,
    "preview": "// define namespaces\nvar THREEx\t\t= THREEx || {};\nTHREEx.ShaderLib\t= THREEx.ShaderLib\t|| {};\nTHREEx.UniformsLib\t= THREEx."
  },
  {
    "path": "Downsample/vendor/threex/THREEx.SkyMap.js",
    "chars": 1485,
    "preview": "var THREEx\t\t= THREEx || {};\n\nTHREEx.SkyMap\t= {};\n\nTHREEx.SkyMap.buildMesh\t= function(urls, opts)\n{\n\t// get parameters\n\to"
  },
  {
    "path": "Downsample/vendor/threex/THREEx.WindowResize.js",
    "chars": 1264,
    "preview": "// This THREEx helper makes it easy to handle window resize.\n// It will update renderer and camera when window is resize"
  },
  {
    "path": "Downsample/vendor/threex/THREEx.glCapability.js",
    "chars": 1573,
    "preview": "/**\n * Define namespace\n*/\nif(typeof THREEx === \"undefined\")\tvar THREEx\t= {};\n\n\n/**\n * return the capability of a WebGl "
  },
  {
    "path": "Downsample/vendor/threex/THREEx.requestAnimationFrame.js",
    "chars": 1018,
    "preview": "/**\n * Provides requestAnimationFrame/cancelRequestAnimation in a cross browser way.\n * from paul irish + jerome etienne"
  },
  {
    "path": "Downsample/vendor/threex/THREEx.screenshot.js",
    "chars": 4137,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx \t\t|| {};\n\n// TODO http://29a.ch/2011/9/11/uploading-from-html5-canvas-to-imgur-dat"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.CelShader.html",
    "chars": 10731,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.CelShader.js</title>   <meta http-equiv=\"content-type\" content=\"text/html"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.CubeMap.html",
    "chars": 3585,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.CubeMap.js</title>   <meta http-equiv=\"content-type\" content=\"text/html; "
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.DeviceOrientationState.html",
    "chars": 11048,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.DeviceOrientationState.js</title>   <meta http-equiv=\"content-type\" conte"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.FullScreen.html",
    "chars": 11643,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.FullScreen.js</title>   <meta http-equiv=\"content-type\" content=\"text/htm"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.GeometryUtils.html",
    "chars": 23972,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.GeometryUtils.js</title>   <meta http-equiv=\"content-type\" content=\"text/"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.GeometryWobble.html",
    "chars": 14966,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.GeometryWobble.js</title>   <meta http-equiv=\"content-type\" content=\"text"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.KeyboardState.html",
    "chars": 18793,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.KeyboardState.js</title>   <meta http-equiv=\"content-type\" content=\"text/"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.LogoTurtle.html",
    "chars": 10448,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.LogoTurtle.js</title>   <meta http-equiv=\"content-type\" content=\"text/htm"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.PlasmaShader.html",
    "chars": 15797,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.PlasmaShader.js</title>   <meta http-equiv=\"content-type\" content=\"text/h"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.SkyMap.html",
    "chars": 12911,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.SkyMap.js</title>   <meta http-equiv=\"content-type\" content=\"text/html; c"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.WindowResize.html",
    "chars": 8296,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.WindowResize.js</title>   <meta http-equiv=\"content-type\" content=\"text/h"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.glCapability.html",
    "chars": 10754,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.glCapability.js</title>   <meta http-equiv=\"content-type\" content=\"text/h"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.requestAnimationFrame.html",
    "chars": 6640,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.requestAnimationFrame.js</title>   <meta http-equiv=\"content-type\" conten"
  },
  {
    "path": "Downsample/vendor/threex/docs/THREEx.screenshot.html",
    "chars": 25570,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.screenshot.js</title>   <meta http-equiv=\"content-type\" content=\"text/htm"
  },
  {
    "path": "Downsample/vendor/threex/docs/docco.css",
    "chars": 7101,
    "preview": "/*--------------------- Layout and Typography ----------------------------*/\nbody {\n  font-family: 'Palatino Linotype', "
  },
  {
    "path": "Downsample/vendor/threex/examples/THREEx.DeviceOrientationState.html",
    "chars": 643,
    "preview": "<html>\n<body>\n\tangleX: <span id=\"angleX\"></span><br/>\n\tangleY: <span id=\"angleY\"></span><br/>\n\tangleZ: <span id=\"angleZ\""
  },
  {
    "path": "Downsample/vendor/threex/examples/THREEx.KeyboardState.html",
    "chars": 293,
    "preview": "<html>\n<body>\n\t<script src=\"../THREEx.KeyboardState.js\"></script>\n\t<script>\n\tvar keyboard\t= new THREEx.KeyboardState();\n"
  },
  {
    "path": "Downsample/vendor/threex/examples/threex.embedded/noshield-host.html",
    "chars": 228,
    "preview": "<html>\n\t<body>\n\t\t<iframe src=\"noshield-iframe.html\"width='320' height='240'></iframe>\n\n\t\t<div style=\"height:1024px; back"
  },
  {
    "path": "Downsample/vendor/threex/examples/threex.embedded/noshield-iframe.html",
    "chars": 702,
    "preview": "<html>\n\t<head>\n\t\t<style>\n\t\t\tbody .noFocusMessage\t\t{ display\t: block;\t}\n\t\t\tbody .withFocusMessage \t\t{ display\t: none;\t\t}\n"
  },
  {
    "path": "Downsample/vendor/threex/examples/threex.embedded/withshield-host.html",
    "chars": 231,
    "preview": "<html>\n\t<body>\n\t\t<iframe src=\"withshield-iframe.html\" width='320' height='240'></iframe>\n\n\t\t<div style=\"height:1024px; b"
  },
  {
    "path": "Downsample/vendor/threex/examples/threex.embedded/withshield-iframe.html",
    "chars": 843,
    "preview": "<html>\n\t<head>\n\t\t<style>\n\t\t\tbody .noFocusMessage\t\t{ display\t: block;\t}\n\t\t\tbody .withFocusMessage \t\t{ display\t: none;\t\t}\n"
  },
  {
    "path": "Downsample/vendor/threex/examples/threex.fullscreen.html",
    "chars": 1293,
    "preview": "<html>\n<body>\n\t<h1>threex.fullscreen.js demo</h1>\n\t<a href=\"https://github.com/jeromeetienne/threex\">threex.js</a> - hel"
  },
  {
    "path": "Downsample/vendor/threex/threex.chromeWebStoreInstall.js",
    "chars": 1376,
    "preview": "// This THREEx helper makes it easy to handle chrome.webstore.install API.\n// * api description http://code.google.com/c"
  },
  {
    "path": "Downsample/vendor/threex/threex.embedded.js",
    "chars": 569,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx \t\t|| {};\nTHREEx.Embedded\t= THREEx.Embedded\t|| {};\n\n/**\n * @returns {Boolean} retur"
  },
  {
    "path": "Downsample/vendor/threex/threex.sparks.js",
    "chars": 6983,
    "preview": "// This THREEx helper makes it even easier to use spark.js with three.js\n// * FIXME This is currently only with WebGL\n\n/"
  },
  {
    "path": "Downsample/vendor/threex/threex.texturePoolBall.js",
    "chars": 2196,
    "preview": "// NOTE: this match THREE namespace on purpose\nif(typeof THREEx === \"undefined\")\t\tvar THREEx\t= {};\nif(typeof THREEx.Text"
  },
  {
    "path": "Downsample/vendor/threex.dragpancontrols.js",
    "chars": 2298,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx \t\t|| {};\n\nTHREEx.DragPanControls\t= function(object, domElement)\n{\n\tthis._object\t= "
  },
  {
    "path": "Isosurface/MIT-LICENSE.txt",
    "chars": 1078,
    "preview": "Copyright (c) 2011 Jerome Etienne, http://jetienne.com\n\nPermission is hereby granted, free of charge, to any person obta"
  },
  {
    "path": "Isosurface/Makefile",
    "chars": 353,
    "preview": "# makefile to automatize simple operations\n\nserver:\n\tpython -m SimpleHTTPServer\n\ndeploy:\n\t# assume there is something to"
  },
  {
    "path": "Isosurface/css/main.css",
    "chars": 524,
    "preview": "body {\n\toverflow\t: hidden;\n\tpadding\t\t: 0;\n\tmargin\t\t: 0;\n\n\tcolor\t\t: #222;\n\tbackground-color: #BBB;\n\tfont-family\t: arial;\n"
  },
  {
    "path": "Isosurface/experiment.txt",
    "chars": 1736,
    "preview": "\nMethod:  tested each algorithm on 65^3 grid.  Plotted the function\n\n  sin(omega * x) + sin(omega * y) + sin(omega * z)\n"
  },
  {
    "path": "Isosurface/index.html",
    "chars": 8489,
    "preview": "<!doctype html>\n<html>\n\t<head>\n\t\t<title>Isosurface Toolbox</title>\n\t\t<meta charset=\"utf-8\">\n\t\t<meta name=\"viewport\" cont"
  },
  {
    "path": "Isosurface/js/benchmark.js",
    "chars": 1067,
    "preview": "\nrequire('nodetime').profile();\n\nvar mesher = require(process.argv[2]).mesher\n  , res = parseInt(process.argv[3])\n  , ma"
  },
  {
    "path": "Isosurface/js/marchingcubes.js",
    "chars": 14936,
    "preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2012-2013 Mikola Lysenko\n//\n// Permission is hereby granted, free of charge"
  },
  {
    "path": "Isosurface/js/marchingtetrahedra.js",
    "chars": 5644,
    "preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2012-2013 Mikola Lysenko\n//\n// Permission is hereby granted, free of charge"
  },
  {
    "path": "Isosurface/js/perlinnoise.js",
    "chars": 3276,
    "preview": "\n//This code is from Kas Thomas' blog:\n//  http://asserttrue.blogspot.de/2011/12/perlin-noise-in-javascript_31.html\n\n// "
  },
  {
    "path": "Isosurface/js/surfacenets.js",
    "chars": 6528,
    "preview": "// The MIT License (MIT)\n//\n// Copyright (c) 2012-2013 Mikola Lysenko\n//\n// Permission is hereby granted, free of charge"
  },
  {
    "path": "Isosurface/js/testdata.js",
    "chars": 6608,
    "preview": "function createTestData() {\n  var result = {};\n  \n  function memoize(f) {\n    var cached = null;\n    return function() {"
  },
  {
    "path": "Isosurface/vendor/three.js/Detector.js",
    "chars": 1800,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author mr.doob / http://mrdoob.com/\n */\n\nDetector = {\n\n\tcanvas :"
  },
  {
    "path": "Isosurface/vendor/three.js/ShaderExtras.js",
    "chars": 45162,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author zz85 / http://www.lab4games.net/zz85/blog\n *\n * ShaderExt"
  },
  {
    "path": "Isosurface/vendor/three.js/Stats.js",
    "chars": 2670,
    "preview": "// stats.js r8 - http://github.com/mrdoob/stats.js\nvar Stats=function(){var h,a,n=0,o=0,i=Date.now(),u=i,p=i,l=0,q=1E3,r"
  },
  {
    "path": "Isosurface/vendor/three.js/Three.js",
    "chars": 364242,
    "preview": "// Three.js - http://github.com/mrdoob/three.js\n'use strict';var THREE=THREE||{REVISION:\"49\"};self.Int32Array||(self.Int"
  },
  {
    "path": "Isosurface/vendor/three.js/postprocessing/BloomPass.js",
    "chars": 3213,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.BloomPass = function( strength, kernelSize, sigma, resolu"
  },
  {
    "path": "Isosurface/vendor/three.js/postprocessing/DotScreenPass.js",
    "chars": 1205,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.DotScreenPass = function( center, angle, scale ) {\n\n\tvar "
  },
  {
    "path": "Isosurface/vendor/three.js/postprocessing/EffectComposer.js",
    "chars": 3290,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.EffectComposer = function( renderer, renderTarget ) {\n\n\tt"
  },
  {
    "path": "Isosurface/vendor/three.js/postprocessing/FilmPass.js",
    "chars": 1319,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.FilmPass = function( noiseIntensity, scanlinesIntensity, "
  },
  {
    "path": "Isosurface/vendor/three.js/postprocessing/MaskPass.js",
    "chars": 1622,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.MaskPass = function ( scene, camera ) {\n\n\tthis.scene = sc"
  },
  {
    "path": "Isosurface/vendor/three.js/postprocessing/RenderPass.js",
    "chars": 1052,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.RenderPass = function ( scene, camera, overrideMaterial, "
  },
  {
    "path": "Isosurface/vendor/three.js/postprocessing/SavePass.js",
    "chars": 1199,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.SavePass = function( renderTarget ) {\n\n\tvar shader = THRE"
  },
  {
    "path": "Isosurface/vendor/three.js/postprocessing/ShaderPass.js",
    "chars": 1008,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ShaderPass = function( shader, textureID ) {\n\n\tthis.textu"
  },
  {
    "path": "Isosurface/vendor/three.js/postprocessing/TexturePass.js",
    "chars": 810,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.TexturePass = function( texture, opacity ) {\n\n\tvar shader"
  },
  {
    "path": "Isosurface/vendor/threex/Makefile",
    "chars": 470,
    "preview": "# simple makefile to avoid repeatitive tasks\n\nbuildDoc:\n\tdocco *.js\n\nmonitorDoc: build\n\t(while inotifywait -r -e modify,"
  },
  {
    "path": "Isosurface/vendor/threex/README.md",
    "chars": 591,
    "preview": "* This should be the root of a git repository but i dunno how to handle submodule\n\n# TODO\n* document those\n  * you write"
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.CelShader.js",
    "chars": 2235,
    "preview": "// define namespaces\nvar THREEx\t\t= THREEx || {};\nTHREEx.ShaderLib\t= THREEx.ShaderLib\t|| {};\nTHREEx.UniformsLib\t= THREEx."
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.DeviceOrientationState.js",
    "chars": 1193,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx \t\t|| {};\n\nTHREEx.DeviceOrientationState\t= function()\n{\n\t// to store the current st"
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.FullScreen.js",
    "chars": 3376,
    "preview": "// This THREEx helper makes it easy to handle the fullscreen API\n// * it hides the prefix for each browser\n// * it hides"
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.GeometryUtils.js",
    "chars": 3423,
    "preview": "// This THREEx helper provide various basic functions for ```THREE.Geometry```.\n// It is able to scale, translate, cente"
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.GeometryWobble.js",
    "chars": 1768,
    "preview": "var THREEx\t\t= THREEx || {};\n\nTHREEx.GeometryWobble\t= {};\n\n// Geometry Wobble\n// based on paul lewis / areotwist - http:/"
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.KeyboardState.js",
    "chars": 3173,
    "preview": "// THREEx.KeyboardState.js keep the current state of the keyboard.\n// It is possible to query it at any time. No need of"
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.LogoTurtle.js",
    "chars": 1001,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx\t|| {};\n\n// TODO should those relative polar coord function be INSIDE path already "
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.PlasmaShader.js",
    "chars": 3118,
    "preview": "// define namespaces\nvar THREEx\t\t= THREEx || {};\nTHREEx.ShaderLib\t= THREEx.ShaderLib\t|| {};\nTHREEx.UniformsLib\t= THREEx."
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.SkyMap.js",
    "chars": 1485,
    "preview": "var THREEx\t\t= THREEx || {};\n\nTHREEx.SkyMap\t= {};\n\nTHREEx.SkyMap.buildMesh\t= function(urls, opts)\n{\n\t// get parameters\n\to"
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.WindowResize.js",
    "chars": 1264,
    "preview": "// This THREEx helper makes it easy to handle window resize.\n// It will update renderer and camera when window is resize"
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.glCapability.js",
    "chars": 1573,
    "preview": "/**\n * Define namespace\n*/\nif(typeof THREEx === \"undefined\")\tvar THREEx\t= {};\n\n\n/**\n * return the capability of a WebGl "
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.requestAnimationFrame.js",
    "chars": 1018,
    "preview": "/**\n * Provides requestAnimationFrame/cancelRequestAnimation in a cross browser way.\n * from paul irish + jerome etienne"
  },
  {
    "path": "Isosurface/vendor/threex/THREEx.screenshot.js",
    "chars": 4137,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx \t\t|| {};\n\n// TODO http://29a.ch/2011/9/11/uploading-from-html5-canvas-to-imgur-dat"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.CelShader.html",
    "chars": 10731,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.CelShader.js</title>   <meta http-equiv=\"content-type\" content=\"text/html"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.CubeMap.html",
    "chars": 3585,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.CubeMap.js</title>   <meta http-equiv=\"content-type\" content=\"text/html; "
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.DeviceOrientationState.html",
    "chars": 11048,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.DeviceOrientationState.js</title>   <meta http-equiv=\"content-type\" conte"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.FullScreen.html",
    "chars": 11643,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.FullScreen.js</title>   <meta http-equiv=\"content-type\" content=\"text/htm"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.GeometryUtils.html",
    "chars": 23972,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.GeometryUtils.js</title>   <meta http-equiv=\"content-type\" content=\"text/"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.GeometryWobble.html",
    "chars": 14966,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.GeometryWobble.js</title>   <meta http-equiv=\"content-type\" content=\"text"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.KeyboardState.html",
    "chars": 18793,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.KeyboardState.js</title>   <meta http-equiv=\"content-type\" content=\"text/"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.LogoTurtle.html",
    "chars": 10448,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.LogoTurtle.js</title>   <meta http-equiv=\"content-type\" content=\"text/htm"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.PlasmaShader.html",
    "chars": 15797,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.PlasmaShader.js</title>   <meta http-equiv=\"content-type\" content=\"text/h"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.SkyMap.html",
    "chars": 12911,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.SkyMap.js</title>   <meta http-equiv=\"content-type\" content=\"text/html; c"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.WindowResize.html",
    "chars": 8296,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.WindowResize.js</title>   <meta http-equiv=\"content-type\" content=\"text/h"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.glCapability.html",
    "chars": 10754,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.glCapability.js</title>   <meta http-equiv=\"content-type\" content=\"text/h"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.requestAnimationFrame.html",
    "chars": 6640,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.requestAnimationFrame.js</title>   <meta http-equiv=\"content-type\" conten"
  },
  {
    "path": "Isosurface/vendor/threex/docs/THREEx.screenshot.html",
    "chars": 25570,
    "preview": "<!DOCTYPE html>  <html> <head>   <title>THREEx.screenshot.js</title>   <meta http-equiv=\"content-type\" content=\"text/htm"
  },
  {
    "path": "Isosurface/vendor/threex/docs/docco.css",
    "chars": 7101,
    "preview": "/*--------------------- Layout and Typography ----------------------------*/\nbody {\n  font-family: 'Palatino Linotype', "
  },
  {
    "path": "Isosurface/vendor/threex/examples/THREEx.DeviceOrientationState.html",
    "chars": 643,
    "preview": "<html>\n<body>\n\tangleX: <span id=\"angleX\"></span><br/>\n\tangleY: <span id=\"angleY\"></span><br/>\n\tangleZ: <span id=\"angleZ\""
  },
  {
    "path": "Isosurface/vendor/threex/examples/THREEx.KeyboardState.html",
    "chars": 293,
    "preview": "<html>\n<body>\n\t<script src=\"../THREEx.KeyboardState.js\"></script>\n\t<script>\n\tvar keyboard\t= new THREEx.KeyboardState();\n"
  },
  {
    "path": "Isosurface/vendor/threex/examples/threex.embedded/noshield-host.html",
    "chars": 228,
    "preview": "<html>\n\t<body>\n\t\t<iframe src=\"noshield-iframe.html\"width='320' height='240'></iframe>\n\n\t\t<div style=\"height:1024px; back"
  },
  {
    "path": "Isosurface/vendor/threex/examples/threex.embedded/noshield-iframe.html",
    "chars": 702,
    "preview": "<html>\n\t<head>\n\t\t<style>\n\t\t\tbody .noFocusMessage\t\t{ display\t: block;\t}\n\t\t\tbody .withFocusMessage \t\t{ display\t: none;\t\t}\n"
  },
  {
    "path": "Isosurface/vendor/threex/examples/threex.embedded/withshield-host.html",
    "chars": 231,
    "preview": "<html>\n\t<body>\n\t\t<iframe src=\"withshield-iframe.html\" width='320' height='240'></iframe>\n\n\t\t<div style=\"height:1024px; b"
  },
  {
    "path": "Isosurface/vendor/threex/examples/threex.embedded/withshield-iframe.html",
    "chars": 843,
    "preview": "<html>\n\t<head>\n\t\t<style>\n\t\t\tbody .noFocusMessage\t\t{ display\t: block;\t}\n\t\t\tbody .withFocusMessage \t\t{ display\t: none;\t\t}\n"
  },
  {
    "path": "Isosurface/vendor/threex/examples/threex.fullscreen.html",
    "chars": 1293,
    "preview": "<html>\n<body>\n\t<h1>threex.fullscreen.js demo</h1>\n\t<a href=\"https://github.com/jeromeetienne/threex\">threex.js</a> - hel"
  },
  {
    "path": "Isosurface/vendor/threex/threex.chromeWebStoreInstall.js",
    "chars": 1376,
    "preview": "// This THREEx helper makes it easy to handle chrome.webstore.install API.\n// * api description http://code.google.com/c"
  },
  {
    "path": "Isosurface/vendor/threex/threex.embedded.js",
    "chars": 569,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx \t\t|| {};\nTHREEx.Embedded\t= THREEx.Embedded\t|| {};\n\n/**\n * @returns {Boolean} retur"
  },
  {
    "path": "Isosurface/vendor/threex/threex.sparks.js",
    "chars": 6983,
    "preview": "// This THREEx helper makes it even easier to use spark.js with three.js\n// * FIXME This is currently only with WebGL\n\n/"
  },
  {
    "path": "Isosurface/vendor/threex/threex.texturePoolBall.js",
    "chars": 2196,
    "preview": "// NOTE: this match THREE namespace on purpose\nif(typeof THREEx === \"undefined\")\t\tvar THREEx\t= {};\nif(typeof THREEx.Text"
  },
  {
    "path": "Isosurface/vendor/threex.dragpancontrols.js",
    "chars": 2298,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx \t\t|| {};\n\nTHREEx.DragPanControls\t= function(object, domElement)\n{\n\tthis._object\t= "
  },
  {
    "path": "LevelOfDetail/MIT-LICENSE.txt",
    "chars": 1078,
    "preview": "Copyright (c) 2011 Jerome Etienne, http://jetienne.com\n\nPermission is hereby granted, free of charge, to any person obta"
  },
  {
    "path": "LevelOfDetail/Makefile",
    "chars": 353,
    "preview": "# makefile to automatize simple operations\n\nserver:\n\tpython -m SimpleHTTPServer\n\ndeploy:\n\t# assume there is something to"
  },
  {
    "path": "LevelOfDetail/css/main.css",
    "chars": 524,
    "preview": "body {\n\toverflow\t: hidden;\n\tpadding\t\t: 0;\n\tmargin\t\t: 0;\n\n\tcolor\t\t: #222;\n\tbackground-color: #BBB;\n\tfont-family\t: arial;\n"
  },
  {
    "path": "LevelOfDetail/js/boxfilter.js",
    "chars": 1174,
    "preview": "\n//Naive box filter for downsampling volume\nfunction BoxFilter(volume, dims) {\n  \"use strict\";\n  \n  var ndims = new Int3"
  },
  {
    "path": "LevelOfDetail/js/closing.js",
    "chars": 1658,
    "preview": "\n//Morophological closing filter\nfunction ClosingFilter(volume, dims) {\n  \"use strict\";\n  \n\n  //Dilate\n  var pvolume = n"
  },
  {
    "path": "LevelOfDetail/js/marchingcubes.js",
    "chars": 13789,
    "preview": "/**\n * Javascript Marching Cubes\n *\n * Based on Paul Bourke's classic implementation:\n *    http://local.wasp.uwa.edu.au"
  },
  {
    "path": "LevelOfDetail/js/marchingtetrahedra.js",
    "chars": 4497,
    "preview": "/**\n * Marching Tetrahedra in Javascript\n *\n * Based on Paul Bourke's implementation\n *  http://local.wasp.uwa.edu.au/~p"
  },
  {
    "path": "LevelOfDetail/js/maxfilter.js",
    "chars": 924,
    "preview": "\n//Maximum filter\nfunction MaxFilter(volume, dims) {\n  \"use strict\";\n  \n  var ndims = new Int32Array(3);\n  for(var i=0; "
  },
  {
    "path": "LevelOfDetail/js/medianfilter.js",
    "chars": 1267,
    "preview": "\n//Median filter\nfunction MedianFilter(volume, dims) {\n  \"use strict\";\n  \n  var ndims = new Int32Array(3);\n  for(var i=0"
  },
  {
    "path": "LevelOfDetail/js/minfilter.js",
    "chars": 925,
    "preview": "\n//Minimum filter\nfunction MinFilter(volume, dims) {\n  \"use strict\";\n  \n  var ndims = new Int32Array(3);\n  for(var i=0; "
  },
  {
    "path": "LevelOfDetail/js/nearestfilter.js",
    "chars": 609,
    "preview": "\n//Naive box filter for downsampling volume\nfunction NearestFilter(volume, dims) {\n  \"use strict\";\n  \n  var ndims = new "
  },
  {
    "path": "LevelOfDetail/js/opening.js",
    "chars": 1642,
    "preview": "\n//Morophological opening filter\nfunction OpeningFilter(volume, dims) {\n  \"use strict\";\n  \n\n  //Erode\n  var pvolume = ne"
  },
  {
    "path": "LevelOfDetail/js/perlinnoise.js",
    "chars": 3276,
    "preview": "\n//This code is from Kas Thomas' blog:\n//  http://asserttrue.blogspot.de/2011/12/perlin-noise-in-javascript_31.html\n\n// "
  },
  {
    "path": "LevelOfDetail/js/surfacenets.js",
    "chars": 5381,
    "preview": "/**\n * SurfaceNets in JavaScript\n *\n * Written by Mikola Lysenko (C) 2012\n *\n * MIT License\n *\n * Based on: S.F. Gibson,"
  },
  {
    "path": "LevelOfDetail/js/testdata.js",
    "chars": 4262,
    "preview": "function createTestData() {\n  var result = {};\n  \n  function triangle_wave(t) {\n    var it = Math.floor(t);\n    if(!!(it"
  },
  {
    "path": "LevelOfDetail/vendor/dsp.js",
    "chars": 66759,
    "preview": "/* \n *  DSP.js - a comprehensive digital signal processing  library for javascript\n * \n *  Created by Corban Brook <corb"
  },
  {
    "path": "LevelOfDetail/vendor/three.js/Detector.js",
    "chars": 1800,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author mr.doob / http://mrdoob.com/\n */\n\nDetector = {\n\n\tcanvas :"
  },
  {
    "path": "LevelOfDetail/vendor/three.js/ShaderExtras.js",
    "chars": 45162,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n * @author zz85 / http://www.lab4games.net/zz85/blog\n *\n * ShaderExt"
  },
  {
    "path": "LevelOfDetail/vendor/three.js/Stats.js",
    "chars": 2670,
    "preview": "// stats.js r8 - http://github.com/mrdoob/stats.js\nvar Stats=function(){var h,a,n=0,o=0,i=Date.now(),u=i,p=i,l=0,q=1E3,r"
  },
  {
    "path": "LevelOfDetail/vendor/three.js/Three.js",
    "chars": 364242,
    "preview": "// Three.js - http://github.com/mrdoob/three.js\n'use strict';var THREE=THREE||{REVISION:\"49\"};self.Int32Array||(self.Int"
  },
  {
    "path": "LevelOfDetail/vendor/three.js/postprocessing/BloomPass.js",
    "chars": 3213,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.BloomPass = function( strength, kernelSize, sigma, resolu"
  },
  {
    "path": "LevelOfDetail/vendor/three.js/postprocessing/DotScreenPass.js",
    "chars": 1205,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.DotScreenPass = function( center, angle, scale ) {\n\n\tvar "
  },
  {
    "path": "LevelOfDetail/vendor/three.js/postprocessing/EffectComposer.js",
    "chars": 3290,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.EffectComposer = function( renderer, renderTarget ) {\n\n\tt"
  },
  {
    "path": "LevelOfDetail/vendor/three.js/postprocessing/FilmPass.js",
    "chars": 1319,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.FilmPass = function( noiseIntensity, scanlinesIntensity, "
  },
  {
    "path": "LevelOfDetail/vendor/three.js/postprocessing/MaskPass.js",
    "chars": 1622,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.MaskPass = function ( scene, camera ) {\n\n\tthis.scene = sc"
  },
  {
    "path": "LevelOfDetail/vendor/three.js/postprocessing/RenderPass.js",
    "chars": 1052,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.RenderPass = function ( scene, camera, overrideMaterial, "
  },
  {
    "path": "LevelOfDetail/vendor/three.js/postprocessing/SavePass.js",
    "chars": 1199,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.SavePass = function( renderTarget ) {\n\n\tvar shader = THRE"
  },
  {
    "path": "LevelOfDetail/vendor/three.js/postprocessing/ShaderPass.js",
    "chars": 1008,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.ShaderPass = function( shader, textureID ) {\n\n\tthis.textu"
  },
  {
    "path": "LevelOfDetail/vendor/three.js/postprocessing/TexturePass.js",
    "chars": 810,
    "preview": "/**\n * @author alteredq / http://alteredqualia.com/\n */\n\nTHREE.TexturePass = function( texture, opacity ) {\n\n\tvar shader"
  },
  {
    "path": "LevelOfDetail/vendor/threex/Makefile",
    "chars": 470,
    "preview": "# simple makefile to avoid repeatitive tasks\n\nbuildDoc:\n\tdocco *.js\n\nmonitorDoc: build\n\t(while inotifywait -r -e modify,"
  },
  {
    "path": "LevelOfDetail/vendor/threex/README.md",
    "chars": 591,
    "preview": "* This should be the root of a git repository but i dunno how to handle submodule\n\n# TODO\n* document those\n  * you write"
  },
  {
    "path": "LevelOfDetail/vendor/threex/THREEx.CelShader.js",
    "chars": 2235,
    "preview": "// define namespaces\nvar THREEx\t\t= THREEx || {};\nTHREEx.ShaderLib\t= THREEx.ShaderLib\t|| {};\nTHREEx.UniformsLib\t= THREEx."
  },
  {
    "path": "LevelOfDetail/vendor/threex/THREEx.DeviceOrientationState.js",
    "chars": 1193,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx \t\t|| {};\n\nTHREEx.DeviceOrientationState\t= function()\n{\n\t// to store the current st"
  },
  {
    "path": "LevelOfDetail/vendor/threex/THREEx.FullScreen.js",
    "chars": 3376,
    "preview": "// This THREEx helper makes it easy to handle the fullscreen API\n// * it hides the prefix for each browser\n// * it hides"
  },
  {
    "path": "LevelOfDetail/vendor/threex/THREEx.GeometryUtils.js",
    "chars": 3423,
    "preview": "// This THREEx helper provide various basic functions for ```THREE.Geometry```.\n// It is able to scale, translate, cente"
  },
  {
    "path": "LevelOfDetail/vendor/threex/THREEx.GeometryWobble.js",
    "chars": 1768,
    "preview": "var THREEx\t\t= THREEx || {};\n\nTHREEx.GeometryWobble\t= {};\n\n// Geometry Wobble\n// based on paul lewis / areotwist - http:/"
  },
  {
    "path": "LevelOfDetail/vendor/threex/THREEx.KeyboardState.js",
    "chars": 3173,
    "preview": "// THREEx.KeyboardState.js keep the current state of the keyboard.\n// It is possible to query it at any time. No need of"
  },
  {
    "path": "LevelOfDetail/vendor/threex/THREEx.LogoTurtle.js",
    "chars": 1001,
    "preview": "/** @namespace */\nvar THREEx\t= THREEx\t|| {};\n\n// TODO should those relative polar coord function be INSIDE path already "
  },
  {
    "path": "LevelOfDetail/vendor/threex/THREEx.PlasmaShader.js",
    "chars": 3118,
    "preview": "// define namespaces\nvar THREEx\t\t= THREEx || {};\nTHREEx.ShaderLib\t= THREEx.ShaderLib\t|| {};\nTHREEx.UniformsLib\t= THREEx."
  },
  {
    "path": "LevelOfDetail/vendor/threex/THREEx.SkyMap.js",
    "chars": 1485,
    "preview": "var THREEx\t\t= THREEx || {};\n\nTHREEx.SkyMap\t= {};\n\nTHREEx.SkyMap.buildMesh\t= function(urls, opts)\n{\n\t// get parameters\n\to"
  },
  {
    "path": "LevelOfDetail/vendor/threex/THREEx.WindowResize.js",
    "chars": 1264,
    "preview": "// This THREEx helper makes it easy to handle window resize.\n// It will update renderer and camera when window is resize"
  }
]

// ... and 381 more files (download for full content)

About this extraction

This page contains the full source code of the mikolalysenko/mikolalysenko.github.com GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 581 files (6.4 MB), approximately 1.7M tokens, and a symbol index with 1134 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!