@playcanvas/splat-transform 0.8.1 → 0.10.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/README.md +33 -17
- package/dist/index.mjs +439 -74
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@playcanvas/splat-transform)
|
|
4
4
|
[](https://npmtrends.com/@playcanvas/splat-transform)
|
|
5
5
|
[](https://github.com/playcanvas/splat-transform/blob/main/LICENSE)
|
|
6
|
+
[](https://discord.gg/RSaMRzg)
|
|
7
|
+
[](https://www.reddit.com/r/PlayCanvas)
|
|
8
|
+
[](https://x.com/intent/follow?screen_name=playcanvas)
|
|
6
9
|
|
|
7
10
|
| [User Guide](https://developer.playcanvas.com/user-manual/gaussian-splatting/editing/splat-transform/) | [Blog](https://blog.playcanvas.com/) | [Forum](https://forum.playcanvas.com/) | [Discord](https://discord.gg/RSaMRzg) |
|
|
8
11
|
|
|
9
12
|
SplatTransform is an open source CLI tool for converting and editing Gaussian splats. It can:
|
|
10
13
|
|
|
11
|
-
📥 Read PLY, Compressed PLY, SPLAT, KSPLAT formats
|
|
12
|
-
📤 Write PLY, Compressed PLY, CSV, and
|
|
14
|
+
📥 Read PLY, Compressed PLY, SPLAT, KSPLAT, SPZ formats
|
|
15
|
+
📤 Write PLY, Compressed PLY, CSV, SOG and HTML viewer formats
|
|
13
16
|
🔗 Merge multiple splats
|
|
14
17
|
🔄 Apply transformations to input splats
|
|
15
18
|
🎛️ Filter out Gaussians or spherical harmonic bands
|
|
@@ -33,7 +36,7 @@ npm install -g @playcanvas/splat-transform
|
|
|
33
36
|
## Usage
|
|
34
37
|
|
|
35
38
|
```bash
|
|
36
|
-
splat-transform [GLOBAL] <input.{ply|compressed.ply|splat|ksplat}> [ACTIONS] ... <output.{ply|compressed.ply|sog|meta.json|csv}> [ACTIONS]
|
|
39
|
+
splat-transform [GLOBAL] <input.{ply|compressed.ply|splat|ksplat}> [ACTIONS] ... <output.{ply|compressed.ply|sog|meta.json|csv|html}> [ACTIONS]
|
|
37
40
|
```
|
|
38
41
|
|
|
39
42
|
**Key points:**
|
|
@@ -42,19 +45,18 @@ splat-transform [GLOBAL] <input.{ply|compressed.ply|splat|ksplat}> [ACTIONS] .
|
|
|
42
45
|
|
|
43
46
|
## Supported Formats
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
| Format | Input | Output | Description |
|
|
49
|
+
| ------ | ----- | ------ | ----------- |
|
|
50
|
+
| `.ply` | ✅ | ✅ | Standard PLY format |
|
|
51
|
+
| `.compressed.ply` | ✅ | ✅ | Compressed PLY format (auto-detected and decompressed on read) |
|
|
52
|
+
| `.ksplat` | ✅ | ❌ | Compressed splat format (mkkellogg format) |
|
|
53
|
+
| `.splat` | ✅ | ❌ | Compressed splat format (antimatter15 format) |
|
|
54
|
+
| `.spz` | ✅ | ❌ | Compressed splat format (Niantic format) |
|
|
55
|
+
| `.mjs` | ✅ | ❌ | Generate a scene using an mjs script (Beta) |
|
|
56
|
+
| `.sog` | ❌ | ✅ | Bundled super-compressed format (recommended) |
|
|
57
|
+
| `meta.json` | ❌ | ✅ | Unbundled super-compressed format (also outputs `.webp` images) |
|
|
58
|
+
| `.csv` | ❌ | ✅ | Comma-separated values spreadsheet |
|
|
59
|
+
| `.html` | ❌ | ✅ | Standalone HTML viewer app |
|
|
58
60
|
## Actions
|
|
59
61
|
|
|
60
62
|
Actions can be repeated and applied in any order:
|
|
@@ -67,6 +69,7 @@ Actions can be repeated and applied in any order:
|
|
|
67
69
|
-c, --filterByValue name,cmp,value Keep splats where <name> <cmp> <value>
|
|
68
70
|
cmp ∈ {lt,lte,gt,gte,eq,neq}
|
|
69
71
|
-b, --filterBands {0|1|2|3} Strip spherical-harmonic bands > N
|
|
72
|
+
-P, --params name=value[,name=value...] Pass parameters to .mjs generator script
|
|
70
73
|
```
|
|
71
74
|
|
|
72
75
|
## Global Options
|
|
@@ -77,6 +80,8 @@ Actions can be repeated and applied in any order:
|
|
|
77
80
|
-v, --version Show version and exit
|
|
78
81
|
-g, --no-gpu Disable gpu when compressing spherical harmonics.
|
|
79
82
|
-i, --iterations <number> Specify the number of iterations when compressing spherical harmonics. More iterations generally lead to better results. Default is 10.
|
|
83
|
+
-p, --cameraPos Specify the viewer starting position. Default is 2,2,-2.
|
|
84
|
+
-e, --cameraTarget Specify the viewer starting target. Default is 0,0,0.
|
|
80
85
|
```
|
|
81
86
|
|
|
82
87
|
## Examples
|
|
@@ -105,6 +110,9 @@ splat-transform input.ply output.sog
|
|
|
105
110
|
|
|
106
111
|
# Convert to SOG unbundled format
|
|
107
112
|
splat-transform input.ply output/meta.json
|
|
113
|
+
|
|
114
|
+
# Convert to HTML viewer with target and camera location
|
|
115
|
+
splat-transform -a 0,0,0 -e 0,0,10 input.ply output.html
|
|
108
116
|
```
|
|
109
117
|
|
|
110
118
|
### Transformations
|
|
@@ -140,7 +148,15 @@ splat-transform input.ply --filterBands 2 output.ply
|
|
|
140
148
|
splat-transform -w cloudA.ply -r 0,90,0 cloudB.ply -s 2 merged.compressed.ply
|
|
141
149
|
|
|
142
150
|
# Apply final transformations to combined result
|
|
143
|
-
splat-transform input1.ply input2.ply output.ply -
|
|
151
|
+
splat-transform input1.ply input2.ply output.ply -p 0,0,10 -e 0.5
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Generators (Beta)
|
|
155
|
+
|
|
156
|
+
Generator scripts can be used to synthesize gaussian splat data. See [gen-grid.mjs](generators/gen-grid.mjs) for an example.
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
splat-transform gen-grid.mjs -P width=10,height=10,scale=10,color=0.1 scenes/grid.ply -w
|
|
144
160
|
```
|
|
145
161
|
|
|
146
162
|
## Getting Help
|