potree-core 2.0.9 → 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/clipping.d.ts +2 -1
- package/dist/materials/point-cloud-material.d.ts +83 -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 +9 -8
package/README.md
CHANGED
|
@@ -61,6 +61,23 @@ function loop()
|
|
|
61
61
|
loop();
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
## Custom Request Manager
|
|
65
|
+
- The potree core library uses a custom request manager to handle the loading of point cloud data.
|
|
66
|
+
- The request manager can be replaced by a custom implementation, for example to use a custom caching system or to handle requests in a different way.
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
class CustomRequestManager implements RequestManager
|
|
70
|
+
{
|
|
71
|
+
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {
|
|
72
|
+
throw new Error("Method not implemented.")
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async getUrl(url: string): Promise<string> {
|
|
76
|
+
return url;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
64
81
|
## Notes
|
|
65
82
|
- Since potree-core is meant to be used as library and not as a full software as potree some features are not available.
|
|
66
83
|
- EDL shading is not supported by potree core.
|
package/dist/dem-node.d.ts
CHANGED
|
@@ -1,17 +1,73 @@
|
|
|
1
1
|
import { Box3, Vector2 } from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Digital Elevation Model (DEM) Node class.
|
|
4
|
+
*
|
|
5
|
+
* This class represents a node in a hierarchical structure for storing elevation data.
|
|
6
|
+
*/
|
|
2
7
|
export declare class DEMNode {
|
|
3
8
|
name: string;
|
|
4
9
|
box: Box3;
|
|
5
10
|
tileSize: number;
|
|
11
|
+
/**
|
|
12
|
+
* The level of the node in the hierarchy.
|
|
13
|
+
*/
|
|
6
14
|
level: number;
|
|
15
|
+
/**
|
|
16
|
+
* The elevation data for the node, stored as a Float32Array.
|
|
17
|
+
*
|
|
18
|
+
* Each element corresponds to a height value at a specific position in the tile.
|
|
19
|
+
*/
|
|
7
20
|
data: Float32Array;
|
|
21
|
+
/**
|
|
22
|
+
* The children of this node, which are also DEMNode instances.
|
|
23
|
+
*
|
|
24
|
+
* This allows for a hierarchical structure where each node can have multiple child nodes.
|
|
25
|
+
*/
|
|
8
26
|
children: DEMNode[];
|
|
27
|
+
/**
|
|
28
|
+
* The mipmap data for the node, which is an array of Float32Arrays.
|
|
29
|
+
*
|
|
30
|
+
* Each element in the mipMap corresponds to a different level of detail for the elevation data.
|
|
31
|
+
*/
|
|
9
32
|
mipMap: Float32Array[];
|
|
33
|
+
/**
|
|
34
|
+
* Indicates whether the mipmap needs to be updated.
|
|
35
|
+
*
|
|
36
|
+
* This is set to true when the node is created or when the elevation data changes, and should be set to false after the mipmap has been created.
|
|
37
|
+
*/
|
|
10
38
|
mipMapNeedsUpdate: boolean;
|
|
11
39
|
constructor(name: string, box: Box3, tileSize: number);
|
|
40
|
+
/**
|
|
41
|
+
* Creates the mipmap for this node.
|
|
42
|
+
*/
|
|
12
43
|
createMipMap(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Gets the UV coordinates for a given position within the bounding box of this node.
|
|
46
|
+
*
|
|
47
|
+
* @param position - The position in 2D space for which to calculate the UV coordinates.
|
|
48
|
+
* @returns UV coordinates as a tuple [u, v].
|
|
49
|
+
*/
|
|
13
50
|
uv(position: Vector2): [number, number];
|
|
51
|
+
/**
|
|
52
|
+
* Heights at a specific mipmap level for a given position.
|
|
53
|
+
*
|
|
54
|
+
* @param position - The position in 2D space for which to calculate the height.
|
|
55
|
+
* @param mipMapLevel - The mipmap level to use for height calculation.
|
|
56
|
+
* @returns Height at the specified position and mipmap level, or null if no valid height is found.
|
|
57
|
+
*/
|
|
14
58
|
heightAtMipMapLevel(position: Vector2, mipMapLevel: number): number;
|
|
59
|
+
/**
|
|
60
|
+
* Gets the height at a specific position by checking all mipmap levels.
|
|
61
|
+
*
|
|
62
|
+
* @param position - The position in 2D space for which to calculate the height.
|
|
63
|
+
* @returns Returns the height at the specified position, or null if no valid height is found.
|
|
64
|
+
*/
|
|
15
65
|
height(position: Vector2): any;
|
|
66
|
+
/**
|
|
67
|
+
* Travels through the hierarchy of DEM nodes, applying a handler function to each node.
|
|
68
|
+
*
|
|
69
|
+
* @param handler - A function that takes a DEMNode and a level as arguments, allowing custom processing of each node.
|
|
70
|
+
* @param level - The current level in the hierarchy, starting from 0 for the root node.
|
|
71
|
+
*/
|
|
16
72
|
traverse(handler: (node: DEMNode, level: number) => void, level?: number): void;
|
|
17
73
|
}
|
package/dist/features.d.ts
CHANGED