Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
02eb3f6
examples(Potree2): add new exemples Potree2 3D with valid data //DO N…
ftoromanoff Nov 14, 2025
be00572
fix(PointCloudNode): fix id unicity for copc and ept nodes
ftoromanoff Mar 26, 2026
4e623e3
fix(PointCloudNode): use copy instead of clone
ftoromanoff Mar 4, 2026
36161e7
fix(OBB): fix ts
ftoromanoff Mar 26, 2026
43aa5fa
refactor(PointCloud): add OBBes to Group at Layer and not at Node
ftoromanoff Mar 26, 2026
2afe3a4
examples(Potree): add new data set v1.7 for sub hierarchy tests
ftoromanoff Mar 16, 2026
96ea4ca
refactor(PointCloud): load children instead of loadOctree (with conso…
ftoromanoff Feb 20, 2026
801a639
refactor(PointCloud): lasNodeBase.createChildren()
ftoromanoff Mar 3, 2026
eeb1c1a
refactor(PointCloud): add hierarchy to constructor
ftoromanoff Mar 6, 2026
7d7607d
test(potree2layerprocessing): fix linked with potree2node constructor…
ftoromanoff Mar 31, 2026
a3116f4
test(copc): update
ftoromanoff Mar 6, 2026
9d66e3e
refactor(test): unit test for PointCloudNode
ftoromanoff Mar 16, 2026
d82677d
refactor(PointCloudNode): add 'abstract' key word and move hierarchyI…
ftoromanoff Mar 16, 2026
1089846
refactor(PotreeNode): refactor for homogeneisation with Potree2Node
ftoromanoff Mar 16, 2026
07245cb
refactor(PointCloudNode): remove childIndex from PointCloudNode.add()
ftoromanoff Mar 18, 2026
0671d7e
refactor(PointCloudNode): move setOBBes() to PointCloudNode.js
ftoromanoff Mar 18, 2026
6d214e6
fix(VpcLayer): add with PointCloud Refactor
ftoromanoff Mar 20, 2026
639fd06
refactor(PointCloudNode): use Las methods for Potree
ftoromanoff Mar 23, 2026
e0f96a0
test(PointCloudNode): rewrite linked to refactor
ftoromanoff Mar 26, 2026
cb2f1ff
test(potreenode): to saush coverage
ftoromanoff Apr 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions examples/potree2_25d_map_Arene.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<html>
<head>
<title>Point Cloud Viewer</title>

<script type="importmap">
{
"imports": {
"itowns": "../dist/itowns.js",
"debug": "../dist/debug.js",
"LoadingScreen": "./jsm/GUI/LoadingScreen.js",
"itowns_widgets": "../dist/itowns_widgets.js",
"three": "https://unpkg.com/three@0.170.0/build/three.module.js",
"three/addons/": "https://unpkg.com/three@0.170.0/examples/jsm/",
"lil": "https://unpkg.com/lil-gui@0.19.2/dist/lil-gui.esm.min.js"
}
}
</script>

<style type="text/css">
#info {
color: #7ad7ff;
font-family: 'Open Sans', sans-serif;
position: absolute;
top: 0;
left: 0;
padding: 0.3rem;
background-color: #404040;
z-index: 1;
}
@media (max-width: 600px) {
#info,
.dg {
display: none;
}
}
</style>

<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/example.css">
<link rel="stylesheet" type="text/css" href="css/LoadingScreen.css">

<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="viewerDiv">
<div id="info"></div>
</div>

<script type="module">

import lil from 'lil';
import setupLoadingScreen from 'LoadingScreen';
import * as THREE from 'three';
import * as itowns from 'itowns';
import * as debug from 'debug';
import * as itowns_widgets from 'itowns_widgets';

// Define crs projection that we will use (taken from https://epsg.io/3946, Proj4js section)
itowns.CRS.defs('EPSG:2154', '+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');

const viewerDiv = document.getElementById('viewerDiv');
viewerDiv.style.display = 'block';

const debugGui = new lil();

const view = new itowns.View('EPSG:2154', viewerDiv);
const controls = new itowns.PlanarControls(view);
setupLoadingScreen(viewerDiv, view);
view.mainLoop.gfxEngine.renderer.setClearColor(0xcccccc);

// Configure Point Cloud layer
const source = new itowns.Potree2Source({
url: 'https://media.githubusercontent.com/media/itowns/iTowns2-sample-data/potreeData/pointclouds/potree2.0/Arene-1_L93/metadata.json',
crs: 'EPSG:2154',
});

const name = source.url.split('/').pop();
const potreeLayer = new itowns.Potree2Layer(name, {
source,
});

// point selection on double-click
function dblClickHandler(event) {
var pick = view.pickObjectsAt(event, 5, potreeLayer);

for (const p of pick) {
console.info('Selected point #' + p.index + ' in position (' +
p.object.position.x + ', ' +
p.object.position.y + ', ' +
p.object.position.z +
') in Points ' + p.object.layer.id);
}
}
view.domElement.addEventListener('dblclick', dblClickHandler);

function onLayerReady() {
var lookAt = potreeLayer.root.clampOBB.position;

var size = new THREE.Vector3();
potreeLayer.root.voxelOBB.box3D.getSize(size);
view.camera3D.far = 10.0 * size.length();

controls.groundLevel = potreeLayer.minElevationRange;
var corner = new THREE.Vector3(...potreeLayer.metadata.boundingBox.min);
var position = corner.clone().add(
size.multiply({ x: 0, y: 0, z: (size.x / size.z) })
);

view.camera3D.position.copy(position);
view.camera3D.lookAt(lookAt);
view.camera3D.updateProjectionMatrix();

view.notifyChange(view.camera3D);

// Add debug
debug.PointCloudDebug.initTools(view, potreeLayer, debugGui);

// update stats window
var info = document.getElementById('info');
view.addFrameRequester(itowns.MAIN_LOOP_EVENTS.AFTER_RENDER, () => {
info.textContent = potreeLayer.displayedCount.toLocaleString() + ' points';
});
}

view.addLayer(potreeLayer).then(onLayerReady);
window.view = view;
window.itowns = itowns;
window.THREE = THREE;
</script>
</body>
</html>

122 changes: 122 additions & 0 deletions examples/potree2_3d_map_Arene.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<html>
<head>
<title>Potree2 Point Cloud on globe</title>

<script type="importmap">
{
"imports": {
"itowns": "../dist/itowns.js",
"debug": "../dist/debug.js",
"lil": "https://unpkg.com/lil-gui@0.20.0/dist/lil-gui.esm.js",
"LoadingScreen": "./jsm/GUI/LoadingScreen.js",
"itowns_widgets": "../dist/itowns_widgets.js",
"three": "https://unpkg.com/three@0.182.0/build/three.module.js",
"three/addons/": "https://unpkg.com/three@0.182.0/examples/jsm/"
}
}
</script>

<style type="text/css">
#info {
color: #7ad7ff;
font-family: 'Open Sans', sans-serif;
position: absolute;
top: 0;
left: 0;
padding: 0.3rem;
background-color: #404040;
z-index: 1;
}

@media (max-width: 600px) {
#info,
.dg {
display: none;
}
}
</style>

<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/example.css">
<link rel="stylesheet" type="text/css" href="css/LoadingScreen.css">

<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div id="viewerDiv"></div>
<div id="info"></div>

<script type="module">

import lil from 'lil';
import setupLoadingScreen from 'LoadingScreen';
import * as THREE from 'three';
import * as itowns from 'itowns';
import * as debug from 'debug';
import * as itowns_widgets from 'itowns_widgets';

// Define crs projection that we will use (taken from https://epsg.io/3946, Proj4js section)
itowns.CRS.defs('EPSG:2154', '+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');

const viewerDiv = document.getElementById('viewerDiv');
viewerDiv.style.display = 'block';

const debugGui = new lil();


// view = new itowns.GlobeView(viewerDiv, placement, { handleCollision: false });
var view = new itowns.GlobeView(viewerDiv);
// setupLoadingScreen(viewerDiv, view);

itowns.Fetcher.json('./layers/JSONLayers/IGN_MNT_HIGHRES.json').then(function _(config) {
config.source = new itowns.WMTSSource(config.source);
var layer = new itowns.ElevationLayer(config.id, config);
view.addLayer(layer);
});
itowns.Fetcher.json('./layers/JSONLayers/Ortho.json').then(function _(config) {
config.source = new itowns.WMTSSource(config.source);
var layer = new itowns.ColorLayer(config.id, config);
view.addLayer(layer);
});

view.controls.minDistance = 20;

// Arene
const source = new itowns.Potree2Source({
url: 'https://media.githubusercontent.com/media/itowns/iTowns2-sample-data/potreeData/pointclouds/potree2.0/Arene-1_L93/metadata.json',
crs: 'EPSG:2154',
});

const name = source.url.split('/').pop();
const potreeLayer = new itowns.Potree2Layer(name, {
source,
});

function onLayerReady() {
var lookAt = potreeLayer.root.clampOBB.position;
var coordLookAt = new itowns.Coordinates(view.referenceCrs).setFromVector3(lookAt);

var size = new THREE.Vector3();
potreeLayer.root.voxelOBB.box3D.getSize(size);

view.controls.lookAtCoordinate({
coord: coordLookAt,
range: 2 * size.length(),
}, false);

// add GUI
debug.PointCloudDebug.initTools(view, potreeLayer, debugGui)

// update stats window
var info = document.getElementById('info');
view.addFrameRequester(itowns.MAIN_LOOP_EVENTS.AFTER_RENDER, () => {
info.textContent = potreeLayer.displayedCount.toLocaleString() + ' points';
});
}

itowns.View.prototype.addLayer.call(view, potreeLayer).then(onLayerReady);

</script>
</body>
</html>

24 changes: 20 additions & 4 deletions examples/potree_25d_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,27 @@
=> crs unknown. Most probaly a projection centered on the center of acquisition...
*/

itowns.CRS.defs("EPSG:25831","+proj=utm +zone=31 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs");
// itowns.CRS.defs("EPSG:25831","+proj=utm +zone=31 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs");
// const name = 'Sagrada Familia';
// const url = 'https://betaserver.icgc.cat/potree12/resources/pointclouds/templesagradafamilia/cloud.js';
// const crs = 'EPSG:25831';


// itowns.CRS.defs("EPSG:3947","+proj=lcc +lat_0=47 +lon_0=3 +lat_1=46.25 +lat_2=47.75 +x_0=1700000 +y_0=6200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs");
// const name = 'Orvault-Potree1_7-3947';
// const url = 'https://raw.githubusercontent.com/bloc-in-bloc/sample-datas/main/Orvault-Potree1_7-3947/cloud.js';
// const crs = 'EPSG:3947';

// const name = 'archeodev';
// const url = 'https://www.wild-lights.com/archeodev/Cotencher/pointclouds/index/cloud.js';
// const crs = 'EPSG:3857';// => crs unknown...


itowns.CRS.defs("EPSG:32755","+proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs +type=crs");
const name = 'Melbourne';
const url = 'https://raw.githubusercontent.com/masonproco/melbournePotree/f1a32efa243bd3c7a61f975e3c1155078ecf73d5/pointcloud/cloud.js';
const crs = 'EPSG:32755';

const name = 'Sagrada Familia';
const url = 'https://betaserver.icgc.cat/potree12/resources/pointclouds/templesagradafamilia/cloud.js';
const crs = 'EPSG:25831';

viewerDiv = document.getElementById('viewerDiv');
viewerDiv.style.display = 'block';
Expand Down
13 changes: 9 additions & 4 deletions examples/potree_3d_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,15 @@
const crs = 'EPSG:4978';
*/

itowns.CRS.defs("EPSG:25831","+proj=utm +zone=31 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs");
name = 'Sagrada Familia';
const url = 'https://betaserver.icgc.cat/potree12/resources/pointclouds/templesagradafamilia/cloud.js';
const crs = 'EPSG:25831';
// itowns.CRS.defs("EPSG:25831","+proj=utm +zone=31 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs");
// name = 'Sagrada Familia';
// const url = 'https://betaserver.icgc.cat/potree12/resources/pointclouds/templesagradafamilia/cloud.js';
// const crs = 'EPSG:25831';

itowns.CRS.defs("EPSG:32755","+proj=utm +zone=55 +south +datum=WGS84 +units=m +no_defs +type=crs");
const name = 'Melbourne';
const url = 'https://raw.githubusercontent.com/masonproco/melbournePotree/f1a32efa243bd3c7a61f975e3c1155078ecf73d5/pointcloud/cloud.js';
const crs = 'EPSG:32755';

// Configure Point Cloud layer
const potreeSource = new itowns.PotreeSource({
Expand Down
Loading
Loading