From 246650fa2b8cdcb18ba5441c400d4c3b4ef690f0 Mon Sep 17 00:00:00 2001 From: m-schuetz Date: Wed, 29 Jul 2020 15:22:35 +0200 Subject: [PATCH] fix demos; update readme; add showcase to readme --- README.md | 131 ++++++++++++++++++ examples/features_ca13.html | 2 +- examples/github.html | 215 +++++++++++++++++++++++++++++ examples/page.json | 20 +-- examples/resources/sorvilier.json | 4 + examples/showcase/dechen_cave.html | 10 +- package-lock.json | 13 ++ package.json | 3 +- src/tools/create_github_page.js | 66 ++++++--- src/tools/create_potree_page.js | 3 +- src/utils/Volume.js | 61 ++++---- 11 files changed, 465 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 5e2e8d2ac8..72e2f65332 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,137 @@ Copy the converted directory into <potreeDirectory>/pointclouds/data_conve +# Showcase + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
MatterhornRetzLake TahoeSorvilierGraveChowilla
+ +
+More + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
ChillerCoolerDechen CaveRuinsEclepensHeidentor
+ + + + + + + + + + + + + + + + + + + + + + + +
BuildingLDHILion HeadOverpassPielachpompei
+ + + + + + + + + + + + + + + + + + + + + + + +
SantoriniSkateparkSubsea Eq.Subsea Man.Westend PalaisWhitby
+ +
+ # Funding Potree is funded by a combination of research projects, companies and institutions. diff --git a/examples/features_ca13.html b/examples/features_ca13.html index 881869a33c..9fc61b6f6f 100644 --- a/examples/features_ca13.html +++ b/examples/features_ca13.html @@ -175,7 +175,7 @@ },{ "icon": Potree.resourcePath + "/icons/rgb.png", "onclick": function(){ - material.activeAttributeName = "RGBA"; + material.activeAttributeName = "rgba"; material.pointSizeType = Potree.PointSizeType.ADAPTIVE; viewer.setClipTask(Potree.ClipTask.HIGHLIGHT); } diff --git a/examples/github.html b/examples/github.html index 39727f2096..7684f2a3d2 100644 --- a/examples/github.html +++ b/examples/github.html @@ -1,4 +1,7 @@ + +

Examples

+ +
@@ -171,4 +174,216 @@
Cesium RetzCesium SorvilierCustom Sidebar SectionEmbedded IframeGradient Colors
+ +

Showcase

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
MatterhornRetzLake TahoeSorvilierGraveChowilla
+ + + + + + + + + + + + + + + + + + + + + + + +
ChillerCoolerDechen CaveRuinsEclepensHeidentor
+ + + + + + + + + + + + + + + + + + + + + + + +
BuildingLDHILion HeadOverpassPielachpompei
+ + + + + + + + + + + + + + + + + + + + + + + +
SantoriniSkateparkSubsea Eq.Subsea Man.Westend PalaisWhitby
+ +

Third Party Showcase

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
SITNEntwineBarcelonaBermuda 100
+ + + + + + + + + + + + + + + + + + + + + + + +
laspublishPointboxDublinAHN2Phoenix LidarTatsumi Dam
+ + + + + + + + + + + + + + + +
Wesmapping
\ No newline at end of file diff --git a/examples/page.json b/examples/page.json index 2a4bbb497c..808ae43412 100644 --- a/examples/page.json +++ b/examples/page.json @@ -42,40 +42,41 @@ {"thumb": "thumbnails/gradient_colors.png", "label": "Gradient Colors", "url": "gradient_colors.html"} ], "showcase": [ - {"thumb": "thumbnails/chiller.jpg", "label": "Chiller", "url": "showcase/chiller.html"}, + {"thumb": "thumbnails/matterhorn.jpg", "label": "Matterhorn", "url": "showcase/matterhorn.html"}, + {"thumb": "thumbnails/retz.jpg", "label": "Retz", "url": "showcase/retz.html"}, + {"thumb": "thumbnails/lake_tahoe.jpg", "label": "Lake Tahoe", "url": "showcase/lake_tahoe.html"}, + {"thumb": "thumbnails/vol_total.jpg", "label": "Sorvilier", "url": "showcase/sorvilier.html"}, + {"thumb": "thumbnails/grab_15.jpg", "label": "Grave", "url": "showcase/grab_15.html"}, {"thumb": "thumbnails/chowilla.jpg", "label": "Chowilla", "url": "showcase/tern_auscover_chowilla.html"}, + {"thumb": "thumbnails/chiller.jpg", "label": "Chiller", "url": "showcase/chiller.html"}, {"thumb": "thumbnails/cooler_tower.jpg", "label": "Cooler", "url": "showcase/cooler_tower.html"}, {"thumb": "thumbnails/dechen_cave.jpg", "label": "Dechen Cave", "url": "showcase/dechen_cave.html"}, {"thumb": "thumbnails/DoverMillRuins.jpg", "label": "Ruins", "url": "showcase/doverMillRuins.html"}, {"thumb": "thumbnails/eclepens.jpg", "label": "Eclepens", "url": "showcase/eclepens.html"}, - {"thumb": "thumbnails/grab_15.jpg", "label": "Grave", "url": "showcase/grab_15.html"}, {"thumb": "thumbnails/heidentor.jpg", "label": "Heidentor", "url": "showcase/heidentor.html"}, - {"thumb": "thumbnails/lake_tahoe.jpg", "label": "Lake Tahoe", "url": "showcase/lake_tahoe.html"}, {"thumb": "thumbnails/land_building.jpg", "label": "Building", "url": "showcase/land_building.html"}, {"thumb": "thumbnails/LDHI_module.jpg", "label": "LDHI", "url": "showcase/LDHI_module.html"}, - {"thumb": "thumbnails/lifeboat.jpg", "label": "Lifeboat", "url": "showcase/lifeboat.html"}, + // {"thumb": "thumbnails/lifeboat.jpg", "label": "Lifeboat", "url": "showcase/lifeboat.html"}, {"thumb": "thumbnails/lion_head.jpg", "label": "Lion Head", "url": "showcase/lion_head_simone_garagnani.html"}, - {"thumb": "thumbnails/matterhorn.jpg", "label": "Matterhorn", "url": "showcase/matterhorn.html"}, {"thumb": "thumbnails/overpass.jpg", "label": "Overpass", "url": "showcase/overpass.html"}, {"thumb": "thumbnails/pielach.jpg", "label": "Pielach", "url": "showcase/pielach.html"}, {"thumb": "thumbnails/pompei.jpg", "label": "pompei", "url": "showcase/pompei.html"}, - {"thumb": "thumbnails/retz.jpg", "label": "Retz", "url": "showcase/retz.html"}, {"thumb": "thumbnails/santorini.jpg", "label": "Santorini", "url": "showcase/santorini.html"}, {"thumb": "thumbnails/skatepark.jpg", "label": "Skatepark", "url": "showcase/skatepark.html"}, {"thumb": "thumbnails/subsea_equipment.jpg", "label": "Subsea Eq.", "url": "showcase/subsea_equipment.html"}, {"thumb": "thumbnails/subseamanifold.jpg", "label": "Subsea Man.", "url": "showcase/subsea_manifold.html"}, - {"thumb": "thumbnails/vol_total.jpg", "label": "Sorvilier", "url": "showcase/sorvilier.html"}, {"thumb": "thumbnails/westend_palais.jpg", "label": "Westend Palais", "url": "showcase/westend_palais.html"}, {"thumb": "thumbnails/whitby.jpg", "label": "Whitby", "url": "showcase/whitby.html"} ], "thirdparty": [ {"thumb": "third/sitn.jpg", "label": "SITN", "url": "https://sitn.ne.ch/lidar/"}, {"thumb": "third/entwine.jpg", "label": "Entwine", "url": "http://potree.entwine.io/"}, - {"thumb": "third/laspublish.jpg", "label": "laspublish", "url": "https://rapidlasso.com/laspublish/"}, + {"thumb": "third/hakea_macrorrhyncha.jpg", "label": "", "url": "http://files.digitisation.unimelb.edu.au/potree/pointclouds/hakea_macrorrhyncha.html"}, {"thumb": "third/icgc_barcelona.jpg", "label": "Barcelona", "url": "http://betaportal.icgc.cat/wordpress/sagrada_familia_eixample_3d/"}, {"thumb": "third/preikestolen.jpg", "label": "", "url": "https://www.linkedin.com/pulse/open-source-advent-21-partridge-potree-bj%C3%B8rn-ove-gr%C3%B8tan/?published=t"}, - {"thumb": "third/oklahoma_state_university.jpg", "label": "", "url": "http://geog.okstate.edu/users/mathews/potree/osuLib_nad.html"}, {"thumb": "third/bermuda100.jpg", "label": "Bermuda 100", "url": "http://bermuda100.ucsd.edu/mary-celestia/index.php"}, + // {"thumb": "third/oklahoma_state_university.jpg", "label": "", "url": "http://geog.okstate.edu/users/mathews/potree/osuLib_nad.html"}, + {"thumb": "third/laspublish.jpg", "label": "laspublish", "url": "https://rapidlasso.com/laspublish/"}, {"thumb": "third/pointbox.jpg", "label": "Pointbox", "url": "https://www.pointbox.xyz/"}, {"thumb": "third/dublin.jpg", "label": "Dublin", "url": "https://digital.ucd.ie/view/ucdlib:30462"}, {"thumb": "third/AHN2.jpg", "label": "AHN2", "url": "http://ahn2.pointclouds.nl/"}, @@ -84,7 +85,6 @@ {"thumb": "third/ara.jpg", "label": "", "url": "http://www.airborneresearch.com.au/potree/ironbank1/examples/ironbank1.html"}, {"thumb": "third/goldmine.jpg", "label": "", "url": "https://digitalreality.ethz.ch/goldmine/"}, {"thumb": "third/ricketts_sanctuary.jpg", "label": "", "url": "http://files.digitisation.unimelb.edu.au/potree/pointclouds/ricketts-test2.html"}, - {"thumb": "third/hakea_macrorrhyncha.jpg", "label": "", "url": "http://files.digitisation.unimelb.edu.au/potree/pointclouds/hakea_macrorrhyncha.html"}, {"thumb": "third/wesmapping_grand_canyon.jpg", "label": "Wesmapping", "url": "http://wesmapping.com/blog/3d-visualization-of-the-grand-canyon-with-potree/"} ] } \ No newline at end of file diff --git a/examples/resources/sorvilier.json b/examples/resources/sorvilier.json index 2d2fbca56b..e4699c887e 100644 --- a/examples/resources/sorvilier.json +++ b/examples/resources/sorvilier.json @@ -195,6 +195,7 @@ "closed": false, "showAngles": false, "showHeight": false, + "showEdges": true, "color": [ 1, 0, @@ -227,6 +228,7 @@ "closed": true, "showAngles": true, "showHeight": false, + "showEdges": true, "color": [ 1, 0, @@ -276,6 +278,7 @@ "closed": false, "showAngles": false, "showHeight": true, + "showEdges": true, "color": [ 1, 0, @@ -313,6 +316,7 @@ "closed": true, "showAngles": false, "showHeight": false, + "showEdges": true, "color": [ 1, 0, diff --git a/examples/showcase/dechen_cave.html b/examples/showcase/dechen_cave.html index 874913618b..3960663a27 100644 --- a/examples/showcase/dechen_cave.html +++ b/examples/showcase/dechen_cave.html @@ -61,7 +61,7 @@ viewer.toggleSidebar(); $('#sldPointBudget').slider({ - max: 3 * 1000 * 1000, + max: 3_000_000, step: 1000, }); }); @@ -79,14 +79,16 @@ scene.addPointCloud(pointcloud); - let volume = new Potree.Volume(); + let volume = new Potree.BoxVolume(); volume.position.set(18.11, 14.94, 1.50); volume.scale.set(28.08, 19.07, 4.41); volume.clip = true; scene.addVolume(volume); - scene.view.position.set(5.69, 15.51, 10.62); - scene.view.lookAt(15.80, 15.27, 0.72); + scene.view.setView( + [5.69, 15.51, 10.62], + [15.80, 15.27, 0.72], + ); }); diff --git a/package-lock.json b/package-lock.json index c64b068aa7..fc5de7b0f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1555,6 +1555,14 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "requires": { + "minimist": "^1.2.5" + } + }, "just-debounce": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/just-debounce/-/just-debounce-1.0.0.tgz", @@ -1734,6 +1742,11 @@ "brace-expansion": "^1.1.7" } }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, "mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", diff --git a/package.json b/package.json index 92ab168409..ebda446e71 100644 --- a/package.json +++ b/package.json @@ -19,12 +19,13 @@ "scripts": { "start": "gulp watch", "build": "gulp build pack", - "postinstall": "npm run build" + "postinstall": "npm run build" }, "dependencies": { "gulp": "^4.0.2", "gulp-concat": "^2.6.1", "gulp-connect": "^5.7.0", + "json5": "^2.1.3", "rollup": "^1.31.1", "through": "~2.3.4" }, diff --git a/src/tools/create_github_page.js b/src/tools/create_github_page.js index 133177f125..1fc1868e35 100644 --- a/src/tools/create_github_page.js +++ b/src/tools/create_github_page.js @@ -2,21 +2,14 @@ const path = require('path'); const fs = require("fs"); const fsp = fs.promises; +const JSON5 = require('json5'); +function toCode(files, data){ -async function createGithubPage(){ - const content = await fsp.readFile("./examples/page.json", 'utf8'); - const settings = JSON.parse(content); - - const files = await fsp.readdir("./examples"); - - let unhandledCode = ``; - let exampleCode = ``; - let showcaseCode = ``; - let thirdpartyCode = ``; + let code = ""; { - let urls = settings.examples.map(e => e.url); + let urls = data.map(e => e.url); let unhandled = []; for(let file of files){ let isHandled = false; @@ -36,16 +29,16 @@ async function createGithubPage(){ .filter(file => file !== "page.html"); - for(let file of unhandled){ - unhandledCode += ` - ${file} - `; - } + // for(let file of unhandled){ + // unhandledCode += ` + // ${file} + // `; + // } } const rows = []; let row = []; - for(let example of settings.examples){ + for(let example of data){ row.push(example); if(row.length >= 6){ @@ -61,9 +54,13 @@ async function createGithubPage(){ let labels = ""; for(let example of row){ + + let url = example.url.startsWith("http") ? + example.url : + `http://potree.org/potree/examples/${example.url}`; thumbnails += ` - + `; @@ -71,7 +68,7 @@ async function createGithubPage(){ labels += `${example.label}`; } - exampleCode += ` + code += ` ${thumbnails} @@ -79,9 +76,40 @@ async function createGithubPage(){ `; } + return code; +} + + +async function createGithubPage(){ + const content = await fsp.readFile("./examples/page.json", 'utf8'); + const settings = JSON5.parse(content); + + const files = await fsp.readdir("./examples"); + + let unhandledCode = ``; + + let exampleCode = toCode(files, settings.examples); + let showcaseCode = toCode(files, settings.showcase); + let thirdpartyCode = toCode(files, settings.thirdparty); + let page = ` + +

Examples

+ ${exampleCode} +
+ +

Showcase

+ + + ${showcaseCode} +
+ +

Third Party Showcase

+ + + ${thirdpartyCode}
`; fs.writeFile(`examples/github.html`, page, (err) => { diff --git a/src/tools/create_potree_page.js b/src/tools/create_potree_page.js index 906d5c692e..753f2313c3 100644 --- a/src/tools/create_potree_page.js +++ b/src/tools/create_potree_page.js @@ -2,12 +2,13 @@ const path = require('path'); const fs = require("fs"); const fsp = fs.promises; +const JSON5 = require('json5'); async function createExamplesPage(){ const content = await fsp.readFile("./examples/page.json", 'utf8'); - const settings = JSON.parse(content); + const settings = JSON5.parse(content); const files = await fsp.readdir("./examples"); diff --git a/src/utils/Volume.js b/src/utils/Volume.js index f50910a50f..fea60d70fd 100644 --- a/src/utils/Volume.js +++ b/src/utils/Volume.js @@ -115,33 +115,40 @@ export class BoxVolume extends Volume{ let boxFrameGeometry = new THREE.Geometry(); { - // bottom - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, -0.5, 0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, -0.5, 0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, -0.5, 0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, -0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, -0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, -0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, -0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, -0.5, 0.5)); - // top - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, 0.5, 0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, 0.5, 0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, 0.5, 0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, 0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, 0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, 0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, 0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, 0.5, 0.5)); - // sides - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, -0.5, 0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, 0.5, 0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, -0.5, 0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, 0.5, 0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, -0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(0.5, 0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, -0.5, -0.5)); - boxFrameGeometry.vertices.push(new THREE.Vector3(-0.5, 0.5, -0.5)); + let Vector3 = THREE.Vector3; + + boxFrameGeometry.vertices.push( + + // bottom + new Vector3(-0.5, -0.5, 0.5), + new Vector3(0.5, -0.5, 0.5), + new Vector3(0.5, -0.5, 0.5), + new Vector3(0.5, -0.5, -0.5), + new Vector3(0.5, -0.5, -0.5), + new Vector3(-0.5, -0.5, -0.5), + new Vector3(-0.5, -0.5, -0.5), + new Vector3(-0.5, -0.5, 0.5), + // top + new Vector3(-0.5, 0.5, 0.5), + new Vector3(0.5, 0.5, 0.5), + new Vector3(0.5, 0.5, 0.5), + new Vector3(0.5, 0.5, -0.5), + new Vector3(0.5, 0.5, -0.5), + new Vector3(-0.5, 0.5, -0.5), + new Vector3(-0.5, 0.5, -0.5), + new Vector3(-0.5, 0.5, 0.5), + // sides + new Vector3(-0.5, -0.5, 0.5), + new Vector3(-0.5, 0.5, 0.5), + new Vector3(0.5, -0.5, 0.5), + new Vector3(0.5, 0.5, 0.5), + new Vector3(0.5, -0.5, -0.5), + new Vector3(0.5, 0.5, -0.5), + new Vector3(-0.5, -0.5, -0.5), + new Vector3(-0.5, 0.5, -0.5), + + ); + } this.material = new THREE.MeshBasicMaterial({