@playcanvas/splat-transform 0.10.2 → 0.12.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 +36 -36
- package/dist/index.mjs +568 -107
- package/dist/index.mjs.map +1 -1
- package/lib/BUILD.md +5 -8
- package/lib/webp.c +62 -0
- package/lib/webp.mjs +14 -0
- package/lib/webp.wasm +0 -0
- package/package.json +4 -4
- package/lib/webp_encode.c +0 -31
- package/lib/webp_encode.mjs +0 -14
- package/lib/webp_encode.wasm +0 -0
package/README.md
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
|
|
12
12
|
SplatTransform is an open source CLI tool for converting and editing Gaussian splats. It can:
|
|
13
13
|
|
|
14
|
-
📥 Read PLY, Compressed PLY, SPLAT, KSPLAT, SPZ formats
|
|
15
|
-
📤 Write PLY, Compressed PLY, CSV, SOG and HTML viewer formats
|
|
14
|
+
📥 Read PLY, Compressed PLY, SPLAT, KSPLAT, SPZ, SOG (bundled .sog or unbundled meta.json) formats
|
|
15
|
+
📤 Write PLY, Compressed PLY, CSV, SOG (bundled or unbundled) and HTML viewer formats
|
|
16
16
|
🔗 Merge multiple splats
|
|
17
17
|
🔄 Apply transformations to input splats
|
|
18
18
|
🎛️ Filter out Gaussians or spherical harmonic bands
|
|
@@ -25,36 +25,28 @@ Install or update to the latest version:
|
|
|
25
25
|
npm install -g @playcanvas/splat-transform
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
> [!IMPORTANT]
|
|
29
|
-
> **Windows Users:** You must have the debug version of the Microsoft Visual C++ runtime installed. This is because splat-transform currently depends on [Dawn](https://dawn.googlesource.com/dawn) which is built against the debug VC runtime. We have logged an [issue](https://issues.chromium.org/issues/443906265) against the Dawn project.
|
|
30
|
-
>
|
|
31
|
-
> In the meantime, to work around this problem, you need to install the debug VC runtime as follows:
|
|
32
|
-
>
|
|
33
|
-
> 1. Install [Visual Studio 2022 Community](https://visualstudio.microsoft.com/vs/community/)
|
|
34
|
-
> 2. In the installer, select "Desktop development with C++"
|
|
35
|
-
|
|
36
28
|
## Usage
|
|
37
29
|
|
|
38
30
|
```bash
|
|
39
|
-
splat-transform [GLOBAL]
|
|
31
|
+
splat-transform [GLOBAL] input [ACTIONS] ... output [ACTIONS]
|
|
40
32
|
```
|
|
41
33
|
|
|
42
34
|
**Key points:**
|
|
43
|
-
-
|
|
44
|
-
- The last file
|
|
35
|
+
- Input files become the working set; ACTIONS are applied in order
|
|
36
|
+
- The last file is the output; actions after it modify the final result
|
|
45
37
|
|
|
46
38
|
## Supported Formats
|
|
47
39
|
|
|
48
40
|
| Format | Input | Output | Description |
|
|
49
41
|
| ------ | ----- | ------ | ----------- |
|
|
50
42
|
| `.ply` | ✅ | ✅ | Standard PLY format |
|
|
43
|
+
| `.sog` | ✅ | ✅ | Bundled super-compressed format (recommended) |
|
|
44
|
+
| `meta.json` | ✅ | ✅ | Unbundled super-compressed format (accompanied by `.webp` textures) |
|
|
51
45
|
| `.compressed.ply` | ✅ | ✅ | Compressed PLY format (auto-detected and decompressed on read) |
|
|
52
46
|
| `.ksplat` | ✅ | ❌ | Compressed splat format (mkkellogg format) |
|
|
53
47
|
| `.splat` | ✅ | ❌ | Compressed splat format (antimatter15 format) |
|
|
54
48
|
| `.spz` | ✅ | ❌ | Compressed splat format (Niantic format) |
|
|
55
49
|
| `.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
50
|
| `.csv` | ❌ | ✅ | Comma-separated values spreadsheet |
|
|
59
51
|
| `.html` | ❌ | ✅ | Standalone HTML viewer app |
|
|
60
52
|
## Actions
|
|
@@ -62,26 +54,28 @@ splat-transform [GLOBAL] <input.{ply|compressed.ply|splat|ksplat}> [ACTIONS] .
|
|
|
62
54
|
Actions can be repeated and applied in any order:
|
|
63
55
|
|
|
64
56
|
```bash
|
|
65
|
-
-t, --translate
|
|
66
|
-
-r, --rotate
|
|
67
|
-
-s, --scale
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
57
|
+
-t, --translate <x,y,z> Translate splats by (x, y, z).
|
|
58
|
+
-r, --rotate <x,y,z> Rotate splats by Euler angles (x, y, z), in degrees.
|
|
59
|
+
-s, --scale <factor> Uniformly scale splats by factor.
|
|
60
|
+
-N, --filter-nan Remove Gaussians with NaN or Inf values.
|
|
61
|
+
-V, --filter-value <name,cmp,value> Keep splats where <name> <cmp> <value>
|
|
62
|
+
cmp ∈ {lt,lte,gt,gte,eq,neq}
|
|
63
|
+
-H, --filter-harmonics <0|1|2|3> Remove spherical harmonic bands > n.
|
|
64
|
+
-B, --filter-box <mx,my,mz,Mx,My,Mz> Remove Gaussians outside box (min, max corners).
|
|
65
|
+
-S, --filter-sphere <x,y,z,radius> Remove Gaussians outside sphere (center, radius).
|
|
66
|
+
-p, --params <key=val,...> Pass parameters to .mjs generator script.
|
|
73
67
|
```
|
|
74
68
|
|
|
75
69
|
## Global Options
|
|
76
70
|
|
|
77
71
|
```bash
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-i, --iterations
|
|
83
|
-
-
|
|
84
|
-
-
|
|
72
|
+
-h, --help Show this help and exit.
|
|
73
|
+
-v, --version Show version and exit.
|
|
74
|
+
-w, --overwrite Overwrite output file if it exists.
|
|
75
|
+
-c, --cpu Use CPU for spherical harmonic compression.
|
|
76
|
+
-i, --iterations <n> Iterations for SOG SH compression (more = better). Default: 10.
|
|
77
|
+
-C, --camera-pos <x,y,z> HTML viewer camera position. Default: (2, 2, -2).
|
|
78
|
+
-T, --camera-target <x,y,z> HTML viewer target position. Default: (0, 0, 0).
|
|
85
79
|
```
|
|
86
80
|
|
|
87
81
|
## Examples
|
|
@@ -111,8 +105,14 @@ splat-transform input.ply output.sog
|
|
|
111
105
|
# Convert to SOG unbundled format
|
|
112
106
|
splat-transform input.ply output/meta.json
|
|
113
107
|
|
|
108
|
+
# Convert from SOG (bundled) back to PLY
|
|
109
|
+
splat-transform scene.sog restored.ply
|
|
110
|
+
|
|
111
|
+
# Convert from SOG (unbundled folder) back to PLY
|
|
112
|
+
splat-transform output/meta.json restored.ply
|
|
113
|
+
|
|
114
114
|
# Convert to HTML viewer with target and camera location
|
|
115
|
-
splat-transform -
|
|
115
|
+
splat-transform -C 0,0,0 -T 0,0,10 input.ply output.html
|
|
116
116
|
```
|
|
117
117
|
|
|
118
118
|
### Transformations
|
|
@@ -132,13 +132,13 @@ splat-transform input.ply -s 2 -t 1,0,0 -r 0,0,45 output.ply
|
|
|
132
132
|
|
|
133
133
|
```bash
|
|
134
134
|
# Remove entries containing NaN and Inf
|
|
135
|
-
splat-transform input.ply --
|
|
135
|
+
splat-transform input.ply --filter-nan output.ply
|
|
136
136
|
|
|
137
137
|
# Filter by opacity values (keep only splats with opacity > 0.5)
|
|
138
|
-
splat-transform input.ply -
|
|
138
|
+
splat-transform input.ply -V opacity,gt,0.5 output.ply
|
|
139
139
|
|
|
140
140
|
# Strip spherical harmonic bands higher than 2
|
|
141
|
-
splat-transform input.ply --
|
|
141
|
+
splat-transform input.ply --filter-harmonics 2 output.ply
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
### Advanced Usage
|
|
@@ -148,7 +148,7 @@ splat-transform input.ply --filterBands 2 output.ply
|
|
|
148
148
|
splat-transform -w cloudA.ply -r 0,90,0 cloudB.ply -s 2 merged.compressed.ply
|
|
149
149
|
|
|
150
150
|
# Apply final transformations to combined result
|
|
151
|
-
splat-transform input1.ply input2.ply output.ply -
|
|
151
|
+
splat-transform input1.ply input2.ply output.ply -t 0,0,10 -s 0.5
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
### Generators (Beta)
|
|
@@ -156,7 +156,7 @@ splat-transform input1.ply input2.ply output.ply -p 0,0,10 -e 0.5
|
|
|
156
156
|
Generator scripts can be used to synthesize gaussian splat data. See [gen-grid.mjs](generators/gen-grid.mjs) for an example.
|
|
157
157
|
|
|
158
158
|
```bash
|
|
159
|
-
splat-transform gen-grid.mjs -
|
|
159
|
+
splat-transform gen-grid.mjs -p width=10,height=10,scale=10,color=0.1 scenes/grid.ply -w
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
## Getting Help
|