itowns 2.42.1-next.10 → 2.42.1-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.map +1 -1
- package/examples/source_stream_wfs_25d.html +11 -11
- package/examples/source_stream_wfs_3d.html +1 -1
- package/examples/view_25d_map.html +2 -2
- package/examples/view_3d_map.html +2 -2
- package/examples/view_3d_mns_map.html +2 -2
- package/examples/view_immersive.html +1 -1
- package/examples/widgets_searchbar.html +2 -2
- package/lib/Converter/convertToTile.js +3 -2
- package/lib/Core/Prefab/TileBuilder.js +1 -1
- package/lib/Core/Prefab/computeBufferTileGeometry.js +10 -5
- package/lib/Core/TileGeometry.js +8 -2
- package/lib/Layer/EntwinePointTileLayer.js +1 -0
- package/lib/Layer/TiledGeometryLayer.js +16 -2
- package/lib/Parser/LASLoader.js +8 -4
- package/lib/Parser/LASParser.js +1 -0
- package/lib/Parser/PotreeBinParser.js +5 -5
- package/lib/Provider/PointCloudProvider.js +2 -4
- package/lib/Renderer/OBB.js +2 -2
- package/package.json +1 -1
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
var wfsCartoSource = new itowns.WFSSource({
|
|
274
274
|
url: 'https://data.geopf.fr/wfs/ows?',
|
|
275
275
|
version: '2.0.0',
|
|
276
|
-
typeName: '
|
|
276
|
+
typeName: 'BDCARTO_V5:zone_d_habitation',
|
|
277
277
|
crs: 'EPSG:3946',
|
|
278
278
|
ipr: 'IGN',
|
|
279
279
|
format: 'application/json',
|
|
@@ -284,24 +284,24 @@
|
|
|
284
284
|
text: {
|
|
285
285
|
field: '{toponyme}',
|
|
286
286
|
color: (p) => {
|
|
287
|
-
switch (p.
|
|
288
|
-
case 'Quartier
|
|
289
|
-
return 'Cornsilk';
|
|
290
|
-
case 'Hameau':
|
|
287
|
+
switch (p.nature) {
|
|
288
|
+
case 'Quartier':
|
|
291
289
|
return 'WhiteSmoke';
|
|
292
|
-
case '
|
|
290
|
+
case 'Château':
|
|
291
|
+
return 'Cornsilk';
|
|
292
|
+
case 'Lieu-dit habité':
|
|
293
293
|
default:
|
|
294
294
|
return 'white';
|
|
295
295
|
}
|
|
296
296
|
},
|
|
297
297
|
transform: 'uppercase',
|
|
298
298
|
size: (p) => {
|
|
299
|
-
switch (p.
|
|
300
|
-
case 'Quartier
|
|
301
|
-
return 11;
|
|
302
|
-
case 'Hameau':
|
|
299
|
+
switch (p.nature) {
|
|
300
|
+
case 'Quartier':
|
|
303
301
|
return 13;
|
|
304
|
-
case '
|
|
302
|
+
case 'Château':
|
|
303
|
+
return 11;
|
|
304
|
+
case 'Lieu-dit habité':
|
|
305
305
|
default:
|
|
306
306
|
return 18;
|
|
307
307
|
}
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
view.addFrameRequester(itowns.MAIN_LOOP_EVENTS.BEFORE_RENDER, scaler);
|
|
176
176
|
|
|
177
177
|
var wfsBuildingSource = new itowns.WFSSource({
|
|
178
|
-
url: 'https://
|
|
178
|
+
url: 'https://data.geopf.fr/wfs/ows?',
|
|
179
179
|
version: '2.0.0',
|
|
180
180
|
typeName: 'BDTOPO_V3:batiment',
|
|
181
181
|
crs: 'EPSG:4326',
|
|
@@ -98,9 +98,9 @@
|
|
|
98
98
|
view.addLayer(wmsElevationLayer);
|
|
99
99
|
|
|
100
100
|
var wfsCartoSource = new itowns.WFSSource({
|
|
101
|
-
url: 'https://
|
|
101
|
+
url: 'https://data.geopf.fr/wfs/ows?',
|
|
102
102
|
version: '2.0.0',
|
|
103
|
-
typeName: '
|
|
103
|
+
typeName: 'BDCARTO_V5:zone_d_habitation',
|
|
104
104
|
crs: 'EPSG:3946',
|
|
105
105
|
ipr: 'IGN',
|
|
106
106
|
format: 'application/json',
|
|
@@ -110,8 +110,8 @@
|
|
|
110
110
|
// Define options for geocoding service that should be used by the searchbar.
|
|
111
111
|
const geocodingOptions = {
|
|
112
112
|
url: new URL(
|
|
113
|
-
'https://
|
|
114
|
-
'PositionOfInterest',
|
|
113
|
+
'https://data.geopf.fr/geocodage/completion?' +
|
|
114
|
+
'text=&type=StreetAddress,PositionOfInterest',
|
|
115
115
|
),
|
|
116
116
|
parser: (response) => {
|
|
117
117
|
const map = new Map();
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
// Define options for geocoding service that should be used by the searchbar.
|
|
110
110
|
const geocodingOptions = {
|
|
111
111
|
url: new URL(
|
|
112
|
-
'https://
|
|
113
|
-
'PositionOfInterest',
|
|
112
|
+
'https://data.geopf.fr/geocodage/completion?' +
|
|
113
|
+
'text=&type=StreetAddress,PositionOfInterest',
|
|
114
114
|
),
|
|
115
115
|
parser: (response) => {
|
|
116
116
|
const map = new Map();
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
view.addLayer(olayer, view.tileLayer).then(function addWfsLayer(orientedImageLayer) {
|
|
118
118
|
// prepare WFS source for the buildings
|
|
119
119
|
var wfsBuildingSource = new itowns.WFSSource({
|
|
120
|
-
url: 'https://
|
|
120
|
+
url: 'https://data.geopf.fr/wfs/ows?',
|
|
121
121
|
version: '2.0.0',
|
|
122
122
|
typeName: 'BDTOPO_V3:batiment',
|
|
123
123
|
crs: 'EPSG:4326',
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
// Define options for geocoding service that should be used by the searchbar.
|
|
89
89
|
const geocodingOptions = {
|
|
90
90
|
url: new URL(
|
|
91
|
-
'https://
|
|
92
|
-
'PositionOfInterest',
|
|
91
|
+
'https://data.geopf.fr/geocodage/completion?' +
|
|
92
|
+
'text=&type=StreetAddress,PositionOfInterest',
|
|
93
93
|
),
|
|
94
94
|
// As precised in the doc (http://www.itowns-project.org/itowns/docs/#api/Widgets/Searchbar), the parser
|
|
95
95
|
// method must parse the geocoding service response into a Map object. For each item of this Map, the
|
|
@@ -46,8 +46,9 @@ var _default = {
|
|
|
46
46
|
const paramsGeometry = {
|
|
47
47
|
extent,
|
|
48
48
|
level,
|
|
49
|
-
|
|
50
|
-
disableSkirt: layer.disableSkirt
|
|
49
|
+
segments: layer.segments || 16,
|
|
50
|
+
disableSkirt: layer.disableSkirt,
|
|
51
|
+
hideSkirt: layer.hideSkirt
|
|
51
52
|
};
|
|
52
53
|
return (0, _TileBuilder.default)(builder, paramsGeometry).then(result => {
|
|
53
54
|
// build tile mesh
|
|
@@ -21,7 +21,7 @@ function newTileGeometry(builder, params) {
|
|
|
21
21
|
position
|
|
22
22
|
} = builder.computeSharableExtent(params.extent);
|
|
23
23
|
const south = sharableExtent.south.toFixed(6);
|
|
24
|
-
const bufferKey = `${builder.crs}_${params.disableSkirt ? 0 : 1}_${params.
|
|
24
|
+
const bufferKey = `${builder.crs}_${params.disableSkirt ? 0 : 1}_${params.segments}`;
|
|
25
25
|
let promiseGeometry = cacheTile.get(south, params.level, bufferKey);
|
|
26
26
|
|
|
27
27
|
// build geometry if doesn't exist
|
|
@@ -4,9 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = computeBuffers;
|
|
7
|
+
exports.getBufferIndexSize = getBufferIndexSize;
|
|
7
8
|
var THREE = _interopRequireWildcard(require("three"));
|
|
8
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
function getBufferIndexSize(segments, noSkirt) {
|
|
12
|
+
const triangles = segments * segments * 2 + (noSkirt ? 0 : 4 * segments * 2);
|
|
13
|
+
return triangles * 3;
|
|
14
|
+
}
|
|
10
15
|
function computeBuffers(params) {
|
|
11
16
|
// Create output buffers.
|
|
12
17
|
const outBuffers = {
|
|
@@ -32,7 +37,7 @@ function computeBuffers(params) {
|
|
|
32
37
|
};
|
|
33
38
|
const computeUvs = [];
|
|
34
39
|
const builder = params.builder;
|
|
35
|
-
const nSeg = params.
|
|
40
|
+
const nSeg = params.segments;
|
|
36
41
|
// segments count :
|
|
37
42
|
// Tile : (nSeg + 1) * (nSeg + 1)
|
|
38
43
|
// Skirt : 8 * (nSeg - 1)
|
|
@@ -40,7 +45,6 @@ function computeBuffers(params) {
|
|
|
40
45
|
if (nVertex > 2 ** 32) {
|
|
41
46
|
throw new Error('Tile segments count is too big');
|
|
42
47
|
}
|
|
43
|
-
const triangles = nSeg * nSeg * 2 + (params.disableSkirt ? 0 : 4 * nSeg * 2);
|
|
44
48
|
outBuffers.position = new Float32Array(nVertex * 3);
|
|
45
49
|
outBuffers.normal = new Float32Array(nVertex * 3);
|
|
46
50
|
const uvCount = params.builder.uvCount;
|
|
@@ -48,13 +52,14 @@ function computeBuffers(params) {
|
|
|
48
52
|
outBuffers.uvs[1] = new Float32Array(nVertex);
|
|
49
53
|
}
|
|
50
54
|
computeUvs[0] = () => {};
|
|
55
|
+
const bufferIndexSize = getBufferIndexSize(nSeg, params.disableSkirt);
|
|
51
56
|
if (params.buildIndexAndUv_0) {
|
|
52
57
|
if (nVertex < 2 ** 8) {
|
|
53
|
-
outBuffers.index = new Uint8Array(
|
|
58
|
+
outBuffers.index = new Uint8Array(bufferIndexSize);
|
|
54
59
|
} else if (nVertex < 2 ** 16) {
|
|
55
|
-
outBuffers.index = new Uint16Array(
|
|
60
|
+
outBuffers.index = new Uint16Array(bufferIndexSize);
|
|
56
61
|
} else if (nVertex < 2 ** 32) {
|
|
57
|
-
outBuffers.index = new Uint32Array(
|
|
62
|
+
outBuffers.index = new Uint32Array(bufferIndexSize);
|
|
58
63
|
}
|
|
59
64
|
outBuffers.uvs[0] = new Float32Array(nVertex * 2);
|
|
60
65
|
computeUvs[0] = (id, u, v) => {
|
package/lib/Core/TileGeometry.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _computeBufferTileGeometry =
|
|
8
|
+
var _computeBufferTileGeometry = _interopRequireWildcard(require("./Prefab/computeBufferTileGeometry"));
|
|
10
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
11
|
function defaultBuffers(params) {
|
|
@@ -28,6 +27,7 @@ class TileGeometry extends THREE.BufferGeometry {
|
|
|
28
27
|
super();
|
|
29
28
|
this.center = params.center;
|
|
30
29
|
this.extent = params.extent;
|
|
30
|
+
this.segments = params.segments;
|
|
31
31
|
this.setIndex(buffers.index);
|
|
32
32
|
this.setAttribute('position', buffers.position);
|
|
33
33
|
this.setAttribute('normal', buffers.normal);
|
|
@@ -36,6 +36,12 @@ class TileGeometry extends THREE.BufferGeometry {
|
|
|
36
36
|
}
|
|
37
37
|
this.computeBoundingBox();
|
|
38
38
|
this.OBB = {};
|
|
39
|
+
if (params.hideSkirt) {
|
|
40
|
+
this.hideSkirt = params.hideSkirt;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
set hideSkirt(value) {
|
|
44
|
+
this.setDrawRange(0, (0, _computeBufferTileGeometry.getBufferIndexSize)(this.segments, value));
|
|
39
45
|
}
|
|
40
46
|
}
|
|
41
47
|
var _default = TileGeometry;
|
|
@@ -55,6 +55,7 @@ class EntwinePointTileLayer extends _PointCloudLayer.default {
|
|
|
55
55
|
constructor(id, config) {
|
|
56
56
|
super(id, config);
|
|
57
57
|
this.isEntwinePointTileLayer = true;
|
|
58
|
+
this.scale = new THREE.Vector3(1, 1, 1);
|
|
58
59
|
const resolve = this.addInitializationStep();
|
|
59
60
|
this.whenReady = this.source.whenReady.then(() => {
|
|
60
61
|
this.root = new _EntwinePointTileNode.default(0, 0, 0, 0, this, -1);
|
|
@@ -24,7 +24,8 @@ const boundingSphereCenter = new THREE.Vector3();
|
|
|
24
24
|
* @property {boolean} isTiledGeometryLayer - Used to checkout whether this
|
|
25
25
|
* layer is a TiledGeometryLayer. Default is true. You should not change this,
|
|
26
26
|
* as it is used internally for optimisation.
|
|
27
|
-
*
|
|
27
|
+
* @property {boolean} hideSkirt (default false) - Used to hide the skirt (tile borders).
|
|
28
|
+
* Useful when the layer opacity < 1
|
|
28
29
|
*/
|
|
29
30
|
class TiledGeometryLayer extends _GeometryLayer.default {
|
|
30
31
|
/**
|
|
@@ -76,6 +77,7 @@ class TiledGeometryLayer extends _GeometryLayer.default {
|
|
|
76
77
|
// TODO : this should be add in a preprocess method specific to GeoidLayer.
|
|
77
78
|
this.object3d.geoidHeight = 0;
|
|
78
79
|
this.protocol = 'tile';
|
|
80
|
+
this._hideSkirt = false;
|
|
79
81
|
this.sseSubdivisionThreshold = this.sseSubdivisionThreshold || 1.0;
|
|
80
82
|
this.schemeTile = schemeTile;
|
|
81
83
|
this.builder = builder;
|
|
@@ -98,7 +100,19 @@ class TiledGeometryLayer extends _GeometryLayer.default {
|
|
|
98
100
|
}));
|
|
99
101
|
this.maxScreenSizeNode = this.sseSubdivisionThreshold * (_LayeredMaterialNodeProcessing.SIZE_DIAGONAL_TEXTURE * 2);
|
|
100
102
|
}
|
|
101
|
-
|
|
103
|
+
get hideSkirt() {
|
|
104
|
+
return this._hideSkirt;
|
|
105
|
+
}
|
|
106
|
+
set hideSkirt(value) {
|
|
107
|
+
this._hideSkirt = value;
|
|
108
|
+
for (const node of this.level0Nodes) {
|
|
109
|
+
node.traverse(obj => {
|
|
110
|
+
if (obj.isTileMesh) {
|
|
111
|
+
obj.geometry.hideSkirt = value;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
102
116
|
/**
|
|
103
117
|
* Picking method for this layer. It uses the {@link Picking#pickTilesAt}
|
|
104
118
|
* method.
|
package/lib/Parser/LASLoader.js
CHANGED
|
@@ -67,13 +67,16 @@ class LASLoader {
|
|
|
67
67
|
The copc.js library does the degree convertion and stores it as a `Float32`.
|
|
68
68
|
*/
|
|
69
69
|
const scanAngles = new Float32Array(view.pointCount);
|
|
70
|
+
|
|
71
|
+
// For precision we take the first point that will be use as origin for a local referentiel.
|
|
72
|
+
const origin = getPosition.map(f => f(0)).map(val => Math.floor(val));
|
|
70
73
|
for (let i = 0; i < view.pointCount; i++) {
|
|
71
74
|
// `getPosition` apply scale and offset transform to the X, Y, Z
|
|
72
75
|
// values. See https://github.com/connormanning/copc.js/blob/master/src/las/extractor.ts.
|
|
73
76
|
const [x, y, z] = getPosition.map(f => f(i));
|
|
74
|
-
positions[i * 3] = x;
|
|
75
|
-
positions[i * 3 + 1] = y;
|
|
76
|
-
positions[i * 3 + 2] = z;
|
|
77
|
+
positions[i * 3] = x - origin[0];
|
|
78
|
+
positions[i * 3 + 1] = y - origin[1];
|
|
79
|
+
positions[i * 3 + 2] = z - origin[2];
|
|
77
80
|
intensities[i] = getIntensity(i);
|
|
78
81
|
returnNumbers[i] = getReturnNumber(i);
|
|
79
82
|
numberOfReturns[i] = getNumberOfReturns(i);
|
|
@@ -104,7 +107,8 @@ class LASLoader {
|
|
|
104
107
|
classification: classifications,
|
|
105
108
|
pointSourceID: pointSourceIDs,
|
|
106
109
|
color: colors,
|
|
107
|
-
scanAngle: scanAngles
|
|
110
|
+
scanAngle: scanAngles,
|
|
111
|
+
origin
|
|
108
112
|
};
|
|
109
113
|
}
|
|
110
114
|
|
package/lib/Parser/LASParser.js
CHANGED
|
@@ -75,6 +75,7 @@ var _default = {
|
|
|
75
75
|
const scanAngle = new THREE.BufferAttribute(attributes.scanAngle, 1);
|
|
76
76
|
geometry.setAttribute('scanAngle', scanAngle);
|
|
77
77
|
geometry.computeBoundingBox();
|
|
78
|
+
geometry.userData.origin = new THREE.Vector3().fromArray(attributes.origin);
|
|
78
79
|
return geometry;
|
|
79
80
|
});
|
|
80
81
|
}
|
|
@@ -9,7 +9,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
9
9
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
10
|
// See the different constants holding ordinal, name, numElements, byteSize in PointAttributes.cpp in PotreeConverter
|
|
11
11
|
// elementByteSize is byteSize / numElements
|
|
12
|
-
const
|
|
12
|
+
const POINT_ATTRIBUTES = {
|
|
13
13
|
POSITION_CARTESIAN: {
|
|
14
14
|
numElements: 3,
|
|
15
15
|
arrayType: Float32Array,
|
|
@@ -55,8 +55,8 @@ const POINT_ATTTRIBUTES = {
|
|
|
55
55
|
attributeName: 'normal'
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
for (const potreeName of Object.keys(
|
|
59
|
-
const attr =
|
|
58
|
+
for (const potreeName of Object.keys(POINT_ATTRIBUTES)) {
|
|
59
|
+
const attr = POINT_ATTRIBUTES[potreeName];
|
|
60
60
|
attr.potreeName = potreeName;
|
|
61
61
|
attr.numByte = attr.numByte || attr.arrayType.BYTES_PER_ELEMENT;
|
|
62
62
|
attr.byteSize = attr.numElements * attr.numByte;
|
|
@@ -87,14 +87,14 @@ var _default = {
|
|
|
87
87
|
// Format: X1,Y1,Z1,R1,G1,B1,A1,[...],XN,YN,ZN,RN,GN,BN,AN
|
|
88
88
|
let pointByteSize = 0;
|
|
89
89
|
for (const potreeName of options.in.pointAttributes) {
|
|
90
|
-
pointByteSize +=
|
|
90
|
+
pointByteSize += POINT_ATTRIBUTES[potreeName].byteSize;
|
|
91
91
|
}
|
|
92
92
|
const numPoints = Math.floor(buffer.byteLength / pointByteSize);
|
|
93
93
|
const geometry = new THREE.BufferGeometry();
|
|
94
94
|
let elemOffset = 0;
|
|
95
95
|
let attrOffset = 0;
|
|
96
96
|
for (const potreeName of options.in.pointAttributes) {
|
|
97
|
-
const attr =
|
|
97
|
+
const attr = POINT_ATTRIBUTES[potreeName];
|
|
98
98
|
const arrayLength = attr.numElements * numPoints;
|
|
99
99
|
const array = new attr.arrayType(arrayLength);
|
|
100
100
|
for (let arrayOffset = 0; arrayOffset < arrayLength; arrayOffset += attr.numElements) {
|
|
@@ -41,10 +41,8 @@ var _default = {
|
|
|
41
41
|
addPickingAttribute(points);
|
|
42
42
|
points.frustumCulled = false;
|
|
43
43
|
points.matrixAutoUpdate = false;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
points.scale.copy(layer.scale);
|
|
47
|
-
}
|
|
44
|
+
points.position.copy(geometry.userData.origin || node.bbox.min);
|
|
45
|
+
points.scale.copy(layer.scale);
|
|
48
46
|
points.updateMatrix();
|
|
49
47
|
points.tightbbox = geometry.boundingBox.applyMatrix4(points.matrix);
|
|
50
48
|
points.layer = layer;
|
package/lib/Renderer/OBB.js
CHANGED
|
@@ -126,11 +126,11 @@ class OBB extends THREE.Object3D {
|
|
|
126
126
|
position
|
|
127
127
|
} = builder.computeSharableExtent(extent);
|
|
128
128
|
// Compute the minimum count of segment to build tile
|
|
129
|
-
const
|
|
129
|
+
const segments = Math.max(Math.floor(sharableExtent.planarDimensions(dimension).x / 90 + 1), 2);
|
|
130
130
|
const geometry = new _TileGeometry.default({
|
|
131
131
|
extent: sharableExtent,
|
|
132
132
|
level: 0,
|
|
133
|
-
|
|
133
|
+
segments,
|
|
134
134
|
disableSkirt: true,
|
|
135
135
|
builder
|
|
136
136
|
});
|