potree-core 2.0.10 → 2.0.11
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/README.md +17 -0
- package/dist/dem-node.d.ts +56 -0
- package/dist/features.d.ts +5 -0
- package/dist/index.js +1 -1
- package/dist/loading/load-poc.d.ts +5 -8
- package/dist/loading2/OctreeGeometryNode.d.ts +27 -1
- package/dist/loading2/OctreeLoader.d.ts +46 -4
- package/dist/loading2/RequestManager.d.ts +20 -0
- package/dist/loading2/WorkerPool.d.ts +33 -1
- package/dist/loading2/load-octree.d.ts +9 -2
- package/dist/materials/blur-material.d.ts +45 -0
- package/dist/materials/point-cloud-material.d.ts +80 -0
- package/dist/point-cloud-octree-node.d.ts +50 -0
- package/dist/point-cloud-octree-picker.d.ts +6 -9
- package/dist/point-cloud-octree.d.ts +74 -4
- package/dist/point-cloud-tree.d.ts +11 -0
- package/dist/potree.d.ts +27 -8
- package/dist/type-predicates.d.ts +12 -0
- package/dist/types.d.ts +4 -2
- package/dist/utils/bounds.d.ts +12 -1
- package/dist/utils/box3-helper.d.ts +2 -6
- package/dist/utils/lru.d.ts +57 -3
- package/dist/utils/math.d.ts +8 -0
- package/dist/version.d.ts +18 -0
- package/package.json +8 -7
package/dist/potree.d.ts
CHANGED
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RequestManager } from './loading2/RequestManager';
|
|
2
|
+
import { Camera, Frustum, Ray, Vector2, Vector3, WebGLRenderer } from 'three';
|
|
3
3
|
import { PointCloudOctree } from './point-cloud-octree';
|
|
4
|
-
import { PickParams } from './point-cloud-octree-picker';
|
|
4
|
+
import { PickParams, PointCloudOctreePicker } from './point-cloud-octree-picker';
|
|
5
5
|
import { IPointCloudTreeNode, IPotree, IVisibilityUpdateResult, PickPoint } from './types';
|
|
6
|
+
import { BinaryHeap } from './utils/binary-heap';
|
|
6
7
|
import { LRU } from './utils/lru';
|
|
8
|
+
/**
|
|
9
|
+
* Represents an item in a processing queue for point cloud operations.
|
|
10
|
+
*
|
|
11
|
+
* This class is typically used to manage nodes within a point cloud structure, associating each node with a specific weight and its parent node if applicable.
|
|
12
|
+
*/
|
|
7
13
|
export declare class QueueItem {
|
|
8
14
|
pointCloudIndex: number;
|
|
9
15
|
weight: number;
|
|
10
16
|
node: IPointCloudTreeNode;
|
|
11
17
|
parent?: IPointCloudTreeNode | null;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new QueueItem instance.
|
|
20
|
+
*
|
|
21
|
+
* @param pointCloudIndex - The index of the point cloud this item belongs to.
|
|
22
|
+
* @param weight - The weight or priority associated with this queue item.
|
|
23
|
+
* @param node - The point cloud tree node represented by this queue item.
|
|
24
|
+
* @param parent - (Optional) The parent node of the current node, or null if it has no parent.
|
|
25
|
+
*/
|
|
12
26
|
constructor(pointCloudIndex: number, weight: number, node: IPointCloudTreeNode, parent?: IPointCloudTreeNode | null);
|
|
13
27
|
}
|
|
14
28
|
export declare class Potree implements IPotree {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
29
|
+
static picker: PointCloudOctreePicker | undefined;
|
|
30
|
+
_pointBudget: number;
|
|
31
|
+
_rendererSize: Vector2;
|
|
18
32
|
maxNumNodesLoading: number;
|
|
19
33
|
get features(): {
|
|
20
34
|
SHADER_INTERPOLATION: boolean;
|
|
@@ -23,7 +37,8 @@ export declare class Potree implements IPotree {
|
|
|
23
37
|
precision: string;
|
|
24
38
|
};
|
|
25
39
|
lru: LRU;
|
|
26
|
-
loadPointCloud(url: string,
|
|
40
|
+
loadPointCloud(url: string, baseUrl: string): Promise<PointCloudOctree>;
|
|
41
|
+
loadPointCloud(url: string, requestManager: RequestManager): Promise<PointCloudOctree>;
|
|
27
42
|
updatePointClouds(pointClouds: PointCloudOctree[], camera: Camera, renderer: WebGLRenderer): IVisibilityUpdateResult;
|
|
28
43
|
static pick(pointClouds: PointCloudOctree[], renderer: WebGLRenderer, camera: Camera, ray: Ray, params?: Partial<PickParams>): PickPoint | null;
|
|
29
44
|
get pointBudget(): number;
|
|
@@ -33,5 +48,9 @@ export declare class Potree implements IPotree {
|
|
|
33
48
|
private updateChildVisibility;
|
|
34
49
|
private updateBoundingBoxVisibility;
|
|
35
50
|
private shouldClip;
|
|
36
|
-
|
|
51
|
+
updateVisibilityStructures: (pointClouds: PointCloudOctree[], camera: Camera) => {
|
|
52
|
+
frustums: Frustum[];
|
|
53
|
+
cameraPositions: Vector3[];
|
|
54
|
+
priorityQueue: BinaryHeap<QueueItem>;
|
|
55
|
+
};
|
|
37
56
|
}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
import { PointCloudOctreeGeometryNode } from './point-cloud-octree-geometry-node';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the given node is a geometry node.
|
|
4
|
+
*
|
|
5
|
+
* @param node - Node to check.
|
|
6
|
+
* @returns True if the node is a geometry node, false otherwise.
|
|
7
|
+
*/
|
|
2
8
|
export declare function isGeometryNode(node?: any): node is PointCloudOctreeGeometryNode;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the given node is a tree node.
|
|
11
|
+
*
|
|
12
|
+
* @param node - Node to check.
|
|
13
|
+
* @returns True if the node is a tree node, false otherwise.
|
|
14
|
+
*/
|
|
3
15
|
export declare function isTreeNode(node?: any): any;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { RequestManager } from './loading2/RequestManager';
|
|
1
2
|
import { OctreeGeometry } from './loading2/OctreeGeometry';
|
|
2
3
|
import { PointCloudOctreeGeometry } from './point-cloud-octree-geometry';
|
|
3
4
|
import { Box3, Camera, Sphere, Vector3, WebGLRenderer } from 'three';
|
|
4
|
-
import { GetUrlFn, XhrRequest } from './loading/types';
|
|
5
5
|
import { PointCloudOctree } from './point-cloud-octree';
|
|
6
6
|
import { LRU } from './utils/lru';
|
|
7
7
|
export interface IPointCloudTreeNode {
|
|
@@ -24,6 +24,7 @@ export interface IVisibilityUpdateResult {
|
|
|
24
24
|
numVisiblePoints: number;
|
|
25
25
|
/**
|
|
26
26
|
* True when a node has been loaded but was not added to the scene yet.
|
|
27
|
+
*
|
|
27
28
|
* Make sure to call updatePointClouds() again on the next frame.
|
|
28
29
|
*/
|
|
29
30
|
exceededMaxLoadsToGPU: boolean;
|
|
@@ -40,7 +41,8 @@ export interface IPotree {
|
|
|
40
41
|
pointBudget: number;
|
|
41
42
|
maxNumNodesLoading: number;
|
|
42
43
|
lru: LRU;
|
|
43
|
-
loadPointCloud(url: string,
|
|
44
|
+
loadPointCloud(url: string, baseUrl: string): Promise<PointCloudOctree>;
|
|
45
|
+
loadPointCloud(url: string, requestManager: RequestManager): Promise<PointCloudOctree>;
|
|
44
46
|
updatePointClouds(pointClouds: PointCloudOctree[], camera: Camera, renderer: WebGLRenderer): IVisibilityUpdateResult;
|
|
45
47
|
}
|
|
46
48
|
export interface PickPoint {
|
package/dist/utils/bounds.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { Box3, Matrix4 } from 'three';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Computes the transformed bounding box of a given Box3 using a transformation matrix.
|
|
4
|
+
*
|
|
5
|
+
* @param box - The original bounding box to transform.
|
|
6
|
+
* @param transform - The transformation matrix to apply.
|
|
7
|
+
* @returns A new Box3 that represents the transformed bounding box.
|
|
4
8
|
*/
|
|
5
9
|
export declare function computeTransformedBoundingBox(box: Box3, transform: Matrix4): Box3;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a child AABB (Axis-Aligned Bounding Box) from a parent AABB based on the specified index.
|
|
12
|
+
*
|
|
13
|
+
* @param aabb - The parent AABB from which to create the child AABB.
|
|
14
|
+
* @param index - The index that determines how to split the parent AABB into a child AABB.
|
|
15
|
+
* @returns New Box3 representing the child AABB.
|
|
16
|
+
*/
|
|
6
17
|
export declare function createChildAABB(aabb: Box3, index: number): Box3;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { Box3, Color, LineSegments } from 'three';
|
|
2
2
|
/**
|
|
3
|
+
* Helper class to visualize a Box3 bounding box in 3D space.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
* https://github.com/mrdoob/three.js/blob/dev/src/helpers/BoxHelper.js
|
|
6
|
-
*
|
|
7
|
-
* @author mrdoob / http://mrdoob.com/
|
|
8
|
-
* @author Mugen87 / http://github.com/Mugen87
|
|
9
|
-
* @author mschuetz / http://potree.org
|
|
5
|
+
* Code adapted from three.js BoxHelper.js
|
|
10
6
|
*/
|
|
11
7
|
export declare class Box3Helper extends LineSegments {
|
|
12
8
|
constructor(box: Box3, color?: Color);
|
package/dist/utils/lru.d.ts
CHANGED
|
@@ -11,22 +11,76 @@ export declare class LRUItem {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class LRU {
|
|
13
13
|
pointBudget: number;
|
|
14
|
+
/**
|
|
15
|
+
* The least recently used item.
|
|
16
|
+
*/
|
|
14
17
|
first: LRUItem | null;
|
|
18
|
+
/**
|
|
19
|
+
* The most recently used item
|
|
20
|
+
*/
|
|
15
21
|
last: LRUItem | null;
|
|
22
|
+
/**
|
|
23
|
+
* The total number of points in the LRU cache.
|
|
24
|
+
*/
|
|
16
25
|
numPoints: number;
|
|
26
|
+
/**
|
|
27
|
+
* Items in the LRU cache, indexed by node ID.
|
|
28
|
+
*/
|
|
17
29
|
private items;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new LRU cache with a specified point budget.
|
|
32
|
+
*
|
|
33
|
+
* @param pointBudget The maximum number of points that can be stored in the LRU cache.
|
|
34
|
+
*/
|
|
18
35
|
constructor(pointBudget?: number);
|
|
19
36
|
get size(): number;
|
|
37
|
+
/**
|
|
38
|
+
* Checks if the LRU cache contains the specified node.
|
|
39
|
+
*
|
|
40
|
+
* @param node - The node to check for in the LRU cache.
|
|
41
|
+
* @returns Returns true if the node is in the cache, false otherwise.
|
|
42
|
+
*/
|
|
20
43
|
has(node: Node): boolean;
|
|
21
44
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
45
|
+
* Makes the specified the most recently used item. if the list does not contain node, it will be added.
|
|
46
|
+
*
|
|
47
|
+
* @param node - The node to touch, making it the most recently used item in the LRU cache.
|
|
48
|
+
*/
|
|
25
49
|
touch(node: Node): void;
|
|
50
|
+
/**
|
|
51
|
+
* Adds a new node to the LRU cache, making it the most recently used item.
|
|
52
|
+
*
|
|
53
|
+
* @param node - The node to add to the LRU cache.
|
|
54
|
+
*/
|
|
26
55
|
private addNew;
|
|
56
|
+
/**
|
|
57
|
+
* Touches an existing item in the LRU cache, moving it to the end of the list (most recently used).
|
|
58
|
+
*
|
|
59
|
+
* @param item - The LRUItem to touch, making it the most recently used item in the cache.
|
|
60
|
+
*/
|
|
27
61
|
private touchExisting;
|
|
62
|
+
/**
|
|
63
|
+
* Removes a node from the LRU cache.
|
|
64
|
+
*
|
|
65
|
+
* @param node - The node to remove from the LRU cache.
|
|
66
|
+
*/
|
|
28
67
|
remove(node: Node): void;
|
|
68
|
+
/**
|
|
69
|
+
* Gets the least recently used item from the LRU cache.
|
|
70
|
+
*
|
|
71
|
+
* @returns Returns the least recently used node, or undefined if the cache is empty.
|
|
72
|
+
*/
|
|
29
73
|
getLRUItem(): Node | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Frees up memory by removing the least recently used items until the number of points is below the point budget.
|
|
76
|
+
*
|
|
77
|
+
* @returns - Returns nothing.
|
|
78
|
+
*/
|
|
30
79
|
freeMemory(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Disposes of a subtree starting from the specified node and removes it from the LRU cache.
|
|
82
|
+
*
|
|
83
|
+
* @param node - The root node of the subtree to dispose of.
|
|
84
|
+
*/
|
|
31
85
|
disposeSubtree(node: Node): void;
|
|
32
86
|
}
|
package/dist/utils/math.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clamps a number between a minimum and maximum value.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The number to clamp.
|
|
5
|
+
* @param min - The minimum value the number can be.
|
|
6
|
+
* @param max - The maximum value the number can be.
|
|
7
|
+
* @returns Clamped value between min and max.
|
|
8
|
+
*/
|
|
1
9
|
export declare function clamp(value: number, min: number, max: number): number;
|
package/dist/version.d.ts
CHANGED
|
@@ -3,7 +3,25 @@ export declare class Version {
|
|
|
3
3
|
versionMajor: number;
|
|
4
4
|
versionMinor: number;
|
|
5
5
|
constructor(version: string);
|
|
6
|
+
/**
|
|
7
|
+
* Checks if this version is newer than the given version.
|
|
8
|
+
*
|
|
9
|
+
* @param version - The version to compare against.
|
|
10
|
+
* @returns True if this version is newer than the given version, false otherwise.
|
|
11
|
+
*/
|
|
6
12
|
newerThan(version: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Checks if this version is equal or higher than the given version.
|
|
15
|
+
*
|
|
16
|
+
* @param version - The version to compare against.
|
|
17
|
+
* @returns True if this version is equal or higher than the given version, false otherwise.
|
|
18
|
+
*/
|
|
7
19
|
equalOrHigher(version: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Checks if this version is equal or lower than the given version.
|
|
22
|
+
*
|
|
23
|
+
* @param version - The version to compare against.
|
|
24
|
+
* @returns True if this version is equal or lower than the given version, false otherwise.
|
|
25
|
+
*/
|
|
8
26
|
upTo(version: string): boolean;
|
|
9
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "potree-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "Potree wrapper for three.js applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"dev": "webpack --mode development --watch --progress --stats-children",
|
|
16
16
|
"build": "webpack --mode production --config webpack.prod.js",
|
|
17
17
|
"start": "npm run build && webpack-dev-server --config webpack.example.js --mode development --progress --port 5200",
|
|
18
|
-
"docs": "
|
|
19
|
-
"pub": "npm run build && npm publish --access public .",
|
|
20
|
-
"lint": "eslint source",
|
|
21
|
-
"lint-fix": "eslint --fix source"
|
|
18
|
+
"docs": "typedoc source/** --out docs --tsconfig tsconfig.json --theme default --excludeExternals --excludeNotDocumented",
|
|
19
|
+
"pub": "npm run build && npm run docs && npm publish --access public .",
|
|
20
|
+
"lint": "eslint ./source",
|
|
21
|
+
"lint-fix": "eslint --fix ./source"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"three",
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"three": ">0.125.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"three": "^0.154.0",
|
|
36
35
|
"brotli": "1.3.3"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
@@ -48,12 +47,14 @@
|
|
|
48
47
|
"html-webpack-plugin": "5.5.0",
|
|
49
48
|
"raw-loader": "4.0.2",
|
|
50
49
|
"style-loader": "3.3.1",
|
|
50
|
+
"three": "^0.154.0",
|
|
51
51
|
"ts-loader": "9.5.1",
|
|
52
|
+
"typedoc": "0.28.5",
|
|
52
53
|
"typescript": "5.5.4",
|
|
53
54
|
"webpack": "5.94.0",
|
|
54
55
|
"webpack-bundle-analyzer": "4.10.2",
|
|
55
56
|
"webpack-cli": "5.1.4",
|
|
56
|
-
"webpack-dev-server": "5.
|
|
57
|
+
"webpack-dev-server": "5.2.1",
|
|
57
58
|
"worker-loader": "3.0.8"
|
|
58
59
|
}
|
|
59
60
|
}
|