forked from potree/potree
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEptLoader.js
More file actions
37 lines (27 loc) · 878 Bytes
/
EptLoader.js
File metadata and controls
37 lines (27 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* @author Connor Manning
*/
export class EptLoader {
static async load(file, callback) {
let response = await fetch(file);
let json = await response.json();
let url = file.substr(0, file.lastIndexOf('/ept.json'));
let geometry = new Potree.PointCloudEptGeometry(url, json);
let root = new Potree.PointCloudCopcGeometryNode(geometry);
geometry.root = root;
geometry.root.load();
callback(geometry);
}
};
export class CopcLoader {
static async load(urlOrFile, callback) {
const { Copc, Getter } = window.CopcLib
const getter = Getter.create(urlOrFile); // Katapult BMF changed from Getter.http()
const copc = await Copc.create(getter);
let geometry = new Potree.PointCloudCopcGeometry(getter, copc);
let root = new Potree.PointCloudCopcGeometryNode(geometry);
geometry.root = root;
geometry.root.load();
callback(geometry);
}
}