├── docs ├── lint.json ├── image │ ├── github.png │ ├── search.png │ ├── esdoc-logo-mini.png │ ├── esdoc-logo-mini-black.png │ ├── badge.svg │ └── manual-badge.svg ├── coverage.json ├── script │ ├── patch-for-local.js │ ├── manual.js │ ├── pretty-print.js │ ├── inherited-summary.js │ ├── inner-link.js │ ├── test-summary.js │ ├── search.js │ ├── prettify │ │ ├── Apache-License-2.0.txt │ │ └── prettify.js │ └── search_index.js ├── css │ ├── identifiers.css │ ├── source.css │ ├── test.css │ ├── github.css │ ├── search.css │ ├── prettify-tomorrow.css │ ├── manual.css │ └── style.css ├── badge.svg ├── file │ └── src │ │ ├── index.js.html │ │ └── OctreeHelper.js.html ├── identifiers.html ├── source.html ├── index.html ├── ast │ └── source │ │ └── index.js.json ├── class │ └── src │ │ └── OctreeHelper.js~OctreeHelper.html └── index.json ├── .travis.yml ├── src ├── index.js └── OctreeHelper.js ├── babel.config.js ├── .esdoc.json ├── .gitattributes ├── test └── OctreeHelper.js ├── LICENSE.md ├── .gitignore ├── package.json ├── rollup.config.js └── README.md /docs/lint.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "node" 4 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | export { OctreeHelper } from "./OctreeHelper.js"; 2 | -------------------------------------------------------------------------------- /docs/image/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanruesc/octree-helper/HEAD/docs/image/github.png -------------------------------------------------------------------------------- /docs/image/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanruesc/octree-helper/HEAD/docs/image/search.png -------------------------------------------------------------------------------- /docs/image/esdoc-logo-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanruesc/octree-helper/HEAD/docs/image/esdoc-logo-mini.png -------------------------------------------------------------------------------- /docs/image/esdoc-logo-mini-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vanruesc/octree-helper/HEAD/docs/image/esdoc-logo-mini-black.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | 3 | api.cache.forever(); 4 | 5 | return { 6 | compact: false, 7 | comments: false, 8 | presets: [ 9 | ["@babel/preset-env"] 10 | ] 11 | }; 12 | 13 | }; 14 | -------------------------------------------------------------------------------- /docs/coverage.json: -------------------------------------------------------------------------------- 1 | { 2 | "coverage": "100%", 3 | "expectCount": 7, 4 | "actualCount": 7, 5 | "files": { 6 | "src/OctreeHelper.js": { 7 | "expectCount": 7, 8 | "actualCount": 7, 9 | "undocumentLines": [] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /docs/script/patch-for-local.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | if (location.protocol === 'file:') { 3 | var elms = document.querySelectorAll('a[href="./"]'); 4 | for (var i = 0; i < elms.length; i++) { 5 | elms[i].href = './index.html'; 6 | } 7 | } 8 | })(); 9 | -------------------------------------------------------------------------------- /.esdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "source": "src", 4 | "destination": "docs", 5 | 6 | "plugins": [{ 7 | "name": "esdoc-standard-plugin", 8 | "option": { 9 | "accessor": { 10 | "access": ["public", "protected"], 11 | "autoPrivate": true 12 | } 13 | } 14 | }, { 15 | "name": "esdoc-importpath-plugin", 16 | "option": { 17 | "stripPackageName": false, 18 | "replaces": [{ 19 | "from": "^src/.*", 20 | "to": "" 21 | }] 22 | } 23 | }] 24 | 25 | } 26 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | 19 | # Linguist language statistics 20 | build/* linguist-generated 21 | -------------------------------------------------------------------------------- /docs/script/manual.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var matched = location.pathname.match(/\/(manual\/.*\.html)$/); 3 | if (!matched) return; 4 | 5 | var currentName = matched[1]; 6 | var cssClass = '.navigation .manual-toc li[data-link="' + currentName + '"]'; 7 | var styleText = cssClass + '{ display: block; }\n'; 8 | styleText += cssClass + '.indent-h1 a { color: #039BE5 }'; 9 | var style = document.createElement('style'); 10 | style.textContent = styleText; 11 | document.querySelector('head').appendChild(style); 12 | })(); 13 | -------------------------------------------------------------------------------- /docs/css/identifiers.css: -------------------------------------------------------------------------------- 1 | .identifiers-wrap { 2 | display: flex; 3 | align-items: flex-start; 4 | } 5 | 6 | .identifier-dir-tree { 7 | background: #fff; 8 | border: solid 1px #ddd; 9 | border-radius: 0.25em; 10 | top: 52px; 11 | position: -webkit-sticky; 12 | position: sticky; 13 | max-height: calc(100vh - 155px); 14 | overflow-y: scroll; 15 | min-width: 200px; 16 | margin-left: 1em; 17 | } 18 | 19 | .identifier-dir-tree-header { 20 | padding: 0.5em; 21 | background-color: #fafafa; 22 | border-bottom: solid 1px #ddd; 23 | } 24 | 25 | .identifier-dir-tree-content { 26 | padding: 0 0.5em 0; 27 | } 28 | 29 | .identifier-dir-tree-content > div { 30 | padding-top: 0.25em; 31 | padding-bottom: 0.25em; 32 | } 33 | 34 | .identifier-dir-tree-content a { 35 | color: inherit; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /docs/badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | document 13 | document 14 | 100% 15 | 100% 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/image/badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | document 13 | document 14 | @ratio@ 15 | @ratio@ 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/image/manual-badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | manual 13 | manual 14 | @value@ 15 | @value@ 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/script/pretty-print.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | prettyPrint(); 3 | var lines = document.querySelectorAll('.prettyprint.linenums li[class^="L"]'); 4 | for (var i = 0; i < lines.length; i++) { 5 | lines[i].id = 'lineNumber' + (i + 1); 6 | } 7 | 8 | var matched = location.hash.match(/errorLines=([\d,]+)/); 9 | if (matched) { 10 | var lines = matched[1].split(','); 11 | for (var i = 0; i < lines.length; i++) { 12 | var id = '#lineNumber' + lines[i]; 13 | var el = document.querySelector(id); 14 | el.classList.add('error-line'); 15 | } 16 | return; 17 | } 18 | 19 | if (location.hash) { 20 | // ``[ ] . ' " @`` are not valid in DOM id. so must escape these. 21 | var id = location.hash.replace(/([\[\].'"@$])/g, '\\$1'); 22 | var line = document.querySelector(id); 23 | if (line) line.classList.add('active'); 24 | } 25 | })(); 26 | -------------------------------------------------------------------------------- /test/OctreeHelper.js: -------------------------------------------------------------------------------- 1 | import test from "ava"; 2 | import { Vector3 } from "math-ds"; 3 | import { Octant, Octree } from "sparse-octree"; 4 | import { OctreeHelper } from "../build/octree-helper.js"; 5 | 6 | const octree = new Octree(new Octant( 7 | new Vector3(-1, -1, -1), 8 | new Vector3(1, 1, 1) 9 | )); 10 | 11 | octree.root.split(); 12 | 13 | test("can be instantiated", t => { 14 | 15 | const object = new OctreeHelper(); 16 | 17 | t.truthy(object); 18 | 19 | }); 20 | 21 | test("creates geometry for each tree level", t => { 22 | 23 | const helper = new OctreeHelper(octree); 24 | 25 | t.is(helper.children.length, 2, "should have a child for each level"); 26 | 27 | }); 28 | 29 | test("an be destroyed", t => { 30 | 31 | const helper = new OctreeHelper(octree); 32 | 33 | helper.dispose(); 34 | 35 | t.is(helper.children.length, 0, "should delete all children"); 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright © 2016 Raoul van Rüschen 2 | 3 | This software is provided 'as-is', without any express or implied warranty. In 4 | no event will the authors be held liable for any damages arising from the use of 5 | this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, including 8 | commercial applications, and to alter it and redistribute it freely, subject to 9 | the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not claim 12 | that you wrote the original software. If you use this software in a product, 13 | an acknowledgment in the product documentation would be appreciated but is 14 | not required. 15 | 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 19 | 3. This notice may not be removed or altered from any source distribution. 20 | -------------------------------------------------------------------------------- /docs/script/inherited-summary.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | function toggle(ev) { 3 | var button = ev.target; 4 | var parent = ev.target.parentElement; 5 | while(parent) { 6 | if (parent.tagName === 'TABLE' && parent.classList.contains('summary')) break; 7 | parent = parent.parentElement; 8 | } 9 | 10 | if (!parent) return; 11 | 12 | var tbody = parent.querySelector('tbody'); 13 | if (button.classList.contains('opened')) { 14 | button.classList.remove('opened'); 15 | button.classList.add('closed'); 16 | tbody.style.display = 'none'; 17 | } else { 18 | button.classList.remove('closed'); 19 | button.classList.add('opened'); 20 | tbody.style.display = 'block'; 21 | } 22 | } 23 | 24 | var buttons = document.querySelectorAll('.inherited-summary thead .toggle'); 25 | for (var i = 0; i < buttons.length; i++) { 26 | buttons[i].addEventListener('click', toggle); 27 | } 28 | })(); 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # Linux 25 | # ========================= 26 | 27 | *.swp 28 | 29 | # OSX 30 | # ========================= 31 | 32 | .DS_Store 33 | .AppleDouble 34 | .LSOverride 35 | 36 | # Thumbnails 37 | ._* 38 | 39 | # Files that might appear on external disk 40 | .Spotlight-V100 41 | .Trashes 42 | 43 | # Directories potentially created on remote AFP share 44 | .AppleDB 45 | .AppleDesktop 46 | Network Trash Folder 47 | Temporary Items 48 | .apdisk 49 | 50 | # Dependencies 51 | node_modules 52 | 53 | # Logs 54 | *.log 55 | 56 | # IDE settings 57 | .project 58 | .idea 59 | .vscore 60 | 61 | # Backup 62 | .backup 63 | 64 | # Temporary files 65 | *.tmp 66 | -------------------------------------------------------------------------------- /docs/script/inner-link.js: -------------------------------------------------------------------------------- 1 | // inner link(#foo) can not correctly scroll, because page has fixed header, 2 | // so, I manually scroll. 3 | (function(){ 4 | var matched = location.hash.match(/errorLines=([\d,]+)/); 5 | if (matched) return; 6 | 7 | function adjust() { 8 | window.scrollBy(0, -55); 9 | var el = document.querySelector('.inner-link-active'); 10 | if (el) el.classList.remove('inner-link-active'); 11 | 12 | // ``[ ] . ' " @`` are not valid in DOM id. so must escape these. 13 | var id = location.hash.replace(/([\[\].'"@$])/g, '\\$1'); 14 | var el = document.querySelector(id); 15 | if (el) el.classList.add('inner-link-active'); 16 | } 17 | 18 | window.addEventListener('hashchange', adjust); 19 | 20 | if (location.hash) { 21 | setTimeout(adjust, 0); 22 | } 23 | })(); 24 | 25 | (function(){ 26 | var els = document.querySelectorAll('[href^="#"]'); 27 | var href = location.href.replace(/#.*$/, ''); // remove existed hash 28 | for (var i = 0; i < els.length; i++) { 29 | var el = els[i]; 30 | el.href = href + el.getAttribute('href'); // because el.href is absolute path 31 | } 32 | })(); 33 | -------------------------------------------------------------------------------- /docs/css/source.css: -------------------------------------------------------------------------------- 1 | table.files-summary { 2 | width: 100%; 3 | margin: 10px 0; 4 | border-spacing: 0; 5 | border: 0; 6 | border-collapse: collapse; 7 | text-align: right; 8 | } 9 | 10 | table.files-summary tbody tr:hover { 11 | background: #eee; 12 | } 13 | 14 | table.files-summary td:first-child, 15 | table.files-summary td:nth-of-type(2) { 16 | text-align: left; 17 | } 18 | 19 | table.files-summary[data-use-coverage="false"] td.coverage { 20 | display: none; 21 | } 22 | 23 | table.files-summary thead { 24 | background: #fafafa; 25 | } 26 | 27 | table.files-summary td { 28 | border: solid 1px #ddd; 29 | padding: 4px 10px; 30 | vertical-align: top; 31 | } 32 | 33 | table.files-summary td.identifiers > span { 34 | display: block; 35 | margin-top: 4px; 36 | } 37 | table.files-summary td.identifiers > span:first-child { 38 | margin-top: 0; 39 | } 40 | 41 | table.files-summary .coverage-count { 42 | font-size: 12px; 43 | color: #aaa; 44 | display: inline-block; 45 | min-width: 40px; 46 | } 47 | 48 | .total-coverage-count { 49 | position: relative; 50 | bottom: 2px; 51 | font-size: 12px; 52 | color: #666; 53 | font-weight: 500; 54 | padding-left: 5px; 55 | } 56 | -------------------------------------------------------------------------------- /docs/css/test.css: -------------------------------------------------------------------------------- 1 | table.test-summary thead { 2 | background: #fafafa; 3 | } 4 | 5 | table.test-summary thead .test-description { 6 | width: 50%; 7 | } 8 | 9 | table.test-summary { 10 | width: 100%; 11 | margin: 10px 0; 12 | border-spacing: 0; 13 | border: 0; 14 | border-collapse: collapse; 15 | } 16 | 17 | table.test-summary thead .test-count { 18 | width: 3em; 19 | } 20 | 21 | table.test-summary tbody tr:hover { 22 | background-color: #eee; 23 | } 24 | 25 | table.test-summary td { 26 | border: solid 1px #ddd; 27 | padding: 4px 10px; 28 | vertical-align: top; 29 | } 30 | 31 | table.test-summary td p { 32 | margin: 0; 33 | } 34 | 35 | table.test-summary tr.test-interface .toggle { 36 | display: inline-block; 37 | float: left; 38 | margin-right: 4px; 39 | cursor: pointer; 40 | font-size: 0.8em; 41 | padding-top: 0.25em; 42 | } 43 | 44 | table.test-summary tr.test-interface .toggle.opened:before { 45 | content: '▼'; 46 | } 47 | 48 | table.test-summary tr.test-interface .toggle.closed:before { 49 | content: '▶'; 50 | } 51 | 52 | table.test-summary .test-target > span { 53 | display: block; 54 | margin-top: 4px; 55 | } 56 | table.test-summary .test-target > span:first-child { 57 | margin-top: 0; 58 | } 59 | -------------------------------------------------------------------------------- /docs/css/github.css: -------------------------------------------------------------------------------- 1 | /* github markdown */ 2 | .github-markdown { 3 | font-size: 16px; 4 | } 5 | 6 | .github-markdown h1, 7 | .github-markdown h2, 8 | .github-markdown h3, 9 | .github-markdown h4, 10 | .github-markdown h5 { 11 | margin-top: 1em; 12 | margin-bottom: 16px; 13 | font-weight: bold; 14 | padding: 0; 15 | } 16 | 17 | .github-markdown h1:nth-of-type(1) { 18 | margin-top: 0; 19 | } 20 | 21 | .github-markdown h1 { 22 | font-size: 2em; 23 | padding-bottom: 0.3em; 24 | } 25 | 26 | .github-markdown h2 { 27 | font-size: 1.75em; 28 | padding-bottom: 0.3em; 29 | } 30 | 31 | .github-markdown h3 { 32 | font-size: 1.5em; 33 | } 34 | 35 | .github-markdown h4 { 36 | font-size: 1.25em; 37 | } 38 | 39 | .github-markdown h5 { 40 | font-size: 1em; 41 | } 42 | 43 | .github-markdown ul, .github-markdown ol { 44 | padding-left: 2em; 45 | } 46 | 47 | .github-markdown pre > code { 48 | font-size: 0.85em; 49 | } 50 | 51 | .github-markdown table { 52 | margin-bottom: 1em; 53 | border-collapse: collapse; 54 | border-spacing: 0; 55 | } 56 | 57 | .github-markdown table tr { 58 | background-color: #fff; 59 | border-top: 1px solid #ccc; 60 | } 61 | 62 | .github-markdown table th, 63 | .github-markdown table td { 64 | padding: 6px 13px; 65 | border: 1px solid #ddd; 66 | } 67 | 68 | .github-markdown table tr:nth-child(2n) { 69 | background-color: #f8f8f8; 70 | } 71 | 72 | .github-markdown hr { 73 | border-right: 0; 74 | border-bottom: 1px solid #e5e5e5; 75 | border-left: 0; 76 | border-top: 0; 77 | } 78 | 79 | /** badge(.svg) does not have border */ 80 | .github-markdown img:not([src*=".svg"]) { 81 | max-width: 100%; 82 | box-shadow: 1px 1px 1px rgba(0,0,0,0.5); 83 | } 84 | -------------------------------------------------------------------------------- /docs/css/search.css: -------------------------------------------------------------------------------- 1 | /* search box */ 2 | .search-box { 3 | position: absolute; 4 | top: 10px; 5 | right: 50px; 6 | padding-right: 8px; 7 | padding-bottom: 10px; 8 | line-height: normal; 9 | font-size: 12px; 10 | } 11 | 12 | .search-box img { 13 | width: 20px; 14 | vertical-align: top; 15 | } 16 | 17 | .search-input { 18 | display: inline; 19 | visibility: hidden; 20 | width: 0; 21 | padding: 2px; 22 | height: 1.5em; 23 | outline: none; 24 | background: transparent; 25 | border: 1px #0af; 26 | border-style: none none solid none; 27 | vertical-align: bottom; 28 | } 29 | 30 | .search-input-edge { 31 | display: none; 32 | width: 1px; 33 | height: 5px; 34 | background-color: #0af; 35 | vertical-align: bottom; 36 | } 37 | 38 | .search-result { 39 | position: absolute; 40 | display: none; 41 | height: 600px; 42 | width: 100%; 43 | padding: 0; 44 | margin-top: 5px; 45 | margin-left: 24px; 46 | background: white; 47 | box-shadow: 1px 1px 4px rgb(0,0,0); 48 | white-space: nowrap; 49 | overflow-y: scroll; 50 | } 51 | 52 | .search-result-import-path { 53 | color: #aaa; 54 | font-size: 12px; 55 | } 56 | 57 | .search-result li { 58 | list-style: none; 59 | padding: 2px 4px; 60 | } 61 | 62 | .search-result li a { 63 | display: block; 64 | } 65 | 66 | .search-result li.selected { 67 | background: #ddd; 68 | } 69 | 70 | .search-result li.search-separator { 71 | background: rgb(37, 138, 175); 72 | color: white; 73 | } 74 | 75 | .search-box.active .search-input { 76 | visibility: visible; 77 | transition: width 0.2s ease-out; 78 | width: 300px; 79 | } 80 | 81 | .search-box.active .search-input-edge { 82 | display: inline-block; 83 | } 84 | 85 | -------------------------------------------------------------------------------- /docs/script/test-summary.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | function toggle(ev) { 3 | var button = ev.target; 4 | var parent = ev.target.parentElement; 5 | while(parent) { 6 | if (parent.tagName === 'TR' && parent.classList.contains('test-interface')) break; 7 | parent = parent.parentElement; 8 | } 9 | 10 | if (!parent) return; 11 | 12 | var direction; 13 | if (button.classList.contains('opened')) { 14 | button.classList.remove('opened'); 15 | button.classList.add('closed'); 16 | direction = 'closed'; 17 | } else { 18 | button.classList.remove('closed'); 19 | button.classList.add('opened'); 20 | direction = 'opened'; 21 | } 22 | 23 | var targetDepth = parseInt(parent.dataset.testDepth, 10) + 1; 24 | var nextElement = parent.nextElementSibling; 25 | while (nextElement) { 26 | var depth = parseInt(nextElement.dataset.testDepth, 10); 27 | if (depth >= targetDepth) { 28 | if (direction === 'opened') { 29 | if (depth === targetDepth) nextElement.style.display = ''; 30 | } else if (direction === 'closed') { 31 | nextElement.style.display = 'none'; 32 | var innerButton = nextElement.querySelector('.toggle'); 33 | if (innerButton && innerButton.classList.contains('opened')) { 34 | innerButton.classList.remove('opened'); 35 | innerButton.classList.add('closed'); 36 | } 37 | } 38 | } else { 39 | break; 40 | } 41 | nextElement = nextElement.nextElementSibling; 42 | } 43 | } 44 | 45 | var buttons = document.querySelectorAll('.test-summary tr.test-interface .toggle'); 46 | for (var i = 0; i < buttons.length; i++) { 47 | buttons[i].addEventListener('click', toggle); 48 | } 49 | 50 | var topDescribes = document.querySelectorAll('.test-summary tr[data-test-depth="0"]'); 51 | for (var i = 0; i < topDescribes.length; i++) { 52 | topDescribes[i].style.display = ''; 53 | } 54 | })(); 55 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "octree-helper", 3 | "version": "1.1.6", 4 | "description": "An octree visualization tool for three.js.", 5 | "homepage": "https://github.com/vanruesc/octree-helper", 6 | "main": "build/octree-helper.js", 7 | "module": "build/octree-helper.esm.js", 8 | "sideEffects": false, 9 | "license": "Zlib", 10 | "keywords": [ 11 | "octree", 12 | "helper", 13 | "three.js", 14 | "3d", 15 | "geometry", 16 | "mesh", 17 | "render", 18 | "visualize" 19 | ], 20 | "author": { 21 | "name": "Raoul van Rüschen", 22 | "email": "vanruesc@outlook.de" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "https://github.com/vanruesc/octree-helper.git" 27 | }, 28 | "bugs": { 29 | "url": "https://github.com/vanruesc/octree-helper/issues" 30 | }, 31 | "files": [ 32 | "build" 33 | ], 34 | "scripts": { 35 | "ava": "ava", 36 | "build": "rollup -c", 37 | "build:production": "cross-env NODE_ENV=production npm run build", 38 | "watch": "rollup -c -w", 39 | "doc": "rimraf docs && esdoc", 40 | "pretest": "npm run build:production", 41 | "test": "ava", 42 | "prepack": "npm test && npm run doc" 43 | }, 44 | "ava": { 45 | "failFast": true, 46 | "files": [ 47 | "test/**/*.js" 48 | ], 49 | "require": [ 50 | "esm" 51 | ] 52 | }, 53 | "eslintConfig": { 54 | "extends": "delta" 55 | }, 56 | "dependencies": { 57 | "sparse-octree": "6.x.x" 58 | }, 59 | "peerDependencies": { 60 | "three": ">= 0.110.0 < 0.119.0" 61 | }, 62 | "devDependencies": { 63 | "@babel/core": "7.x.x", 64 | "@babel/preset-env": "7.x.x", 65 | "@rollup/plugin-babel": "5.x.x", 66 | "@rollup/plugin-node-resolve": "8.x.x", 67 | "ava": "3.x.x", 68 | "cross-env": "7.x.x", 69 | "esdoc": "1.x.x", 70 | "esdoc-importpath-plugin": "1.x.x", 71 | "esdoc-standard-plugin": "1.x.x", 72 | "eslint-config-delta": "1.x.x", 73 | "esm": "3.x.x", 74 | "iterator-result": "1.x.x", 75 | "math-ds": "1.x.x", 76 | "rimraf": "3.x.x", 77 | "rollup": "2.x.x", 78 | "rollup-plugin-eslint": "6.x.x", 79 | "rollup-plugin-terser": "6.x.x", 80 | "three": "0.118.x" 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import babel from "@rollup/plugin-babel"; 2 | import resolve from "@rollup/plugin-node-resolve"; 3 | import { eslint } from "rollup-plugin-eslint"; 4 | import { terser } from "rollup-plugin-terser"; 5 | 6 | const pkg = require("./package.json"); 7 | const date = (new Date()).toDateString(); 8 | 9 | // Meta settings. 10 | 11 | const banner = `/** 12 | * ${pkg.name} v${pkg.version} build ${date} 13 | * ${pkg.homepage} 14 | * Copyright ${date.slice(-4)} ${pkg.author.name} 15 | * @license ${pkg.license} 16 | */`; 17 | 18 | const production = (process.env.NODE_ENV === "production"); 19 | const external = Object.keys(pkg.peerDependencies); 20 | const globals = Object.assign({}, ...external.map((value) => ({ 21 | [value]: value.replace(/-/g, "").toUpperCase() 22 | }))); 23 | 24 | // Plugin settings. 25 | 26 | const settings = { 27 | 28 | babel: { 29 | babelHelpers: "bundled" 30 | } 31 | 32 | } 33 | 34 | // Bundle configurations. 35 | 36 | const lib = { 37 | 38 | module: { 39 | input: "src/index.js", 40 | external, 41 | plugins: [resolve(), eslint()], 42 | output: [ 43 | { 44 | file: pkg.module, 45 | format: "esm", 46 | globals, 47 | banner 48 | }, { 49 | file: pkg.main, 50 | format: "esm", 51 | globals 52 | }, { 53 | file: pkg.main.replace(".js", ".min.js"), 54 | format: "esm", 55 | globals 56 | } 57 | ] 58 | }, 59 | 60 | main: { 61 | input: production ? pkg.main : "src/index.js", 62 | external, 63 | plugins: production ? [babel(settings.babel)] : [resolve(), eslint()], 64 | output: { 65 | file: pkg.main, 66 | format: "umd", 67 | name: pkg.name.replace(/-/g, "").toUpperCase(), 68 | globals, 69 | banner 70 | } 71 | }, 72 | 73 | min: { 74 | input: pkg.main.replace(".js", ".min.js"), 75 | external, 76 | plugins: [terser(), babel(settings.babel)], 77 | output: { 78 | file: pkg.main.replace(".js", ".min.js"), 79 | format: "umd", 80 | name: pkg.name.replace(/-/g, "").toUpperCase(), 81 | globals, 82 | banner 83 | } 84 | } 85 | 86 | }; 87 | 88 | export default production ? [lib.module, lib.main, lib.min] : [lib.main]; 89 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Octree Helper 2 | 3 | [![Build status](https://travis-ci.org/vanruesc/octree-helper.svg?branch=master)](https://travis-ci.org/vanruesc/octree-helper) 4 | [![npm version](https://badgen.net/npm/v/octree-helper?color=green)](https://www.npmjs.com/package/octree-helper) 5 | [![Peer dependencies](https://david-dm.org/vanruesc/octree-helper/peer-status.svg)](https://david-dm.org/vanruesc/octree-helper?type=peer) 6 | 7 | :warning: __Deprecation Notice: The octree helper is now included in [sparse-octree](https://github.com/vanruesc/sparse-octree).__ :warning: 8 | 9 | An octree visualization tool for [three.js](https://threejs.org/). 10 | 11 | *[Demo](https://vanruesc.github.io/sparse-octree/public/demo) · [Documentation](https://vanruesc.github.io/octree-helper/docs)* 12 | 13 | 14 | ## Installation 15 | 16 | This library requires the peer dependency [three](https://github.com/mrdoob/three.js/). 17 | 18 | ```sh 19 | npm install three octree-helper 20 | ``` 21 | 22 | 23 | ## Requirements 24 | 25 | This helper can visualize any octree that conforms to the following protocols: 26 | 27 | - [Tree](https://vanruesc.github.io/sparse-octree/public/docs/class/src/core/Tree.js~Tree.html) 28 | - [Node](https://vanruesc.github.io/sparse-octree/public/docs/class/src/core/Node.js~Node.html) 29 | 30 | 31 | ## Usage 32 | 33 | The following example uses the [sparse-octree](https://github.com/vanruesc/sparse-octree) module. 34 | 35 | ```javascript 36 | import { Scene } from "three"; 37 | import { Octree } from "sparse-octree"; 38 | import { OctreeHelper } from "octree-helper"; 39 | 40 | const scene = new Scene(); 41 | const octree = new Octree(); 42 | const octreeHelper = new OctreeHelper(octree); 43 | 44 | // Render the helper. 45 | scene.add(octreeHelper); 46 | 47 | // Set a different octree. 48 | octreeHelper.octree = otherOctree; 49 | 50 | // Destroy the helper geometry and rebuild. 51 | octreeHelper.update(); 52 | 53 | // Destroy the helper geometry. 54 | octreeHelper.dispose(); 55 | ``` 56 | 57 | 58 | ## Contributing 59 | 60 | Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code. 61 | -------------------------------------------------------------------------------- /docs/file/src/index.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | src/index.js | octree-helper 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | Home 16 | 17 | Reference 18 | Source 19 | 20 | 27 |
28 | 29 | 36 | 37 |

src/index.js

38 |
export { OctreeHelper } from "./OctreeHelper.js";
39 | 
40 | 41 |
42 | 43 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/css/prettify-tomorrow.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* Pretty printing styles. Used with prettify.js. */ 4 | /* SPAN elements with the classes below are added by prettyprint. */ 5 | /* plain text */ 6 | .pln { 7 | color: #4d4d4c; } 8 | 9 | @media screen { 10 | /* string content */ 11 | .str { 12 | color: #718c00; } 13 | 14 | /* a keyword */ 15 | .kwd { 16 | color: #8959a8; } 17 | 18 | /* a comment */ 19 | .com { 20 | color: #8e908c; } 21 | 22 | /* a type name */ 23 | .typ { 24 | color: #4271ae; } 25 | 26 | /* a literal value */ 27 | .lit { 28 | color: #f5871f; } 29 | 30 | /* punctuation */ 31 | .pun { 32 | color: #4d4d4c; } 33 | 34 | /* lisp open bracket */ 35 | .opn { 36 | color: #4d4d4c; } 37 | 38 | /* lisp close bracket */ 39 | .clo { 40 | color: #4d4d4c; } 41 | 42 | /* a markup tag name */ 43 | .tag { 44 | color: #c82829; } 45 | 46 | /* a markup attribute name */ 47 | .atn { 48 | color: #f5871f; } 49 | 50 | /* a markup attribute value */ 51 | .atv { 52 | color: #3e999f; } 53 | 54 | /* a declaration */ 55 | .dec { 56 | color: #f5871f; } 57 | 58 | /* a variable name */ 59 | .var { 60 | color: #c82829; } 61 | 62 | /* a function name */ 63 | .fun { 64 | color: #4271ae; } } 65 | /* Use higher contrast and text-weight for printable form. */ 66 | @media print, projection { 67 | .str { 68 | color: #060; } 69 | 70 | .kwd { 71 | color: #006; 72 | font-weight: bold; } 73 | 74 | .com { 75 | color: #600; 76 | font-style: italic; } 77 | 78 | .typ { 79 | color: #404; 80 | font-weight: bold; } 81 | 82 | .lit { 83 | color: #044; } 84 | 85 | .pun, .opn, .clo { 86 | color: #440; } 87 | 88 | .tag { 89 | color: #006; 90 | font-weight: bold; } 91 | 92 | .atn { 93 | color: #404; } 94 | 95 | .atv { 96 | color: #060; } } 97 | /* Style */ 98 | /* 99 | pre.prettyprint { 100 | background: white; 101 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 102 | font-size: 12px; 103 | line-height: 1.5; 104 | border: 1px solid #ccc; 105 | padding: 10px; } 106 | */ 107 | 108 | /* Specify class=linenums on a pre to get line numbering */ 109 | ol.linenums { 110 | margin-top: 0; 111 | margin-bottom: 0; } 112 | 113 | /* IE indents via margin-left */ 114 | li.L0, 115 | li.L1, 116 | li.L2, 117 | li.L3, 118 | li.L4, 119 | li.L5, 120 | li.L6, 121 | li.L7, 122 | li.L8, 123 | li.L9 { 124 | /* */ } 125 | 126 | /* Alternate shading for lines */ 127 | li.L1, 128 | li.L3, 129 | li.L5, 130 | li.L7, 131 | li.L9 { 132 | /* */ } 133 | -------------------------------------------------------------------------------- /docs/css/manual.css: -------------------------------------------------------------------------------- 1 | .github-markdown .manual-toc { 2 | padding-left: 0; 3 | } 4 | 5 | .manual-index .manual-cards { 6 | display: flex; 7 | flex-wrap: wrap; 8 | } 9 | 10 | .manual-index .manual-card-wrap { 11 | width: 280px; 12 | padding: 10px 20px 10px 0; 13 | box-sizing: border-box; 14 | } 15 | 16 | .manual-index .manual-card-wrap > h1 { 17 | margin: 0; 18 | font-size: 1em; 19 | font-weight: 600; 20 | padding: 0.2em 0 0.2em 0.5em; 21 | border-radius: 0.1em 0.1em 0 0; 22 | border: none; 23 | } 24 | 25 | .manual-index .manual-card-wrap > h1 span { 26 | color: #555; 27 | } 28 | 29 | .manual-index .manual-card { 30 | height: 200px; 31 | overflow: hidden; 32 | border: solid 1px rgba(230, 230, 230, 0.84); 33 | border-radius: 0 0 0.1em 0.1em; 34 | padding: 8px; 35 | position: relative; 36 | } 37 | 38 | .manual-index .manual-card > div { 39 | transform: scale(0.4); 40 | transform-origin: 0 0; 41 | width: 250%; 42 | } 43 | 44 | .manual-index .manual-card > a { 45 | position: absolute; 46 | top: 0; 47 | left: 0; 48 | width: 100%; 49 | height: 100%; 50 | background: rgba(210, 210, 210, 0.1); 51 | } 52 | 53 | .manual-index .manual-card > a:hover { 54 | background: none; 55 | } 56 | 57 | .manual-index .manual-badge { 58 | margin: 0; 59 | } 60 | 61 | .manual-index .manual-user-index { 62 | margin-bottom: 1em; 63 | border-bottom: solid 1px #ddd; 64 | } 65 | 66 | .manual-root .navigation { 67 | padding-left: 4px; 68 | margin-top: 4px; 69 | } 70 | 71 | .navigation .manual-toc-root > div { 72 | padding-left: 0.25em; 73 | padding-right: 0.75em; 74 | } 75 | 76 | .github-markdown .manual-toc-title a { 77 | color: inherit; 78 | } 79 | 80 | .manual-breadcrumb-list { 81 | font-size: 0.8em; 82 | margin-bottom: 1em; 83 | } 84 | 85 | .manual-toc-title a:hover { 86 | color: #039BE5; 87 | } 88 | 89 | .manual-toc li { 90 | margin: 0.75em 0; 91 | list-style-type: none; 92 | } 93 | 94 | .navigation .manual-toc [class^="indent-h"] a { 95 | color: #666; 96 | } 97 | 98 | .navigation .manual-toc .indent-h1 a { 99 | color: #555; 100 | font-weight: 600; 101 | display: block; 102 | } 103 | 104 | .manual-toc .indent-h1 { 105 | display: block; 106 | margin: 0.4em 0 0 0.25em; 107 | padding: 0.2em 0 0.2em 0.5em; 108 | border-radius: 0.1em; 109 | } 110 | 111 | .manual-root .navigation .manual-toc li:not(.indent-h1) { 112 | margin-top: 0.5em; 113 | } 114 | 115 | .manual-toc .indent-h2 { 116 | display: none; 117 | margin-left: 1.5em; 118 | } 119 | .manual-toc .indent-h3 { 120 | display: none; 121 | margin-left: 2.5em; 122 | } 123 | .manual-toc .indent-h4 { 124 | display: none; 125 | margin-left: 3.5em; 126 | } 127 | .manual-toc .indent-h5 { 128 | display: none; 129 | margin-left: 4.5em; 130 | } 131 | 132 | .manual-nav li { 133 | margin: 0.75em 0; 134 | } 135 | -------------------------------------------------------------------------------- /docs/identifiers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Reference | octree-helper 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | Home 16 | 17 | Reference 18 | Source 19 | 20 | 27 |
28 | 29 | 36 | 37 |

References

38 | 39 |
40 |
41 | 42 |
43 | 44 |
45 | 46 | 47 | 48 | 49 | 56 | 72 | 76 | 77 | 78 |
summary
50 | public 51 | 52 | 53 | 54 | 55 | 57 |
58 |

59 | C 60 | 61 | 62 | OctreeHelper 63 |

64 |
65 |
66 | 67 | 68 |

An octree helper.

69 |
70 |
71 |
73 | 74 | 75 |
79 |
80 |
81 |
82 | 83 | 84 |
85 |
86 | 87 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /docs/source.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Source | octree-helper 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | Home 16 | 17 | Reference 18 | Source 19 | 20 | 27 |
28 | 29 | 36 | 37 |

Source 7/7

38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
FileIdentifierDocumentSizeLinesUpdated
src/OctreeHelper.jsOctreeHelper100 %7/73636 byte2022019-12-06 22:45:30 (UTC)
src/index.js--51 byte12019-12-06 20:53:03 (UTC)
70 |
71 | 72 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /docs/script/search.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var searchIndex = window.esdocSearchIndex; 3 | var searchBox = document.querySelector('.search-box'); 4 | var input = document.querySelector('.search-input'); 5 | var result = document.querySelector('.search-result'); 6 | var selectedIndex = -1; 7 | var prevText; 8 | 9 | // active search box and focus when mouse enter on search box. 10 | searchBox.addEventListener('mouseenter', function(){ 11 | searchBox.classList.add('active'); 12 | input.focus(); 13 | }); 14 | 15 | // search with text when key is upped. 16 | input.addEventListener('keyup', function(ev){ 17 | var text = ev.target.value.toLowerCase(); 18 | if (!text) { 19 | result.style.display = 'none'; 20 | result.innerHTML = ''; 21 | return; 22 | } 23 | 24 | if (text === prevText) return; 25 | prevText = text; 26 | 27 | var html = {class: [], method: [], member: [], function: [], variable: [], typedef: [], external: [], file: [], test: [], testFile: []}; 28 | var len = searchIndex.length; 29 | var kind; 30 | for (var i = 0; i < len; i++) { 31 | var pair = searchIndex[i]; 32 | if (pair[0].indexOf(text) !== -1) { 33 | kind = pair[3]; 34 | html[kind].push('
  • ' + pair[2] + '
  • '); 35 | } 36 | } 37 | 38 | var innerHTML = ''; 39 | for (kind in html) { 40 | var list = html[kind]; 41 | if (!list.length) continue; 42 | innerHTML += '
  • ' + kind + '
  • \n' + list.join('\n'); 43 | } 44 | result.innerHTML = innerHTML; 45 | if (innerHTML) result.style.display = 'block'; 46 | selectedIndex = -1; 47 | }); 48 | 49 | // down, up and enter key are pressed, select search result. 50 | input.addEventListener('keydown', function(ev){ 51 | if (ev.keyCode === 40) { 52 | // arrow down 53 | var current = result.children[selectedIndex]; 54 | var selected = result.children[selectedIndex + 1]; 55 | if (selected && selected.classList.contains('search-separator')) { 56 | var selected = result.children[selectedIndex + 2]; 57 | selectedIndex++; 58 | } 59 | 60 | if (selected) { 61 | if (current) current.classList.remove('selected'); 62 | selectedIndex++; 63 | selected.classList.add('selected'); 64 | } 65 | } else if (ev.keyCode === 38) { 66 | // arrow up 67 | var current = result.children[selectedIndex]; 68 | var selected = result.children[selectedIndex - 1]; 69 | if (selected && selected.classList.contains('search-separator')) { 70 | var selected = result.children[selectedIndex - 2]; 71 | selectedIndex--; 72 | } 73 | 74 | if (selected) { 75 | if (current) current.classList.remove('selected'); 76 | selectedIndex--; 77 | selected.classList.add('selected'); 78 | } 79 | } else if (ev.keyCode === 13) { 80 | // enter 81 | var current = result.children[selectedIndex]; 82 | if (current) { 83 | var link = current.querySelector('a'); 84 | if (link) location.href = link.href; 85 | } 86 | } else { 87 | return; 88 | } 89 | 90 | ev.preventDefault(); 91 | }); 92 | 93 | // select search result when search result is mouse over. 94 | result.addEventListener('mousemove', function(ev){ 95 | var current = result.children[selectedIndex]; 96 | if (current) current.classList.remove('selected'); 97 | 98 | var li = ev.target; 99 | while (li) { 100 | if (li.nodeName === 'LI') break; 101 | li = li.parentElement; 102 | } 103 | 104 | if (li) { 105 | selectedIndex = Array.prototype.indexOf.call(result.children, li); 106 | li.classList.add('selected'); 107 | } 108 | }); 109 | 110 | // clear search result when body is clicked. 111 | document.body.addEventListener('click', function(ev){ 112 | selectedIndex = -1; 113 | result.style.display = 'none'; 114 | result.innerHTML = ''; 115 | }); 116 | 117 | })(); 118 | -------------------------------------------------------------------------------- /src/OctreeHelper.js: -------------------------------------------------------------------------------- 1 | import { edges, layout } from "sparse-octree"; 2 | 3 | import { 4 | BufferAttribute, 5 | BufferGeometry, 6 | Group, 7 | LineSegments, 8 | LineBasicMaterial 9 | } from "three"; 10 | 11 | /** 12 | * An octree helper. 13 | */ 14 | 15 | export class OctreeHelper extends Group { 16 | 17 | /** 18 | * Constructs a new octree helper. 19 | * 20 | * @param {Tree} [octree=null] - An octree. 21 | */ 22 | 23 | constructor(octree = null) { 24 | 25 | super(); 26 | 27 | /** 28 | * The name of this object. 29 | * 30 | * @type {String} 31 | * @protected 32 | */ 33 | 34 | this.name = "OctreeHelper"; 35 | 36 | /** 37 | * The octree. 38 | * 39 | * @type {Tree} 40 | */ 41 | 42 | this.octree = octree; 43 | 44 | this.update(); 45 | 46 | } 47 | 48 | /** 49 | * Creates octant geometry. 50 | * 51 | * @private 52 | * @param {Iterator} octants - An octant iterator. 53 | * @param {Number} octantCount - The size of the given sequence. 54 | */ 55 | 56 | createLineSegments(octants, octantCount) { 57 | 58 | const maxOctants = (Math.pow(2, 16) / 8) - 1; 59 | const group = new Group(); 60 | 61 | const material = new LineBasicMaterial({ 62 | color: 0xffffff * Math.random() 63 | }); 64 | 65 | let result; 66 | let vertexCount; 67 | let length; 68 | 69 | let indices, positions; 70 | let octant, min, max; 71 | let geometry; 72 | 73 | let i, j, c, d, n; 74 | let corner, edge; 75 | 76 | // Create geometry in multiple runs to limit the amount of vertices. 77 | for(i = 0, length = 0, n = Math.ceil(octantCount / maxOctants); n > 0; --n) { 78 | 79 | length += (octantCount < maxOctants) ? octantCount : maxOctants; 80 | octantCount -= maxOctants; 81 | 82 | vertexCount = length * 8; 83 | indices = new Uint16Array(vertexCount * 3); 84 | positions = new Float32Array(vertexCount * 3); 85 | 86 | // Continue where the previous run left off. 87 | for(c = 0, d = 0, result = octants.next(); !result.done && i < length;) { 88 | 89 | octant = result.value; 90 | min = octant.min; 91 | max = octant.max; 92 | 93 | // Create line connections based on the current vertex count. 94 | for(j = 0; j < 12; ++j) { 95 | 96 | edge = edges[j]; 97 | 98 | indices[d++] = c + edge[0]; 99 | indices[d++] = c + edge[1]; 100 | 101 | } 102 | 103 | // Create the vertices. 104 | for(j = 0; j < 8; ++j, ++c) { 105 | 106 | corner = layout[j]; 107 | 108 | positions[c * 3] = (corner[0] === 0) ? min.x : max.x; 109 | positions[c * 3 + 1] = (corner[1] === 0) ? min.y : max.y; 110 | positions[c * 3 + 2] = (corner[2] === 0) ? min.z : max.z; 111 | 112 | } 113 | 114 | if(++i < length) { 115 | 116 | result = octants.next(); 117 | 118 | } 119 | 120 | } 121 | 122 | geometry = new BufferGeometry(); 123 | geometry.setIndex(new BufferAttribute(indices, 1)); 124 | geometry.setAttribute("position", new BufferAttribute(positions, 3)); 125 | 126 | group.add(new LineSegments(geometry, material)); 127 | 128 | } 129 | 130 | this.add(group); 131 | 132 | } 133 | 134 | /** 135 | * Updates the helper geometry. 136 | */ 137 | 138 | update() { 139 | 140 | const depth = (this.octree !== null) ? this.octree.getDepth() : -1; 141 | 142 | let level = 0; 143 | let result; 144 | 145 | // Remove existing geometry. 146 | this.dispose(); 147 | 148 | while(level <= depth) { 149 | 150 | result = this.octree.findNodesByLevel(level); 151 | 152 | this.createLineSegments( 153 | result[Symbol.iterator](), 154 | (typeof result.size === "number") ? result.size : result.length 155 | ); 156 | 157 | ++level; 158 | 159 | } 160 | 161 | } 162 | 163 | /** 164 | * Destroys this helper. 165 | */ 166 | 167 | dispose() { 168 | 169 | const groups = this.children; 170 | 171 | let group, children; 172 | let i, j, il, jl; 173 | 174 | for(i = 0, il = groups.length; i < il; ++i) { 175 | 176 | group = groups[i]; 177 | children = group.children; 178 | 179 | for(j = 0, jl = children.length; j < jl; ++j) { 180 | 181 | children[j].geometry.dispose(); 182 | children[j].material.dispose(); 183 | 184 | } 185 | 186 | while(children.length > 0) { 187 | 188 | group.remove(children[0]); 189 | 190 | } 191 | 192 | } 193 | 194 | while(groups.length > 0) { 195 | 196 | this.remove(groups[0]); 197 | 198 | } 199 | 200 | } 201 | 202 | } 203 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Home | octree-helper 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    15 | Home 16 | 17 | Reference 18 | Source 19 | 20 | 27 |
    28 | 29 | 36 | 37 |

    Octree Helper

    Build status 38 | npm version 39 | Peer dependencies

    40 |

    An octree visualization tool for three.js.

    41 |

    Demo · Documentation

    42 |

    Installation

    This library requires the peer dependency three.

    43 |
    npm install three octree-helper
    44 | 
    45 |

    Requirements

    This helper can visualize any octree that conforms to the following protocols:

    46 | 50 |

    Usage

    The following example uses the sparse-octree module.

    51 |
    import { Scene } from "three";
    52 | import { Octree } from "sparse-octree";
    53 | import { OctreeHelper } from "octree-helper";
    54 | 
    55 | const scene = new Scene();
    56 | const octree = new Octree();
    57 | const octreeHelper = new OctreeHelper(octree);
    58 | 
    59 | // Render the helper.
    60 | scene.add(octreeHelper);
    61 | 
    62 | // Set a different octree.
    63 | octreeHelper.octree = otherOctree;
    64 | 
    65 | // Destroy the helper geometry and rebuild.
    66 | octreeHelper.update();
    67 | 
    68 | // Destroy the helper geometry.
    69 | octreeHelper.dispose();
    70 | 
    71 |

    Contributing

    Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

    72 |
    73 |
    74 | 75 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /docs/file/src/OctreeHelper.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | src/OctreeHelper.js | octree-helper 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    15 | Home 16 | 17 | Reference 18 | Source 19 | 20 | 27 |
    28 | 29 | 36 | 37 |

    src/OctreeHelper.js

    38 |
    import { edges, layout } from "sparse-octree";
     39 | 
     40 | import {
     41 | 	BufferAttribute,
     42 | 	BufferGeometry,
     43 | 	Group,
     44 | 	LineSegments,
     45 | 	LineBasicMaterial
     46 | } from "three";
     47 | 
     48 | /**
     49 |  * An octree helper.
     50 |  */
     51 | 
     52 | export class OctreeHelper extends Group {
     53 | 
     54 | 	/**
     55 | 	 * Constructs a new octree helper.
     56 | 	 *
     57 | 	 * @param {Tree} [octree=null] - An octree.
     58 | 	 */
     59 | 
     60 | 	constructor(octree = null) {
     61 | 
     62 | 		super();
     63 | 
     64 | 		/**
     65 | 		 * The name of this object.
     66 | 		 *
     67 | 		 * @type {String}
     68 | 		 * @protected
     69 | 		 */
     70 | 
     71 | 		this.name = "OctreeHelper";
     72 | 
     73 | 		/**
     74 | 		 * The octree.
     75 | 		 *
     76 | 		 * @type {Tree}
     77 | 		 */
     78 | 
     79 | 		this.octree = octree;
     80 | 
     81 | 		this.update();
     82 | 
     83 | 	}
     84 | 
     85 | 	/**
     86 | 	 * Creates octant geometry.
     87 | 	 *
     88 | 	 * @private
     89 | 	 * @param {Iterator} octants - An octant iterator.
     90 | 	 * @param {Number} octantCount - The size of the given sequence.
     91 | 	 */
     92 | 
     93 | 	createLineSegments(octants, octantCount) {
     94 | 
     95 | 		const maxOctants = (Math.pow(2, 16) / 8) - 1;
     96 | 		const group = new Group();
     97 | 
     98 | 		const material = new LineBasicMaterial({
     99 | 			color: 0xffffff * Math.random()
    100 | 		});
    101 | 
    102 | 		let result;
    103 | 		let vertexCount;
    104 | 		let length;
    105 | 
    106 | 		let indices, positions;
    107 | 		let octant, min, max;
    108 | 		let geometry;
    109 | 
    110 | 		let i, j, c, d, n;
    111 | 		let corner, edge;
    112 | 
    113 | 		// Create geometry in multiple runs to limit the amount of vertices.
    114 | 		for(i = 0, length = 0, n = Math.ceil(octantCount / maxOctants); n > 0; --n) {
    115 | 
    116 | 			length += (octantCount < maxOctants) ? octantCount : maxOctants;
    117 | 			octantCount -= maxOctants;
    118 | 
    119 | 			vertexCount = length * 8;
    120 | 			indices = new Uint16Array(vertexCount * 3);
    121 | 			positions = new Float32Array(vertexCount * 3);
    122 | 
    123 | 			// Continue where the previous run left off.
    124 | 			for(c = 0, d = 0, result = octants.next(); !result.done && i < length;) {
    125 | 
    126 | 				octant = result.value;
    127 | 				min = octant.min;
    128 | 				max = octant.max;
    129 | 
    130 | 				// Create line connections based on the current vertex count.
    131 | 				for(j = 0; j < 12; ++j) {
    132 | 
    133 | 					edge = edges[j];
    134 | 
    135 | 					indices[d++] = c + edge[0];
    136 | 					indices[d++] = c + edge[1];
    137 | 
    138 | 				}
    139 | 
    140 | 				// Create the vertices.
    141 | 				for(j = 0; j < 8; ++j, ++c) {
    142 | 
    143 | 					corner = layout[j];
    144 | 
    145 | 					positions[c * 3] = (corner[0] === 0) ? min.x : max.x;
    146 | 					positions[c * 3 + 1] = (corner[1] === 0) ? min.y : max.y;
    147 | 					positions[c * 3 + 2] = (corner[2] === 0) ? min.z : max.z;
    148 | 
    149 | 				}
    150 | 
    151 | 				if(++i < length) {
    152 | 
    153 | 					result = octants.next();
    154 | 
    155 | 				}
    156 | 
    157 | 			}
    158 | 
    159 | 			geometry = new BufferGeometry();
    160 | 			geometry.setIndex(new BufferAttribute(indices, 1));
    161 | 			geometry.setAttribute("position", new BufferAttribute(positions, 3));
    162 | 
    163 | 			group.add(new LineSegments(geometry, material));
    164 | 
    165 | 		}
    166 | 
    167 | 		this.add(group);
    168 | 
    169 | 	}
    170 | 
    171 | 	/**
    172 | 	 * Updates the helper geometry.
    173 | 	 */
    174 | 
    175 | 	update() {
    176 | 
    177 | 		const depth = (this.octree !== null) ? this.octree.getDepth() : -1;
    178 | 
    179 | 		let level = 0;
    180 | 		let result;
    181 | 
    182 | 		// Remove existing geometry.
    183 | 		this.dispose();
    184 | 
    185 | 		while(level <= depth) {
    186 | 
    187 | 			result = this.octree.findNodesByLevel(level);
    188 | 
    189 | 			this.createLineSegments(
    190 | 				result[Symbol.iterator](),
    191 | 				(typeof result.size === "number") ? result.size : result.length
    192 | 			);
    193 | 
    194 | 			++level;
    195 | 
    196 | 		}
    197 | 
    198 | 	}
    199 | 
    200 | 	/**
    201 | 	 * Destroys this helper.
    202 | 	 */
    203 | 
    204 | 	dispose() {
    205 | 
    206 | 		const groups = this.children;
    207 | 
    208 | 		let group, children;
    209 | 		let i, j, il, jl;
    210 | 
    211 | 		for(i = 0, il = groups.length; i < il; ++i) {
    212 | 
    213 | 			group = groups[i];
    214 | 			children = group.children;
    215 | 
    216 | 			for(j = 0, jl = children.length; j < jl; ++j) {
    217 | 
    218 | 				children[j].geometry.dispose();
    219 | 				children[j].material.dispose();
    220 | 
    221 | 			}
    222 | 
    223 | 			while(children.length > 0) {
    224 | 
    225 | 				group.remove(children[0]);
    226 | 
    227 | 			}
    228 | 
    229 | 		}
    230 | 
    231 | 		while(groups.length > 0) {
    232 | 
    233 | 			this.remove(groups[0]);
    234 | 
    235 | 		}
    236 | 
    237 | 	}
    238 | 
    239 | }
    240 | 
    241 | 242 |
    243 | 244 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | -------------------------------------------------------------------------------- /docs/ast/source/index.js.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "File", 3 | "start": 0, 4 | "end": 51, 5 | "loc": { 6 | "start": { 7 | "line": 1, 8 | "column": 0 9 | }, 10 | "end": { 11 | "line": 2, 12 | "column": 0 13 | } 14 | }, 15 | "program": { 16 | "type": "Program", 17 | "start": 0, 18 | "end": 51, 19 | "loc": { 20 | "start": { 21 | "line": 1, 22 | "column": 0 23 | }, 24 | "end": { 25 | "line": 2, 26 | "column": 0 27 | } 28 | }, 29 | "sourceType": "module", 30 | "body": [ 31 | { 32 | "type": "ExportNamedDeclaration", 33 | "start": 0, 34 | "end": 49, 35 | "loc": { 36 | "start": { 37 | "line": 1, 38 | "column": 0 39 | }, 40 | "end": { 41 | "line": 1, 42 | "column": 49 43 | } 44 | }, 45 | "declaration": null, 46 | "specifiers": [ 47 | { 48 | "type": "ExportSpecifier", 49 | "start": 9, 50 | "end": 21, 51 | "loc": { 52 | "start": { 53 | "line": 1, 54 | "column": 9 55 | }, 56 | "end": { 57 | "line": 1, 58 | "column": 21 59 | } 60 | }, 61 | "local": { 62 | "type": "Identifier", 63 | "start": 9, 64 | "end": 21, 65 | "loc": { 66 | "start": { 67 | "line": 1, 68 | "column": 9 69 | }, 70 | "end": { 71 | "line": 1, 72 | "column": 21 73 | }, 74 | "identifierName": "OctreeHelper" 75 | }, 76 | "name": "OctreeHelper" 77 | }, 78 | "exported": { 79 | "type": "Identifier", 80 | "start": 9, 81 | "end": 21, 82 | "loc": { 83 | "start": { 84 | "line": 1, 85 | "column": 9 86 | }, 87 | "end": { 88 | "line": 1, 89 | "column": 21 90 | }, 91 | "identifierName": "OctreeHelper" 92 | }, 93 | "name": "OctreeHelper" 94 | } 95 | } 96 | ], 97 | "source": { 98 | "type": "StringLiteral", 99 | "start": 29, 100 | "end": 48, 101 | "loc": { 102 | "start": { 103 | "line": 1, 104 | "column": 29 105 | }, 106 | "end": { 107 | "line": 1, 108 | "column": 48 109 | } 110 | }, 111 | "extra": { 112 | "rawValue": "./OctreeHelper.js", 113 | "raw": "\"./OctreeHelper.js\"" 114 | }, 115 | "value": "./OctreeHelper.js" 116 | } 117 | } 118 | ], 119 | "directives": [] 120 | }, 121 | "comments": [], 122 | "tokens": [ 123 | { 124 | "type": { 125 | "label": "export", 126 | "keyword": "export", 127 | "beforeExpr": false, 128 | "startsExpr": false, 129 | "rightAssociative": false, 130 | "isLoop": false, 131 | "isAssign": false, 132 | "prefix": false, 133 | "postfix": false, 134 | "binop": null, 135 | "updateContext": null 136 | }, 137 | "value": "export", 138 | "start": 0, 139 | "end": 6, 140 | "loc": { 141 | "start": { 142 | "line": 1, 143 | "column": 0 144 | }, 145 | "end": { 146 | "line": 1, 147 | "column": 6 148 | } 149 | } 150 | }, 151 | { 152 | "type": { 153 | "label": "{", 154 | "beforeExpr": true, 155 | "startsExpr": true, 156 | "rightAssociative": false, 157 | "isLoop": false, 158 | "isAssign": false, 159 | "prefix": false, 160 | "postfix": false, 161 | "binop": null 162 | }, 163 | "start": 7, 164 | "end": 8, 165 | "loc": { 166 | "start": { 167 | "line": 1, 168 | "column": 7 169 | }, 170 | "end": { 171 | "line": 1, 172 | "column": 8 173 | } 174 | } 175 | }, 176 | { 177 | "type": { 178 | "label": "name", 179 | "beforeExpr": false, 180 | "startsExpr": true, 181 | "rightAssociative": false, 182 | "isLoop": false, 183 | "isAssign": false, 184 | "prefix": false, 185 | "postfix": false, 186 | "binop": null 187 | }, 188 | "value": "OctreeHelper", 189 | "start": 9, 190 | "end": 21, 191 | "loc": { 192 | "start": { 193 | "line": 1, 194 | "column": 9 195 | }, 196 | "end": { 197 | "line": 1, 198 | "column": 21 199 | } 200 | } 201 | }, 202 | { 203 | "type": { 204 | "label": "}", 205 | "beforeExpr": false, 206 | "startsExpr": false, 207 | "rightAssociative": false, 208 | "isLoop": false, 209 | "isAssign": false, 210 | "prefix": false, 211 | "postfix": false, 212 | "binop": null 213 | }, 214 | "start": 22, 215 | "end": 23, 216 | "loc": { 217 | "start": { 218 | "line": 1, 219 | "column": 22 220 | }, 221 | "end": { 222 | "line": 1, 223 | "column": 23 224 | } 225 | } 226 | }, 227 | { 228 | "type": { 229 | "label": "name", 230 | "beforeExpr": false, 231 | "startsExpr": true, 232 | "rightAssociative": false, 233 | "isLoop": false, 234 | "isAssign": false, 235 | "prefix": false, 236 | "postfix": false, 237 | "binop": null 238 | }, 239 | "value": "from", 240 | "start": 24, 241 | "end": 28, 242 | "loc": { 243 | "start": { 244 | "line": 1, 245 | "column": 24 246 | }, 247 | "end": { 248 | "line": 1, 249 | "column": 28 250 | } 251 | } 252 | }, 253 | { 254 | "type": { 255 | "label": "string", 256 | "beforeExpr": false, 257 | "startsExpr": true, 258 | "rightAssociative": false, 259 | "isLoop": false, 260 | "isAssign": false, 261 | "prefix": false, 262 | "postfix": false, 263 | "binop": null, 264 | "updateContext": null 265 | }, 266 | "value": "./OctreeHelper.js", 267 | "start": 29, 268 | "end": 48, 269 | "loc": { 270 | "start": { 271 | "line": 1, 272 | "column": 29 273 | }, 274 | "end": { 275 | "line": 1, 276 | "column": 48 277 | } 278 | } 279 | }, 280 | { 281 | "type": { 282 | "label": ";", 283 | "beforeExpr": true, 284 | "startsExpr": false, 285 | "rightAssociative": false, 286 | "isLoop": false, 287 | "isAssign": false, 288 | "prefix": false, 289 | "postfix": false, 290 | "binop": null, 291 | "updateContext": null 292 | }, 293 | "start": 48, 294 | "end": 49, 295 | "loc": { 296 | "start": { 297 | "line": 1, 298 | "column": 48 299 | }, 300 | "end": { 301 | "line": 1, 302 | "column": 49 303 | } 304 | } 305 | }, 306 | { 307 | "type": { 308 | "label": "eof", 309 | "beforeExpr": false, 310 | "startsExpr": false, 311 | "rightAssociative": false, 312 | "isLoop": false, 313 | "isAssign": false, 314 | "prefix": false, 315 | "postfix": false, 316 | "binop": null, 317 | "updateContext": null 318 | }, 319 | "start": 51, 320 | "end": 51, 321 | "loc": { 322 | "start": { 323 | "line": 2, 324 | "column": 0 325 | }, 326 | "end": { 327 | "line": 2, 328 | "column": 0 329 | } 330 | } 331 | } 332 | ] 333 | } -------------------------------------------------------------------------------- /docs/script/prettify/Apache-License-2.0.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /docs/css/style.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Roboto:400,300,700); 2 | @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,600,700); 3 | @import url(./manual.css); 4 | @import url(./source.css); 5 | @import url(./test.css); 6 | @import url(./identifiers.css); 7 | @import url(./github.css); 8 | @import url(./search.css); 9 | 10 | * { 11 | margin: 0; 12 | padding: 0; 13 | text-decoration: none; 14 | } 15 | 16 | html 17 | { 18 | font-family: 'Source Sans Pro', 'Roboto', sans-serif; 19 | overflow: auto; 20 | /*font-size: 14px;*/ 21 | /*color: #4d4e53;*/ 22 | /*color: rgba(0, 0, 0, .68);*/ 23 | color: #555; 24 | background-color: #fff; 25 | } 26 | 27 | a { 28 | /*color: #0095dd;*/ 29 | /*color:rgb(37, 138, 175);*/ 30 | color: #039BE5; 31 | } 32 | 33 | code a:hover { 34 | text-decoration: underline; 35 | } 36 | 37 | ul, ol { 38 | padding-left: 20px; 39 | } 40 | 41 | ul li { 42 | list-style: disc; 43 | margin: 4px 0; 44 | } 45 | 46 | ol li { 47 | margin: 4px 0; 48 | } 49 | 50 | h1 { 51 | margin-bottom: 10px; 52 | font-size: 34px; 53 | font-weight: 300; 54 | border-bottom: solid 1px #ddd; 55 | } 56 | 57 | h2 { 58 | margin-top: 24px; 59 | margin-bottom: 10px; 60 | font-size: 20px; 61 | border-bottom: solid 1px #ddd; 62 | font-weight: 300; 63 | } 64 | 65 | h3 { 66 | position: relative; 67 | font-size: 16px; 68 | margin-bottom: 12px; 69 | padding: 4px; 70 | font-weight: 300; 71 | } 72 | 73 | details { 74 | cursor: pointer; 75 | } 76 | 77 | del { 78 | text-decoration: line-through; 79 | } 80 | 81 | p { 82 | margin-bottom: 15px; 83 | line-height: 1.5; 84 | } 85 | 86 | code { 87 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 88 | } 89 | 90 | pre > code { 91 | display: block; 92 | } 93 | 94 | pre.prettyprint, pre > code { 95 | padding: 4px; 96 | margin: 1em 0; 97 | background-color: #f5f5f5; 98 | border-radius: 3px; 99 | } 100 | 101 | pre.prettyprint > code { 102 | margin: 0; 103 | } 104 | 105 | p > code, 106 | li > code { 107 | padding: 0.2em 0.5em; 108 | margin: 0; 109 | font-size: 85%; 110 | background-color: rgba(0,0,0,0.04); 111 | border-radius: 3px; 112 | } 113 | 114 | .code { 115 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 116 | font-size: 13px; 117 | } 118 | 119 | .import-path pre.prettyprint, 120 | .import-path pre.prettyprint code { 121 | margin: 0; 122 | padding: 0; 123 | border: none; 124 | background: white; 125 | } 126 | 127 | .layout-container { 128 | /*display: flex;*/ 129 | /*flex-direction: row;*/ 130 | /*justify-content: flex-start;*/ 131 | /*align-items: stretch;*/ 132 | } 133 | 134 | .layout-container > header { 135 | display: flex; 136 | height: 40px; 137 | line-height: 40px; 138 | font-size: 16px; 139 | padding: 0 10px; 140 | margin: 0; 141 | position: fixed; 142 | width: 100%; 143 | z-index: 1; 144 | background-color: #fafafa; 145 | top: 0; 146 | border-bottom: solid 1px #ddd; 147 | } 148 | .layout-container > header > a{ 149 | margin: 0 5px; 150 | color: #444; 151 | } 152 | 153 | .layout-container > header > a.repo-url-github { 154 | font-size: 0; 155 | display: inline-block; 156 | width: 20px; 157 | height: 38px; 158 | background: url("../image/github.png") no-repeat center; 159 | background-size: 20px; 160 | vertical-align: top; 161 | } 162 | 163 | .navigation { 164 | position: fixed; 165 | top: 0; 166 | left: 0; 167 | box-sizing: border-box; 168 | width: 250px; 169 | height: 100%; 170 | padding-top: 40px; 171 | padding-left: 15px; 172 | padding-bottom: 2em; 173 | margin-top:1em; 174 | overflow-x: scroll; 175 | box-shadow: rgba(255, 255, 255, 1) -1px 0 0 inset; 176 | border-right: 1px solid #ddd; 177 | } 178 | 179 | .navigation ul { 180 | padding: 0; 181 | } 182 | 183 | .navigation li { 184 | list-style: none; 185 | margin: 4px 0; 186 | white-space: nowrap; 187 | } 188 | 189 | .navigation li a { 190 | color: #666; 191 | } 192 | 193 | .navigation .nav-dir-path { 194 | display: block; 195 | margin-top: 0.7em; 196 | margin-bottom: 0.25em; 197 | font-weight: 600; 198 | } 199 | 200 | .kind-class, 201 | .kind-interface, 202 | .kind-function, 203 | .kind-typedef, 204 | .kind-variable, 205 | .kind-external { 206 | margin-left: 0.75em; 207 | width: 1.2em; 208 | height: 1.2em; 209 | display: inline-block; 210 | text-align: center; 211 | border-radius: 0.2em; 212 | margin-right: 0.2em; 213 | font-weight: bold; 214 | line-height: 1.2em; 215 | } 216 | 217 | .kind-class { 218 | color: #009800; 219 | background-color: #bfe5bf; 220 | } 221 | 222 | .kind-interface { 223 | color: #fbca04; 224 | background-color: #fef2c0; 225 | } 226 | 227 | .kind-function { 228 | color: #6b0090; 229 | background-color: #d6bdde; 230 | } 231 | 232 | .kind-variable { 233 | color: #eb6420; 234 | background-color: #fad8c7; 235 | } 236 | 237 | .kind-typedef { 238 | color: #db001e; 239 | background-color: #edbec3; 240 | } 241 | 242 | .kind-external { 243 | color: #0738c3; 244 | background-color: #bbcbea; 245 | } 246 | 247 | .summary span[class^="kind-"] { 248 | margin-left: 0; 249 | } 250 | 251 | h1 .version, 252 | h1 .url a { 253 | font-size: 14px; 254 | color: #aaa; 255 | } 256 | 257 | .content { 258 | margin-top: 40px; 259 | margin-left: 250px; 260 | padding: 10px 50px 10px 20px; 261 | } 262 | 263 | .header-notice { 264 | font-size: 14px; 265 | color: #aaa; 266 | margin: 0; 267 | } 268 | 269 | .expression-extends .prettyprint { 270 | margin-left: 10px; 271 | background: white; 272 | } 273 | 274 | .extends-chain { 275 | border-bottom: 1px solid#ddd; 276 | padding-bottom: 10px; 277 | margin-bottom: 10px; 278 | } 279 | 280 | .extends-chain span:nth-of-type(1) { 281 | padding-left: 10px; 282 | } 283 | 284 | .extends-chain > div { 285 | margin: 5px 0; 286 | } 287 | 288 | .description table { 289 | font-size: 14px; 290 | border-spacing: 0; 291 | border: 0; 292 | border-collapse: collapse; 293 | } 294 | 295 | .description thead { 296 | background: #999; 297 | color: white; 298 | } 299 | 300 | .description table td, 301 | .description table th { 302 | border: solid 1px #ddd; 303 | padding: 4px; 304 | font-weight: normal; 305 | } 306 | 307 | .flat-list ul { 308 | padding-left: 0; 309 | } 310 | 311 | .flat-list li { 312 | display: inline; 313 | list-style: none; 314 | } 315 | 316 | table.summary { 317 | width: 100%; 318 | margin: 10px 0; 319 | border-spacing: 0; 320 | border: 0; 321 | border-collapse: collapse; 322 | } 323 | 324 | table.summary thead { 325 | background: #fafafa; 326 | } 327 | 328 | table.summary td { 329 | border: solid 1px #ddd; 330 | padding: 4px 10px; 331 | } 332 | 333 | table.summary tbody td:nth-child(1) { 334 | text-align: right; 335 | white-space: nowrap; 336 | min-width: 64px; 337 | vertical-align: top; 338 | } 339 | 340 | table.summary tbody td:nth-child(2) { 341 | width: 100%; 342 | border-right: none; 343 | } 344 | 345 | table.summary tbody td:nth-child(3) { 346 | white-space: nowrap; 347 | border-left: none; 348 | vertical-align: top; 349 | } 350 | 351 | table.summary td > div:nth-of-type(2) { 352 | padding-top: 4px; 353 | padding-left: 15px; 354 | } 355 | 356 | table.summary td p { 357 | margin-bottom: 0; 358 | } 359 | 360 | .inherited-summary thead td { 361 | padding-left: 2px; 362 | } 363 | 364 | .inherited-summary thead a { 365 | color: white; 366 | } 367 | 368 | .inherited-summary .summary tbody { 369 | display: none; 370 | } 371 | 372 | .inherited-summary .summary .toggle { 373 | padding: 0 4px; 374 | font-size: 12px; 375 | cursor: pointer; 376 | } 377 | .inherited-summary .summary .toggle.closed:before { 378 | content: "▶"; 379 | } 380 | .inherited-summary .summary .toggle.opened:before { 381 | content: "▼"; 382 | } 383 | 384 | .member, .method { 385 | margin-bottom: 24px; 386 | } 387 | 388 | table.params { 389 | width: 100%; 390 | margin: 10px 0; 391 | border-spacing: 0; 392 | border: 0; 393 | border-collapse: collapse; 394 | } 395 | 396 | table.params thead { 397 | background: #eee; 398 | color: #aaa; 399 | } 400 | 401 | table.params td { 402 | padding: 4px; 403 | border: solid 1px #ddd; 404 | } 405 | 406 | table.params td p { 407 | margin: 0; 408 | } 409 | 410 | .content .detail > * { 411 | margin: 15px 0; 412 | } 413 | 414 | .content .detail > h3 { 415 | color: black; 416 | background-color: #f0f0f0; 417 | } 418 | 419 | .content .detail > div { 420 | margin-left: 10px; 421 | } 422 | 423 | .content .detail > .import-path { 424 | margin-top: -8px; 425 | } 426 | 427 | .content .detail + .detail { 428 | margin-top: 30px; 429 | } 430 | 431 | .content .detail .throw td:first-child { 432 | padding-right: 10px; 433 | } 434 | 435 | .content .detail h4 + :not(pre) { 436 | padding-left: 0; 437 | margin-left: 10px; 438 | } 439 | 440 | .content .detail h4 + ul li { 441 | list-style: none; 442 | } 443 | 444 | .return-param * { 445 | display: inline; 446 | } 447 | 448 | .argument-params { 449 | margin-bottom: 20px; 450 | } 451 | 452 | .return-type { 453 | padding-right: 10px; 454 | font-weight: normal; 455 | } 456 | 457 | .return-desc { 458 | margin-left: 10px; 459 | margin-top: 4px; 460 | } 461 | 462 | .return-desc p { 463 | margin: 0; 464 | } 465 | 466 | .deprecated, .experimental, .instance-docs { 467 | border-left: solid 5px orange; 468 | padding-left: 4px; 469 | margin: 4px 0; 470 | } 471 | 472 | tr.listen p, 473 | tr.throw p, 474 | tr.emit p{ 475 | margin-bottom: 10px; 476 | } 477 | 478 | .version, .since { 479 | color: #aaa; 480 | } 481 | 482 | h3 .right-info { 483 | position: absolute; 484 | right: 4px; 485 | font-size: 14px; 486 | } 487 | 488 | .version + .since:before { 489 | content: '| '; 490 | } 491 | 492 | .see { 493 | margin-top: 10px; 494 | } 495 | 496 | .see h4 { 497 | margin: 4px 0; 498 | } 499 | 500 | .content .detail h4 + .example-doc { 501 | margin: 6px 0; 502 | } 503 | 504 | .example-caption { 505 | position: relative; 506 | bottom: -1px; 507 | display: inline-block; 508 | padding: 4px; 509 | font-style: italic; 510 | background-color: #f5f5f5; 511 | font-weight: bold; 512 | border-radius: 3px; 513 | border-bottom-left-radius: 0; 514 | border-bottom-right-radius: 0; 515 | } 516 | 517 | .example-caption + pre.source-code { 518 | margin-top: 0; 519 | border-top-left-radius: 0; 520 | } 521 | 522 | footer, .file-footer { 523 | text-align: right; 524 | font-style: italic; 525 | font-weight: 100; 526 | font-size: 13px; 527 | margin-right: 50px; 528 | margin-left: 270px; 529 | border-top: 1px solid #ddd; 530 | padding-top: 30px; 531 | margin-top: 20px; 532 | padding-bottom: 10px; 533 | } 534 | 535 | footer img { 536 | width: 24px; 537 | vertical-align: middle; 538 | padding-left: 4px; 539 | position: relative; 540 | top: -3px; 541 | opacity: 0.6; 542 | } 543 | 544 | pre.source-code { 545 | padding: 4px; 546 | } 547 | 548 | pre.raw-source-code > code { 549 | padding: 0; 550 | margin: 0; 551 | font-size: 12px; 552 | background: #fff; 553 | border: solid 1px #ddd; 554 | line-height: 1.5; 555 | } 556 | 557 | pre.raw-source-code > code > ol { 558 | counter-reset:number; 559 | list-style:none; 560 | margin:0; 561 | padding:0; 562 | overflow: hidden; 563 | } 564 | 565 | pre.raw-source-code > code > ol li:before { 566 | counter-increment: number; 567 | content: counter(number); 568 | display: inline-block; 569 | min-width: 3em; 570 | color: #aaa; 571 | text-align: right; 572 | padding-right: 1em; 573 | } 574 | 575 | pre.source-code.line-number { 576 | padding: 0; 577 | } 578 | 579 | pre.source-code ol { 580 | background: #eee; 581 | padding-left: 40px; 582 | } 583 | 584 | pre.source-code li { 585 | background: white; 586 | padding-left: 4px; 587 | list-style: decimal; 588 | margin: 0; 589 | } 590 | 591 | pre.source-code.line-number li.active { 592 | background: rgb(255, 255, 150) !important; 593 | } 594 | 595 | pre.source-code.line-number li.error-line { 596 | background: #ffb8bf; 597 | } 598 | 599 | .inner-link-active { 600 | /*background: rgb(255, 255, 150) !important;*/ 601 | background: #039BE5 !important; 602 | color: #fff !important; 603 | padding-left: 0.1em !important; 604 | } 605 | 606 | .inner-link-active a { 607 | color: inherit; 608 | } 609 | -------------------------------------------------------------------------------- /docs/script/search_index.js: -------------------------------------------------------------------------------- 1 | window.esdocSearchIndex = [ 2 | [ 3 | "octree-helper~octreehelper", 4 | "class/src/OctreeHelper.js~OctreeHelper.html", 5 | "OctreeHelper octree-helper", 6 | "class" 7 | ], 8 | [ 9 | "src/.external-ecmascript.js~array", 10 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", 11 | "src/.external-ecmascript.js~Array", 12 | "external" 13 | ], 14 | [ 15 | "src/.external-ecmascript.js~arraybuffer", 16 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer", 17 | "src/.external-ecmascript.js~ArrayBuffer", 18 | "external" 19 | ], 20 | [ 21 | "src/.external-ecmascript.js~boolean", 22 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", 23 | "src/.external-ecmascript.js~Boolean", 24 | "external" 25 | ], 26 | [ 27 | "src/.external-ecmascript.js~dataview", 28 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView", 29 | "src/.external-ecmascript.js~DataView", 30 | "external" 31 | ], 32 | [ 33 | "src/.external-ecmascript.js~date", 34 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", 35 | "src/.external-ecmascript.js~Date", 36 | "external" 37 | ], 38 | [ 39 | "src/.external-ecmascript.js~error", 40 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", 41 | "src/.external-ecmascript.js~Error", 42 | "external" 43 | ], 44 | [ 45 | "src/.external-ecmascript.js~evalerror", 46 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError", 47 | "src/.external-ecmascript.js~EvalError", 48 | "external" 49 | ], 50 | [ 51 | "src/.external-ecmascript.js~float32array", 52 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array", 53 | "src/.external-ecmascript.js~Float32Array", 54 | "external" 55 | ], 56 | [ 57 | "src/.external-ecmascript.js~float64array", 58 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array", 59 | "src/.external-ecmascript.js~Float64Array", 60 | "external" 61 | ], 62 | [ 63 | "src/.external-ecmascript.js~function", 64 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", 65 | "src/.external-ecmascript.js~Function", 66 | "external" 67 | ], 68 | [ 69 | "src/.external-ecmascript.js~generator", 70 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator", 71 | "src/.external-ecmascript.js~Generator", 72 | "external" 73 | ], 74 | [ 75 | "src/.external-ecmascript.js~generatorfunction", 76 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction", 77 | "src/.external-ecmascript.js~GeneratorFunction", 78 | "external" 79 | ], 80 | [ 81 | "src/.external-ecmascript.js~infinity", 82 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity", 83 | "src/.external-ecmascript.js~Infinity", 84 | "external" 85 | ], 86 | [ 87 | "src/.external-ecmascript.js~int16array", 88 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array", 89 | "src/.external-ecmascript.js~Int16Array", 90 | "external" 91 | ], 92 | [ 93 | "src/.external-ecmascript.js~int32array", 94 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array", 95 | "src/.external-ecmascript.js~Int32Array", 96 | "external" 97 | ], 98 | [ 99 | "src/.external-ecmascript.js~int8array", 100 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array", 101 | "src/.external-ecmascript.js~Int8Array", 102 | "external" 103 | ], 104 | [ 105 | "src/.external-ecmascript.js~internalerror", 106 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError", 107 | "src/.external-ecmascript.js~InternalError", 108 | "external" 109 | ], 110 | [ 111 | "src/.external-ecmascript.js~json", 112 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON", 113 | "src/.external-ecmascript.js~JSON", 114 | "external" 115 | ], 116 | [ 117 | "src/.external-ecmascript.js~map", 118 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map", 119 | "src/.external-ecmascript.js~Map", 120 | "external" 121 | ], 122 | [ 123 | "src/.external-ecmascript.js~nan", 124 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN", 125 | "src/.external-ecmascript.js~NaN", 126 | "external" 127 | ], 128 | [ 129 | "src/.external-ecmascript.js~number", 130 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", 131 | "src/.external-ecmascript.js~Number", 132 | "external" 133 | ], 134 | [ 135 | "src/.external-ecmascript.js~object", 136 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", 137 | "src/.external-ecmascript.js~Object", 138 | "external" 139 | ], 140 | [ 141 | "src/.external-ecmascript.js~promise", 142 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", 143 | "src/.external-ecmascript.js~Promise", 144 | "external" 145 | ], 146 | [ 147 | "src/.external-ecmascript.js~proxy", 148 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy", 149 | "src/.external-ecmascript.js~Proxy", 150 | "external" 151 | ], 152 | [ 153 | "src/.external-ecmascript.js~rangeerror", 154 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError", 155 | "src/.external-ecmascript.js~RangeError", 156 | "external" 157 | ], 158 | [ 159 | "src/.external-ecmascript.js~referenceerror", 160 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError", 161 | "src/.external-ecmascript.js~ReferenceError", 162 | "external" 163 | ], 164 | [ 165 | "src/.external-ecmascript.js~reflect", 166 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect", 167 | "src/.external-ecmascript.js~Reflect", 168 | "external" 169 | ], 170 | [ 171 | "src/.external-ecmascript.js~regexp", 172 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp", 173 | "src/.external-ecmascript.js~RegExp", 174 | "external" 175 | ], 176 | [ 177 | "src/.external-ecmascript.js~set", 178 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set", 179 | "src/.external-ecmascript.js~Set", 180 | "external" 181 | ], 182 | [ 183 | "src/.external-ecmascript.js~string", 184 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", 185 | "src/.external-ecmascript.js~String", 186 | "external" 187 | ], 188 | [ 189 | "src/.external-ecmascript.js~symbol", 190 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol", 191 | "src/.external-ecmascript.js~Symbol", 192 | "external" 193 | ], 194 | [ 195 | "src/.external-ecmascript.js~syntaxerror", 196 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError", 197 | "src/.external-ecmascript.js~SyntaxError", 198 | "external" 199 | ], 200 | [ 201 | "src/.external-ecmascript.js~typeerror", 202 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError", 203 | "src/.external-ecmascript.js~TypeError", 204 | "external" 205 | ], 206 | [ 207 | "src/.external-ecmascript.js~urierror", 208 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError", 209 | "src/.external-ecmascript.js~URIError", 210 | "external" 211 | ], 212 | [ 213 | "src/.external-ecmascript.js~uint16array", 214 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array", 215 | "src/.external-ecmascript.js~Uint16Array", 216 | "external" 217 | ], 218 | [ 219 | "src/.external-ecmascript.js~uint32array", 220 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array", 221 | "src/.external-ecmascript.js~Uint32Array", 222 | "external" 223 | ], 224 | [ 225 | "src/.external-ecmascript.js~uint8array", 226 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array", 227 | "src/.external-ecmascript.js~Uint8Array", 228 | "external" 229 | ], 230 | [ 231 | "src/.external-ecmascript.js~uint8clampedarray", 232 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray", 233 | "src/.external-ecmascript.js~Uint8ClampedArray", 234 | "external" 235 | ], 236 | [ 237 | "src/.external-ecmascript.js~weakmap", 238 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap", 239 | "src/.external-ecmascript.js~WeakMap", 240 | "external" 241 | ], 242 | [ 243 | "src/.external-ecmascript.js~weakset", 244 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet", 245 | "src/.external-ecmascript.js~WeakSet", 246 | "external" 247 | ], 248 | [ 249 | "src/.external-ecmascript.js~boolean", 250 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", 251 | "src/.external-ecmascript.js~boolean", 252 | "external" 253 | ], 254 | [ 255 | "src/.external-ecmascript.js~function", 256 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", 257 | "src/.external-ecmascript.js~function", 258 | "external" 259 | ], 260 | [ 261 | "src/.external-ecmascript.js~null", 262 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null", 263 | "src/.external-ecmascript.js~null", 264 | "external" 265 | ], 266 | [ 267 | "src/.external-ecmascript.js~number", 268 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", 269 | "src/.external-ecmascript.js~number", 270 | "external" 271 | ], 272 | [ 273 | "src/.external-ecmascript.js~object", 274 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", 275 | "src/.external-ecmascript.js~object", 276 | "external" 277 | ], 278 | [ 279 | "src/.external-ecmascript.js~string", 280 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", 281 | "src/.external-ecmascript.js~string", 282 | "external" 283 | ], 284 | [ 285 | "src/.external-ecmascript.js~undefined", 286 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", 287 | "src/.external-ecmascript.js~undefined", 288 | "external" 289 | ], 290 | [ 291 | "src/octreehelper.js", 292 | "file/src/OctreeHelper.js.html", 293 | "src/OctreeHelper.js", 294 | "file" 295 | ], 296 | [ 297 | "src/octreehelper.js~octreehelper#constructor", 298 | "class/src/OctreeHelper.js~OctreeHelper.html#instance-constructor-constructor", 299 | "src/OctreeHelper.js~OctreeHelper#constructor", 300 | "method" 301 | ], 302 | [ 303 | "src/octreehelper.js~octreehelper#dispose", 304 | "class/src/OctreeHelper.js~OctreeHelper.html#instance-method-dispose", 305 | "src/OctreeHelper.js~OctreeHelper#dispose", 306 | "method" 307 | ], 308 | [ 309 | "src/octreehelper.js~octreehelper#name", 310 | "class/src/OctreeHelper.js~OctreeHelper.html#instance-member-name", 311 | "src/OctreeHelper.js~OctreeHelper#name", 312 | "member" 313 | ], 314 | [ 315 | "src/octreehelper.js~octreehelper#octree", 316 | "class/src/OctreeHelper.js~OctreeHelper.html#instance-member-octree", 317 | "src/OctreeHelper.js~OctreeHelper#octree", 318 | "member" 319 | ], 320 | [ 321 | "src/octreehelper.js~octreehelper#update", 322 | "class/src/OctreeHelper.js~OctreeHelper.html#instance-method-update", 323 | "src/OctreeHelper.js~OctreeHelper#update", 324 | "method" 325 | ], 326 | [ 327 | "src/index.js", 328 | "file/src/index.js.html", 329 | "src/index.js", 330 | "file" 331 | ] 332 | ] -------------------------------------------------------------------------------- /docs/class/src/OctreeHelper.js~OctreeHelper.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | OctreeHelper | octree-helper 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
    15 | Home 16 | 17 | Reference 18 | Source 19 | 20 | 27 |
    28 | 29 | 36 | 37 |
    38 |
    import {OctreeHelper} from 'octree-helper'
    39 | public 40 | class 41 | 42 | 43 | 44 | | source 45 |
    46 | 47 |
    48 |

    OctreeHelper

    49 | 50 | 51 | 52 | 53 | 54 |

    Extends:

    three~Group → OctreeHelper
    55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |

    An octree helper.

    65 |
    66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
    76 | 77 | 78 | 79 |

    Constructor Summary

    80 | 81 | 82 | 83 | 84 | 91 | 107 | 111 | 112 | 113 |
    Public Constructor
    85 | public 86 | 87 | 88 | 89 | 90 | 92 |
    93 |

    94 | 95 | 96 | 97 | constructor(octree: Tree) 98 |

    99 |
    100 |
    101 | 102 | 103 |

    Constructs a new octree helper.

    104 |
    105 |
    106 |
    108 | 109 | 110 |
    114 |
    115 |

    Member Summary

    116 | 117 | 118 | 119 | 120 | 127 | 143 | 147 | 148 | 149 |
    Public Members
    121 | public 122 | 123 | 124 | 125 | 126 | 128 |
    129 |

    130 | 131 | 132 | 133 | octree: Tree 134 |

    135 |
    136 |
    137 | 138 | 139 |

    The octree.

    140 |
    141 |
    142 |
    144 | 145 | 146 |
    150 | 151 | 152 | 153 | 154 | 155 | 162 | 178 | 182 | 183 | 184 |
    Protected Members
    156 | protected 157 | 158 | 159 | 160 | 161 | 163 |
    164 |

    165 | 166 | 167 | 168 | name: String 169 |

    170 |
    171 |
    172 | 173 | 174 |

    The name of this object.

    175 |
    176 |
    177 |
    179 | 180 | 181 |
    185 |
    186 |

    Method Summary

    187 | 188 | 189 | 190 | 191 | 198 | 214 | 218 | 219 | 220 | 227 | 243 | 247 | 248 | 249 |
    Public Methods
    192 | public 193 | 194 | 195 | 196 | 197 | 199 |
    200 |

    201 | 202 | 203 | 204 | dispose() 205 |

    206 |
    207 |
    208 | 209 | 210 |

    Destroys this helper.

    211 |
    212 |
    213 |
    215 | 216 | 217 |
    221 | public 222 | 223 | 224 | 225 | 226 | 228 |
    229 |

    230 | 231 | 232 | 233 | update() 234 |

    235 |
    236 |
    237 | 238 | 239 |

    Updates the helper geometry.

    240 |
    241 |
    242 |
    244 | 245 | 246 |
    250 |
    251 | 252 | 253 | 254 | 255 | 256 |

    Public Constructors

    257 | 258 |
    259 |

    260 | public 261 | 262 | 263 | 264 | 265 | 266 | constructor(octree: Tree) 267 | 268 | 269 | 270 | source 271 | 272 |

    273 | 274 | 275 | 276 | 277 |

    Constructs a new octree helper.

    278 |
    279 | 280 | 281 | 282 |
    283 |

    Params:

    284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 295 | 297 | 298 | 299 |
    NameTypeAttributeDescription
    octreeTree
    • optional
    • 294 |
    • default: null

    An octree.

    296 |
    300 |
    301 |
    302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 |
    320 |
    321 |

    Public Members

    322 | 323 |
    324 |

    325 | public 326 | 327 | 328 | 329 | 330 | 331 | octree: Tree 332 | 333 | 334 | 335 | source 336 | 337 |

    338 | 339 | 340 | 341 | 342 |

    The octree.

    343 |
    344 | 345 | 346 | 347 |
    348 |
    349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 |
    367 |

    Protected Members

    368 | 369 |
    370 |

    371 | protected 372 | 373 | 374 | 375 | 376 | 377 | name: String 378 | 379 | 380 | 381 | source 382 | 383 |

    384 | 385 | 386 | 387 | 388 |

    The name of this object.

    389 |
    390 | 391 | 392 | 393 |
    394 |
    395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 |
    413 |
    414 |

    Public Methods

    415 | 416 |
    417 |

    418 | public 419 | 420 | 421 | 422 | 423 | 424 | dispose() 425 | 426 | 427 | 428 | source 429 | 430 |

    431 | 432 | 433 | 434 | 435 |

    Destroys this helper.

    436 |
    437 | 438 | 439 | 440 |
    441 |
    442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 |
    460 |
    461 |

    462 | public 463 | 464 | 465 | 466 | 467 | 468 | update() 469 | 470 | 471 | 472 | source 473 | 474 |

    475 | 476 | 477 | 478 | 479 |

    Updates the helper geometry.

    480 |
    481 | 482 | 483 | 484 |
    485 |
    486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 |
    504 |
    505 |
    506 | 507 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | -------------------------------------------------------------------------------- /docs/script/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | !function(){/* 2 | 3 | Copyright (C) 2006 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | window.PR_SHOULD_USE_CONTINUATION=!0; 18 | (function(){function T(a){function d(e){var b=e.charCodeAt(0);if(92!==b)return b;var a=e.charAt(1);return(b=w[a])?b:"0"<=a&&"7">=a?parseInt(e.substring(1),8):"u"===a||"x"===a?parseInt(e.substring(2),16):e.charCodeAt(1)}function f(e){if(32>e)return(16>e?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[0-9A-Fa-f]{4}|\\x[0-9A-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\s\S]|-|[^-\\]/g);e= 19 | [];var a="^"===b[0],c=["["];a&&c.push("^");for(var a=a?1:0,g=b.length;ak||122k||90k||122h[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(f(h[1])));c.push("]");return c.join("")}function v(e){for(var a=e.source.match(/(?:\[(?:[^\x5C\x5D]|\\[\s\S])*\]|\\u[A-Fa-f0-9]{4}|\\x[A-Fa-f0-9]{2}|\\[0-9]+|\\[^ux0-9]|\(\?[:!=]|[\(\)\^]|[^\x5B\x5C\(\)\^]+)/g),c=a.length,d=[],g=0,h=0;g/,null])):d.push(["com",/^#[^\r\n]*/,null,"#"]));a.cStyleComments&&(f.push(["com",/^\/\/[^\r\n]*/,null]),f.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));if(b=a.regexLiterals){var v=(b=1|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+ 28 | ("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+v+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+v+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&f.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&f.push(["kwd",new RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),null]);d.push(["pln",/^\s+/,null," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");f.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i, 29 | null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(b),null]);return G(d,f)}function L(a,d,f){function b(a){var c=a.nodeType;if(1==c&&!A.test(a.className))if("br"===a.nodeName)v(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((3==c||4==c)&&f){var d=a.nodeValue,q=d.match(n);q&&(c=d.substring(0,q.index),a.nodeValue=c,(d=d.substring(q.index+q[0].length))&& 30 | a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),v(a),c||a.parentNode.removeChild(a))}}function v(a){function b(a,c){var d=c?a.cloneNode(!1):a,k=a.parentNode;if(k){var k=b(k,1),e=a.nextSibling;k.appendChild(d);for(var f=e;f;f=e)e=f.nextSibling,k.appendChild(f)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;a=b(a.nextSibling,0);for(var d;(d=a.parentNode)&&1===d.nodeType;)a=d;c.push(a)}for(var A=/(?:^|\s)nocode(?:\s|$)/,n=/\r\n?|\n/,l=a.ownerDocument,m=l.createElement("li");a.firstChild;)m.appendChild(a.firstChild); 31 | for(var c=[m],p=0;p=+v[1],d=/\n/g,A=a.a,n=A.length,f=0,l=a.c,m=l.length,b=0,c=a.g,p=c.length,w=0;c[p]=n;var r,e;for(e=r=0;e=h&&(b+=2);f>=k&&(w+=2)}}finally{g&&(g.style.display=a)}}catch(x){E.console&&console.log(x&&x.stack||x)}}var E=window,C=["break,continue,do,else,for,if,return,while"], 34 | F=[[C,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],H=[F,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"], 35 | O=[F,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],P=[F,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"], 36 | F=[F,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],Q=[C,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],R=[C,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],C=[C,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"], 37 | S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,W=/\S/,X=y({keywords:[H,P,O,F,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",Q,R,C],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),I={};t(X,["default-code"]);t(G([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),"default-markup htm html mxml xhtml xml xsl".split(" "));t(G([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null, 39 | "\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],["pun",/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);t(G([],[["atv",/^[\s\S]+/]]),["uq.val"]);t(y({keywords:H, 40 | hashComments:!0,cStyleComments:!0,types:S}),"c cc cpp cxx cyc m".split(" "));t(y({keywords:"null,true,false"}),["json"]);t(y({keywords:P,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),["cs"]);t(y({keywords:O,cStyleComments:!0}),["java"]);t(y({keywords:C,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);t(y({keywords:Q,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);t(y({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END", 41 | hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);t(y({keywords:R,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);t(y({keywords:F,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]);t(y({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0, 42 | regexLiterals:!0}),["coffee"]);t(G([],[["str",/^[\s\S]+/]]),["regex"]);var Y=E.PR={createSimpleLexer:G,registerLangHandler:t,sourceDecorator:y,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:E.prettyPrintOne=function(a,d,f){f=f||!1;d=d||null;var b=document.createElement("div");b.innerHTML="
    "+a+"
    "; 43 | b=b.firstChild;f&&L(b,f,!0);M({j:d,m:f,h:b,l:1,a:null,i:null,c:null,g:null});return b.innerHTML},prettyPrint:E.prettyPrint=function(a,d){function f(){for(var b=E.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p 0; --n) {\r\n\r\n\t\t\tlength += (octantCount < maxOctants) ? octantCount : maxOctants;\r\n\t\t\toctantCount -= maxOctants;\r\n\r\n\t\t\tvertexCount = length * 8;\r\n\t\t\tindices = new Uint16Array(vertexCount * 3);\r\n\t\t\tpositions = new Float32Array(vertexCount * 3);\r\n\r\n\t\t\t// Continue where the previous run left off.\r\n\t\t\tfor(c = 0, d = 0, result = octants.next(); !result.done && i < length;) {\r\n\r\n\t\t\t\toctant = result.value;\r\n\t\t\t\tmin = octant.min;\r\n\t\t\t\tmax = octant.max;\r\n\r\n\t\t\t\t// Create line connections based on the current vertex count.\r\n\t\t\t\tfor(j = 0; j < 12; ++j) {\r\n\r\n\t\t\t\t\tedge = edges[j];\r\n\r\n\t\t\t\t\tindices[d++] = c + edge[0];\r\n\t\t\t\t\tindices[d++] = c + edge[1];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Create the vertices.\r\n\t\t\t\tfor(j = 0; j < 8; ++j, ++c) {\r\n\r\n\t\t\t\t\tcorner = layout[j];\r\n\r\n\t\t\t\t\tpositions[c * 3] = (corner[0] === 0) ? min.x : max.x;\r\n\t\t\t\t\tpositions[c * 3 + 1] = (corner[1] === 0) ? min.y : max.y;\r\n\t\t\t\t\tpositions[c * 3 + 2] = (corner[2] === 0) ? min.z : max.z;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(++i < length) {\r\n\r\n\t\t\t\t\tresult = octants.next();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tgeometry = new BufferGeometry();\r\n\t\t\tgeometry.setIndex(new BufferAttribute(indices, 1));\r\n\t\t\tgeometry.setAttribute(\"position\", new BufferAttribute(positions, 3));\r\n\r\n\t\t\tgroup.add(new LineSegments(geometry, material));\r\n\r\n\t\t}\r\n\r\n\t\tthis.add(group);\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Updates the helper geometry.\r\n\t */\r\n\r\n\tupdate() {\r\n\r\n\t\tconst depth = (this.octree !== null) ? this.octree.getDepth() : -1;\r\n\r\n\t\tlet level = 0;\r\n\t\tlet result;\r\n\r\n\t\t// Remove existing geometry.\r\n\t\tthis.dispose();\r\n\r\n\t\twhile(level <= depth) {\r\n\r\n\t\t\tresult = this.octree.findNodesByLevel(level);\r\n\r\n\t\t\tthis.createLineSegments(\r\n\t\t\t\tresult[Symbol.iterator](),\r\n\t\t\t\t(typeof result.size === \"number\") ? result.size : result.length\r\n\t\t\t);\r\n\r\n\t\t\t++level;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * Destroys this helper.\r\n\t */\r\n\r\n\tdispose() {\r\n\r\n\t\tconst groups = this.children;\r\n\r\n\t\tlet group, children;\r\n\t\tlet i, j, il, jl;\r\n\r\n\t\tfor(i = 0, il = groups.length; i < il; ++i) {\r\n\r\n\t\t\tgroup = groups[i];\r\n\t\t\tchildren = group.children;\r\n\r\n\t\t\tfor(j = 0, jl = children.length; j < jl; ++j) {\r\n\r\n\t\t\t\tchildren[j].geometry.dispose();\r\n\t\t\t\tchildren[j].material.dispose();\r\n\r\n\t\t\t}\r\n\r\n\t\t\twhile(children.length > 0) {\r\n\r\n\t\t\t\tgroup.remove(children[0]);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\twhile(groups.length > 0) {\r\n\r\n\t\t\tthis.remove(groups[0]);\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n", 582 | "static": true, 583 | "longname": "D:/Sourcecode/JavaScript/octree-helper/src/OctreeHelper.js", 584 | "access": "public", 585 | "description": null, 586 | "lineNumber": 1 587 | }, 588 | { 589 | "__docId__": 50, 590 | "kind": "class", 591 | "name": "OctreeHelper", 592 | "memberof": "src/OctreeHelper.js", 593 | "static": true, 594 | "longname": "src/OctreeHelper.js~OctreeHelper", 595 | "access": "public", 596 | "export": true, 597 | "importPath": "octree-helper", 598 | "importStyle": "{OctreeHelper}", 599 | "description": "An octree helper.", 600 | "lineNumber": 15, 601 | "interface": false, 602 | "extends": [ 603 | "three~Group" 604 | ] 605 | }, 606 | { 607 | "__docId__": 51, 608 | "kind": "constructor", 609 | "name": "constructor", 610 | "memberof": "src/OctreeHelper.js~OctreeHelper", 611 | "generator": false, 612 | "async": false, 613 | "static": false, 614 | "longname": "src/OctreeHelper.js~OctreeHelper#constructor", 615 | "access": "public", 616 | "description": "Constructs a new octree helper.", 617 | "lineNumber": 23, 618 | "params": [ 619 | { 620 | "nullable": null, 621 | "types": [ 622 | "Tree" 623 | ], 624 | "spread": false, 625 | "optional": true, 626 | "defaultValue": "null", 627 | "defaultRaw": null, 628 | "name": "octree", 629 | "description": "An octree." 630 | } 631 | ] 632 | }, 633 | { 634 | "__docId__": 52, 635 | "kind": "member", 636 | "name": "name", 637 | "memberof": "src/OctreeHelper.js~OctreeHelper", 638 | "static": false, 639 | "longname": "src/OctreeHelper.js~OctreeHelper#name", 640 | "access": "protected", 641 | "description": "The name of this object.", 642 | "lineNumber": 34, 643 | "type": { 644 | "nullable": null, 645 | "types": [ 646 | "String" 647 | ], 648 | "spread": false, 649 | "description": null 650 | } 651 | }, 652 | { 653 | "__docId__": 53, 654 | "kind": "member", 655 | "name": "octree", 656 | "memberof": "src/OctreeHelper.js~OctreeHelper", 657 | "static": false, 658 | "longname": "src/OctreeHelper.js~OctreeHelper#octree", 659 | "access": "public", 660 | "description": "The octree.", 661 | "lineNumber": 42, 662 | "type": { 663 | "nullable": null, 664 | "types": [ 665 | "Tree" 666 | ], 667 | "spread": false, 668 | "description": null 669 | } 670 | }, 671 | { 672 | "__docId__": 54, 673 | "kind": "method", 674 | "name": "createLineSegments", 675 | "memberof": "src/OctreeHelper.js~OctreeHelper", 676 | "generator": false, 677 | "async": false, 678 | "static": false, 679 | "longname": "src/OctreeHelper.js~OctreeHelper#createLineSegments", 680 | "access": "private", 681 | "description": "Creates octant geometry.", 682 | "lineNumber": 56, 683 | "params": [ 684 | { 685 | "nullable": null, 686 | "types": [ 687 | "Iterator" 688 | ], 689 | "spread": false, 690 | "optional": false, 691 | "name": "octants", 692 | "description": "An octant iterator." 693 | }, 694 | { 695 | "nullable": null, 696 | "types": [ 697 | "Number" 698 | ], 699 | "spread": false, 700 | "optional": false, 701 | "name": "octantCount", 702 | "description": "The size of the given sequence." 703 | } 704 | ], 705 | "ignore": true, 706 | "return": null 707 | }, 708 | { 709 | "__docId__": 55, 710 | "kind": "method", 711 | "name": "update", 712 | "memberof": "src/OctreeHelper.js~OctreeHelper", 713 | "generator": false, 714 | "async": false, 715 | "static": false, 716 | "longname": "src/OctreeHelper.js~OctreeHelper#update", 717 | "access": "public", 718 | "description": "Updates the helper geometry.", 719 | "lineNumber": 138, 720 | "params": [], 721 | "return": null 722 | }, 723 | { 724 | "__docId__": 56, 725 | "kind": "method", 726 | "name": "dispose", 727 | "memberof": "src/OctreeHelper.js~OctreeHelper", 728 | "generator": false, 729 | "async": false, 730 | "static": false, 731 | "longname": "src/OctreeHelper.js~OctreeHelper#dispose", 732 | "access": "public", 733 | "description": "Destroys this helper.", 734 | "lineNumber": 167, 735 | "params": [], 736 | "return": null 737 | }, 738 | { 739 | "kind": "index", 740 | "content": "# Octree Helper\r\n\r\n[![Build status](https://travis-ci.org/vanruesc/octree-helper.svg?branch=master)](https://travis-ci.org/vanruesc/octree-helper) \r\n[![npm version](https://badgen.net/npm/v/octree-helper?color=green)](https://www.npmjs.com/package/octree-helper)\r\n[![Peer dependencies](https://david-dm.org/vanruesc/octree-helper/peer-status.svg)](https://david-dm.org/vanruesc/octree-helper?type=peer)\r\n\r\nAn octree visualization tool for [three.js](https://threejs.org/).\r\n\r\n*[Demo](https://vanruesc.github.io/sparse-octree/public/demo) · [Documentation](https://vanruesc.github.io/octree-helper/docs)*\r\n\r\n\r\n## Installation\r\n\r\nThis library requires the peer dependency [three](https://github.com/mrdoob/three.js/).\r\n\r\n```sh\r\nnpm install three octree-helper\r\n``` \r\n\r\n\r\n## Requirements\r\n\r\nThis helper can visualize any octree that conforms to the following protocols:\r\n\r\n- [Tree](https://vanruesc.github.io/sparse-octree/public/docs/class/src/core/Tree.js~Tree.html)\r\n- [Node](https://vanruesc.github.io/sparse-octree/public/docs/class/src/core/Node.js~Node.html)\r\n\r\n\r\n## Usage\r\n\r\nThe following example uses the [sparse-octree](https://github.com/vanruesc/sparse-octree) module.\r\n\r\n```javascript\r\nimport { Scene } from \"three\";\r\nimport { Octree } from \"sparse-octree\";\r\nimport { OctreeHelper } from \"octree-helper\";\r\n\r\nconst scene = new Scene();\r\nconst octree = new Octree();\r\nconst octreeHelper = new OctreeHelper(octree);\r\n\r\n// Render the helper.\r\nscene.add(octreeHelper);\r\n\r\n// Set a different octree.\r\noctreeHelper.octree = otherOctree;\r\n\r\n// Destroy the helper geometry and rebuild.\r\noctreeHelper.update();\r\n\r\n// Destroy the helper geometry.\r\noctreeHelper.dispose();\r\n```\r\n\r\n\r\n## Contributing\r\n\r\nMaintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.\r\n", 741 | "longname": "D:\\Sourcecode\\JavaScript\\octree-helper\\README.md", 742 | "name": "./README.md", 743 | "static": true, 744 | "access": "public" 745 | }, 746 | { 747 | "kind": "packageJSON", 748 | "content": "{\r\n\t\"name\": \"octree-helper\",\r\n\t\"version\": \"1.1.6\",\r\n\t\"description\": \"An octree visualization tool for three.js.\",\r\n\t\"homepage\": \"https://github.com/vanruesc/octree-helper\",\r\n\t\"main\": \"build/octree-helper.js\",\r\n\t\"module\": \"build/octree-helper.esm.js\",\r\n\t\"sideEffects\": false,\r\n\t\"license\": \"Zlib\",\r\n\t\"keywords\": [\r\n\t\t\"octree\",\r\n\t\t\"helper\",\r\n\t\t\"three.js\",\r\n\t\t\"3d\",\r\n\t\t\"geometry\",\r\n\t\t\"mesh\",\r\n\t\t\"render\",\r\n\t\t\"visualize\"\r\n\t],\r\n\t\"author\": {\r\n\t\t\"name\": \"Raoul van Rüschen\",\r\n\t\t\"email\": \"vanruesc@outlook.de\"\r\n\t},\r\n\t\"repository\": {\r\n\t\t\"type\": \"git\",\r\n\t\t\"url\": \"https://github.com/vanruesc/octree-helper.git\"\r\n\t},\r\n\t\"bugs\": {\r\n\t\t\"url\": \"https://github.com/vanruesc/octree-helper/issues\"\r\n\t},\r\n\t\"files\": [\r\n\t\t\"build\"\r\n\t],\r\n\t\"scripts\": {\r\n\t\t\"ava\": \"ava\",\r\n\t\t\"build\": \"rollup -c\",\r\n\t\t\"build:production\": \"cross-env NODE_ENV=production npm run build\",\r\n\t\t\"watch\": \"rollup -c -w\",\r\n\t\t\"doc\": \"rimraf docs && esdoc\",\r\n\t\t\"pretest\": \"npm run build:production\",\r\n\t\t\"test\": \"ava\",\r\n\t\t\"prepack\": \"npm test && npm run doc\"\r\n\t},\r\n\t\"ava\": {\r\n\t\t\"failFast\": true,\r\n\t\t\"files\": [\r\n\t\t\t\"test/**/*.js\"\r\n\t\t],\r\n\t\t\"require\": [\r\n\t\t\t\"esm\"\r\n\t\t]\r\n\t},\r\n\t\"eslintConfig\": {\r\n\t\t\"extends\": \"delta\"\r\n\t},\r\n\t\"dependencies\": {\r\n\t\t\"sparse-octree\": \"6.x.x\"\r\n\t},\r\n\t\"peerDependencies\": {\r\n\t\t\"three\": \">= 0.110.0 < 0.119.0\"\r\n\t},\r\n\t\"devDependencies\": {\r\n\t\t\"@babel/core\": \"7.x.x\",\r\n\t\t\"@babel/preset-env\": \"7.x.x\",\r\n\t\t\"@rollup/plugin-babel\": \"5.x.x\",\r\n\t\t\"@rollup/plugin-node-resolve\": \"8.x.x\",\r\n\t\t\"ava\": \"3.x.x\",\r\n\t\t\"cross-env\": \"7.x.x\",\r\n\t\t\"esdoc\": \"1.x.x\",\r\n\t\t\"esdoc-importpath-plugin\": \"1.x.x\",\r\n\t\t\"esdoc-standard-plugin\": \"1.x.x\",\r\n\t\t\"eslint-config-delta\": \"1.x.x\",\r\n\t\t\"esm\": \"3.x.x\",\r\n\t\t\"iterator-result\": \"1.x.x\",\r\n\t\t\"math-ds\": \"1.x.x\",\r\n\t\t\"rimraf\": \"3.x.x\",\r\n\t\t\"rollup\": \"2.x.x\",\r\n\t\t\"rollup-plugin-eslint\": \"6.x.x\",\r\n\t\t\"rollup-plugin-terser\": \"6.x.x\",\r\n\t\t\"three\": \"0.118.x\"\r\n\t}\r\n}\r\n", 749 | "longname": "D:\\Sourcecode\\JavaScript\\octree-helper\\package.json", 750 | "name": "package.json", 751 | "static": true, 752 | "access": "public" 753 | } 754 | ] --------------------------------------------------------------------------------