@margoengine/points 0.0.0-stage → 1.0.0
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/LICENSE +201 -0
- package/NOTICE +4 -0
- package/README.md +876 -2
- package/dist/attributes-DNc-1pdr.js +256 -0
- package/dist/attributes.d.ts +48 -0
- package/dist/clip.d.ts +55 -0
- package/dist/clip.js +122 -0
- package/dist/cloud-B4O_G-Df.js +545 -0
- package/dist/cloud.d.ts +155 -0
- package/dist/color.d.ts +1 -0
- package/dist/copc-write.d.ts +95 -0
- package/dist/copc-write.js +318 -0
- package/dist/copc.d.ts +55 -0
- package/dist/copc.js +127 -0
- package/dist/depth-video.d.ts +98 -0
- package/dist/depth-video.js +164 -0
- package/dist/e57.d.ts +163 -0
- package/dist/e57.js +624 -0
- package/dist/frame.d.ts +14 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +1246 -0
- package/dist/las.d.ts +213 -0
- package/dist/las.js +500 -0
- package/dist/laz-encode-CHXgHra_.js +446 -0
- package/dist/laz-encode.d.ts +14 -0
- package/dist/laz-model-DCphHLqH.js +385 -0
- package/dist/laz-model.d.ts +47 -0
- package/dist/laz-write.d.ts +46 -0
- package/dist/laz-write.js +75 -0
- package/dist/laz.d.ts +50 -0
- package/dist/laz.js +645 -0
- package/dist/material.d.ts +167 -0
- package/dist/math.d.ts +103 -0
- package/dist/octree.d.ts +182 -0
- package/dist/octree.js +360 -0
- package/dist/pick.d.ts +76 -0
- package/dist/pick.js +192 -0
- package/dist/plugin.d.ts +235 -0
- package/dist/potree-las-RC8sjbYU.js +1 -0
- package/dist/potree-las.d.ts +1 -0
- package/dist/potree.d.ts +70 -0
- package/dist/potree.js +451 -0
- package/dist/range-BQuJAjUM.js +23 -0
- package/dist/range.d.ts +4 -0
- package/dist/screen-door-CALlYs39.js +7 -0
- package/dist/shaders-DCnbvb0-.js +282 -0
- package/dist/shaders.d.ts +52 -0
- package/dist/shared/fog.d.ts +33 -0
- package/dist/shared/pass.d.ts +53 -0
- package/dist/shared/selection-mask.d.ts +52 -0
- package/dist/shared/style-expression.d.ts +18 -0
- package/dist/sprites.d.ts +78 -0
- package/dist/storage-limit.d.ts +6 -0
- package/dist/style.d.ts +124 -0
- package/dist/style.js +709 -0
- package/dist/surfels.d.ts +95 -0
- package/dist/surfels.js +538 -0
- package/dist/survey-DToZwkJv.js +46 -0
- package/dist/survey.d.ts +10 -0
- package/dist/tier-BcFbLPVT.js +91 -0
- package/dist/tier.d.ts +6 -0
- package/package.json +102 -4
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { MargoError as e } from "@margoengine/math/errors";
|
|
2
|
+
//#region ../shared/require-webgpu.js
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
if (t.backend === "webgl2" || !t.gpu) throw new e("unsupported", `${n} needs WebGPU; see https://margoengine.com/errors#webgpu`);
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/storage-limit.ts
|
|
8
|
+
function n(e, t, n) {
|
|
9
|
+
let r = Math.min(t.maxStorageBufferBindingSize, t.maxBufferSize), i = Math.max(12, n, e.colors ? 4 * e.colorStride : 0);
|
|
10
|
+
if (e.count * i > r) throw RangeError(`Point cloud of ${e.count} points exceeds the device storage limit of ${Math.floor(r / i)} points at ${i} bytes a point; split it into several clouds${i === 16 ? " or use colorFormat 'rgba8'" : ""}.`);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ../shared/errors.js
|
|
14
|
+
var r = (e, t) => Object.assign(Error(t), {
|
|
15
|
+
name: "MargoError",
|
|
16
|
+
code: e
|
|
17
|
+
}), i = (e, t) => `${e}; see https://margoengine.com/errors#${t}`, a = (e, t, n = e) => r(e, i(t, n));
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region ../shared/view-rect.js
|
|
20
|
+
function o(e) {
|
|
21
|
+
return e?.view?.viewport;
|
|
22
|
+
}
|
|
23
|
+
function s(e) {
|
|
24
|
+
let t = o(e);
|
|
25
|
+
return t ? [t[2], t[3]] : [e.width, e.height];
|
|
26
|
+
}
|
|
27
|
+
function c(e, t) {
|
|
28
|
+
let n = o(t);
|
|
29
|
+
if (!n) return;
|
|
30
|
+
e.setViewport(n[0], n[1], n[2], n[3], 0, 1);
|
|
31
|
+
let r = t.view.scissor ?? n;
|
|
32
|
+
e.setScissorRect(r[0], r[1], r[2], r[3]);
|
|
33
|
+
}
|
|
34
|
+
function l(e) {
|
|
35
|
+
return e?.view?.id ?? 0;
|
|
36
|
+
}
|
|
37
|
+
var u = class {
|
|
38
|
+
constructor(e, t = () => {}) {
|
|
39
|
+
this.create = e, this.release = t, this.states = /* @__PURE__ */ new Map(), this.frame = 0;
|
|
40
|
+
}
|
|
41
|
+
get(e) {
|
|
42
|
+
let t = l(e), n = this.states.get(t);
|
|
43
|
+
return n || this.states.set(t, n = {
|
|
44
|
+
state: this.create(e),
|
|
45
|
+
frame: 0
|
|
46
|
+
}), n.frame = this.frame, n.state;
|
|
47
|
+
}
|
|
48
|
+
find(e) {
|
|
49
|
+
return this.states.get(e)?.state;
|
|
50
|
+
}
|
|
51
|
+
*values() {
|
|
52
|
+
for (let e of this.states.values()) yield e.state;
|
|
53
|
+
}
|
|
54
|
+
*drawn() {
|
|
55
|
+
for (let e of this.states.values()) e.frame === this.frame && (yield e.state);
|
|
56
|
+
}
|
|
57
|
+
prune() {
|
|
58
|
+
for (let [e, t] of this.states) t.frame < this.frame && (this.states.delete(e), this.release(t.state));
|
|
59
|
+
this.frame++;
|
|
60
|
+
}
|
|
61
|
+
clear() {
|
|
62
|
+
for (let e of this.states.values()) this.release(e.state);
|
|
63
|
+
this.states.clear();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region ../shared/compat.js
|
|
68
|
+
function d(e, t, n = "full") {
|
|
69
|
+
let r = {
|
|
70
|
+
ldr: 0,
|
|
71
|
+
"half-float": 1,
|
|
72
|
+
full: 2
|
|
73
|
+
};
|
|
74
|
+
if (!Object.hasOwn(r, n)) throw TypeError("minimum must be full, half-float or ldr");
|
|
75
|
+
let i = e?.adapter?.capabilities?.tier;
|
|
76
|
+
if (i && r[i] < r[n]) throw a("unsupported", `${t} requires the ${n} compatibility tier; this device is ${i}`, "compatibility-layer");
|
|
77
|
+
}
|
|
78
|
+
function f(e) {
|
|
79
|
+
return e?.adapterInfo?.vendor === "margo-webgl2" ? "webgl2" : "native";
|
|
80
|
+
}
|
|
81
|
+
function p(e) {
|
|
82
|
+
return f(e) === "native" && e?.features?.has("core-features-and-limits") === !1;
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/tier.ts
|
|
86
|
+
function m(e) {
|
|
87
|
+
let t = e.adapter?.capabilities?.tier;
|
|
88
|
+
return f(e) === "webgl2" && t !== "full";
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { u as a, s as c, t as d, d as i, a as l, f as n, c as o, p as r, o as s, m as t, n as u };
|
package/dist/tier.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the WebGL2 layer rounds this device's r32float targets: below its full tier it stores them as r16float (and
|
|
3
|
+
* on its ldr tier in 8 bits), whose rounding of a depth (about 0.004 at a depth of 4) moves the surfel blend window
|
|
4
|
+
* and the eye-dome depth steps. Such a device gets its depths packed into rgba8unorm instead, exactly.
|
|
5
|
+
*/
|
|
6
|
+
export declare function roundsFloatTargets(device: GPUDevice): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,104 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@margoengine/points",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Large point clouds (PointCloud, PointsMaterial) and instanced sprites (SpriteBatch, SpriteMaterial) for Margo Engine, WebGPU.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"margoengine",
|
|
7
|
+
"webgpu",
|
|
8
|
+
"3d",
|
|
9
|
+
"points"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://margoengine.com",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/scottcampbelldata/margoengine/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/scottcampbelldata/margoengine.git",
|
|
18
|
+
"directory": "packages/points"
|
|
19
|
+
},
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"author": "Scott Campbell",
|
|
22
|
+
"type": "module",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "node scripts/build.js",
|
|
28
|
+
"test": "npm run build && node --test tests/*.test.js ../../examples/package-benchmarks/proofs/package-guard.mjs",
|
|
29
|
+
"test:gpu": "cd ../.. && node packages/points/tests/scale-check.mjs && node packages/points/tests/pixel-density-browser.mjs",
|
|
30
|
+
"test:browser": "npm run build && node scripts/test-browser.js",
|
|
31
|
+
"prepack": "npm run build",
|
|
32
|
+
"test:gpu:scale": "npm run build && cd ../.. && node packages/points/tests/scale-check.mjs"
|
|
33
|
+
},
|
|
34
|
+
"sideEffects": false,
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"import": "./dist/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./las": {
|
|
41
|
+
"types": "./dist/las.d.ts",
|
|
42
|
+
"import": "./dist/las.js"
|
|
43
|
+
},
|
|
44
|
+
"./laz": {
|
|
45
|
+
"types": "./dist/laz.d.ts",
|
|
46
|
+
"import": "./dist/laz.js"
|
|
47
|
+
},
|
|
48
|
+
"./laz-write": {
|
|
49
|
+
"types": "./dist/laz-write.d.ts",
|
|
50
|
+
"import": "./dist/laz-write.js"
|
|
51
|
+
},
|
|
52
|
+
"./copc-write": {
|
|
53
|
+
"types": "./dist/copc-write.d.ts",
|
|
54
|
+
"import": "./dist/copc-write.js"
|
|
55
|
+
},
|
|
56
|
+
"./e57": {
|
|
57
|
+
"types": "./dist/e57.d.ts",
|
|
58
|
+
"import": "./dist/e57.js"
|
|
59
|
+
},
|
|
60
|
+
"./copc": {
|
|
61
|
+
"types": "./dist/copc.d.ts",
|
|
62
|
+
"import": "./dist/copc.js"
|
|
63
|
+
},
|
|
64
|
+
"./octree": {
|
|
65
|
+
"types": "./dist/octree.d.ts",
|
|
66
|
+
"import": "./dist/octree.js"
|
|
67
|
+
},
|
|
68
|
+
"./surfels": {
|
|
69
|
+
"types": "./dist/surfels.d.ts",
|
|
70
|
+
"import": "./dist/surfels.js"
|
|
71
|
+
},
|
|
72
|
+
"./potree": {
|
|
73
|
+
"types": "./dist/potree.d.ts",
|
|
74
|
+
"import": "./dist/potree.js"
|
|
75
|
+
},
|
|
76
|
+
"./depth-video": {
|
|
77
|
+
"types": "./dist/depth-video.d.ts",
|
|
78
|
+
"import": "./dist/depth-video.js"
|
|
79
|
+
},
|
|
80
|
+
"./pick": {
|
|
81
|
+
"types": "./dist/pick.d.ts",
|
|
82
|
+
"import": "./dist/pick.js"
|
|
83
|
+
},
|
|
84
|
+
"./clip": {
|
|
85
|
+
"types": "./dist/clip.d.ts",
|
|
86
|
+
"import": "./dist/clip.js"
|
|
87
|
+
},
|
|
88
|
+
"./style": {
|
|
89
|
+
"types": "./dist/style.d.ts",
|
|
90
|
+
"import": "./dist/style.js"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"files": [
|
|
94
|
+
"dist",
|
|
95
|
+
"NOTICE"
|
|
96
|
+
],
|
|
97
|
+
"peerDependencies": {
|
|
98
|
+
"@margoengine/core": "^1.0.0"
|
|
99
|
+
},
|
|
100
|
+
"dependencies": {
|
|
101
|
+
"@margoengine/decoders": "^1.0.0",
|
|
102
|
+
"@margoengine/math": "^1.0.0"
|
|
103
|
+
}
|
|
104
|
+
}
|