Skip to content

Commit ff6993d

Browse files
committed
Gitignore 'entwine' for locally hosted data capability. Don't alter relative EPT URLs.
1 parent 7861fda commit ff6993d

File tree

4 files changed

+27
-8
lines changed

4 files changed

+27
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
private/*
22
data/test.html
3+
entwine/
34

build/potree/potree.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -11391,8 +11391,12 @@ void main() {
1139111391
exports.lru.touch(node);
1139211392
this.highestLevelServed = Math.max(node.getLevel(), this.highestLevelServed);
1139311393

11394-
let doTraverse = (node.level % node.pcoGeometry.hierarchyStepSize) === 0 && node.hasChildren;
11395-
doTraverse = doTraverse || node.getLevel() === 0;
11394+
var geom = node.pcoGeometry;
11395+
var hierarchyStepSize = geom ? geom.hierarchyStepSize : 1;
11396+
11397+
var doTraverse = node.getLevel() === 0 ||
11398+
(node.level % hierarchyStepSize === 0 && node.hasChildren);
11399+
1139611400
if (doTraverse) {
1139711401
this.traverse(node);
1139811402
}
@@ -11456,7 +11460,7 @@ void main() {
1145611460
view[i * 3 + 0],
1145711461
view[i * 3 + 1],
1145811462
view[i * 3 + 2]);
11459-
11463+
1146011464
pos.applyMatrix4(matrix);
1146111465
let distance = Math.abs(segment.cutPlane.distanceToPoint(pos));
1146211466
let centerDistance = Math.abs(segment.halfPlane.distanceToPoint(pos));
@@ -11520,7 +11524,7 @@ void main() {
1152011524

1152111525
let start = new THREE.Vector3(segment.start.x, segment.start.y, bsWorld.center.z);
1152211526
let end = new THREE.Vector3(segment.end.x, segment.end.y, bsWorld.center.z);
11523-
11527+
1152411528
let closest = new THREE.Line3(start, end).closestPointToPoint(bsWorld.center, true, new THREE.Vector3());
1152511529
let distance = closest.distanceTo(bsWorld.center);
1152611530

@@ -11594,7 +11598,7 @@ void main() {
1159411598
for(let i = 0; i < accepted.length; i++){
1159511599

1159611600
let index = accepted[i];
11597-
11601+
1159811602
let start = index * numElements;
1159911603
let end = start + numElements;
1160011604
let sub = source.subarray(start, end);
@@ -21179,7 +21183,7 @@ ENDSEC
2117921183
let range = material.elevationRange;
2118021184

2118121185
panel.find('#lblHeightRange').html(`${range[0].toFixed(2)} to ${range[1].toFixed(2)}`);
21182-
panel.find('#sldHeightRang').slider({min: bMin, max: bMax, values: range});
21186+
panel.find('#sldHeightRange').slider({min: bMin, max: bMax, values: range});
2118321187
};
2118421188

2118521189
let updateIntensityRange = function () {

build/potree/potree.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/script.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ var normalizePath = (p) => {
309309

310310
if (!path.endsWith('ept.json')) {
311311
path = appendSlash(path) + 'ept.json';
312-
if (!path.startsWith('http')) path = 'http://' + path;
312+
if (!path.startsWith('http') && !path.startsWith('/')) {
313+
path = 'http://' + path;
314+
}
313315
}
314316

315317
name = path.replace('/ept.json', '').split('/').pop();
@@ -404,6 +406,18 @@ resources.forEach((p, i) => {
404406
if (pcs.every((v) => v)) {
405407
console.log('All point clouds loaded');
406408
init(resources.length == 1 ? name : null);
409+
410+
if (window.config.color &&
411+
window.config.color.length == resources.length) {
412+
var fromRgb = function(a) {
413+
a = a.map(v => v / 255)
414+
return { r: a[0], g: a[1], b: a[2] }
415+
}
416+
for (var c = 0; c < resources.length; ++c) {
417+
viewer.scene.pointclouds[c].material.color =
418+
fromRgb(window.config.color[c])
419+
}
420+
}
407421
}
408422
});
409423
});

0 commit comments

Comments
 (0)