@playcanvas/splat-transform 0.5.2 → 0.5.4
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 +19 -19
- package/README.md +127 -127
- package/bin/cli.mjs +5 -5
- package/dist/index.mjs +665 -377
- package/dist/index.mjs.map +1 -1
- package/package.json +54 -57
package/LICENSE
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
Copyright (c) 2011-2025 PlayCanvas Ltd.
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
-
in the Software without restriction, including without limitation the rights
|
|
6
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
furnished to do so, subject to the following conditions:
|
|
9
|
-
|
|
10
|
-
The above copyright notice and this permission notice shall be included in
|
|
11
|
-
all copies or substantial portions of the Software.
|
|
12
|
-
|
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
-
THE SOFTWARE.
|
|
1
|
+
Copyright (c) 2011-2025 PlayCanvas Ltd.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
# SplatTransform - 3D Gaussian Splat Converter
|
|
2
|
-
|
|
3
|
-
SplatTransform is an open source CLI tool for reading gaussian splat PLY files and writing them to PLY, Compressed PLY, CSV, and SOGS format.
|
|
4
|
-
|
|
5
|
-
Multiple files may be combined and transformed before being written to the output.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
First install the package globally:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install -g @playcanvas/splat-transform
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
splat-transform [GLOBAL] <input.{ply|splat|ksplat}> [ACTIONS] ... <output.{ply|compressed.ply|meta.json|csv}> [ACTIONS]
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**Key points:**
|
|
22
|
-
- Every time an `*.ply*` appears, it becomes the current working set; the following ACTIONS are applied in the order listed
|
|
23
|
-
- The last file on the command line is treated as the output; anything after it is interpreted as actions that modify the final result
|
|
24
|
-
|
|
25
|
-
## Supported Formats
|
|
26
|
-
|
|
27
|
-
**Input:**
|
|
28
|
-
- `.ply` - Standard PLY format
|
|
29
|
-
- `.splat` - Binary splat format (antimatter15 format)
|
|
30
|
-
- `.ksplat` - Compressed binary splat format (mkkellogg format)
|
|
31
|
-
|
|
32
|
-
**Output:**
|
|
33
|
-
- `.ply` - Standard PLY format
|
|
34
|
-
- `.compressed.ply` - Compressed PLY format
|
|
35
|
-
- `meta.json` - SOGS format (JSON + WebP images)
|
|
36
|
-
- `.csv` - Comma-separated values
|
|
37
|
-
|
|
38
|
-
## Actions
|
|
39
|
-
|
|
40
|
-
Actions can be repeated and applied in any order:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
-t, --translate x,y,z Translate splats by (x, y, z)
|
|
44
|
-
-r, --rotate x,y,z Rotate splats by Euler angles (deg)
|
|
45
|
-
-s, --scale x Uniformly scale splats by factor x
|
|
46
|
-
-n, --filterNaN Remove any Gaussian containing NaN/Inf
|
|
47
|
-
-c, --filterByValue name,cmp,value Keep splats where <name> <cmp> <value>
|
|
48
|
-
cmp ∈ {lt,lte,gt,gte,eq,neq}
|
|
49
|
-
-b, --filterBands {0|1|2|3} Strip spherical-harmonic bands > N
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Global Options
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
-w, --overwrite Overwrite output file if it already exists
|
|
56
|
-
-h, --help Show help and exit
|
|
57
|
-
-v, --version Show version and exit
|
|
58
|
-
-g, --no-gpu Disable gpu when compressing spherical harmonics.
|
|
59
|
-
-i, --iterations <number> Specify the number of iterations when compressing spherical harmonics. More iterations generally lead to better results. Default is 10.
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Examples
|
|
63
|
-
|
|
64
|
-
### Basic Operations
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
# Simple format conversion
|
|
68
|
-
splat-transform input.ply output.csv
|
|
69
|
-
|
|
70
|
-
# Convert from .splat format
|
|
71
|
-
splat-transform input.splat output.ply
|
|
72
|
-
|
|
73
|
-
# Convert from .ksplat format
|
|
74
|
-
splat-transform input.ksplat output.ply
|
|
75
|
-
|
|
76
|
-
# Convert to compressed PLY
|
|
77
|
-
splat-transform input.ply output.compressed.ply
|
|
78
|
-
|
|
79
|
-
# Convert to SOGS format
|
|
80
|
-
splat-transform input.ply output/meta.json
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Transformations
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
# Scale and translate
|
|
87
|
-
splat-transform bunny.ply -s 0.5 -t 0,0,10 bunny_scaled.ply
|
|
88
|
-
|
|
89
|
-
# Rotate by 90 degrees around Y axis
|
|
90
|
-
splat-transform input.ply -r 0,90,0 output.ply
|
|
91
|
-
|
|
92
|
-
# Chain multiple transformations
|
|
93
|
-
splat-transform input.ply -s 2 -t 1,0,0 -r 0,0,45 output.ply
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Filtering
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
# Remove entries containing NaN and Inf
|
|
100
|
-
splat-transform input.ply --filterNaN output.ply
|
|
101
|
-
|
|
102
|
-
# Filter by opacity values (keep only splats with opacity > 0.5)
|
|
103
|
-
splat-transform input.ply -c opacity,gt,0.5 output.ply
|
|
104
|
-
|
|
105
|
-
# Strip spherical harmonic bands higher than 2
|
|
106
|
-
splat-transform input.ply --filterBands 2 output.ply
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Advanced Usage
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
# Combine multiple files with different transforms
|
|
113
|
-
splat-transform -w cloudA.ply -r 0,90,0 cloudB.ply -s 2 merged.compressed.ply
|
|
114
|
-
|
|
115
|
-
# Apply final transformations to combined result
|
|
116
|
-
splat-transform input1.ply input2.ply output.ply -t 0,0,10 -s 0.5
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Getting Help
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
# Show version
|
|
123
|
-
splat-transform --version
|
|
124
|
-
|
|
125
|
-
# Show help
|
|
126
|
-
splat-transform --help
|
|
127
|
-
```
|
|
1
|
+
# SplatTransform - 3D Gaussian Splat Converter
|
|
2
|
+
|
|
3
|
+
SplatTransform is an open source CLI tool for reading gaussian splat PLY files and writing them to PLY, Compressed PLY, CSV, and SOGS format.
|
|
4
|
+
|
|
5
|
+
Multiple files may be combined and transformed before being written to the output.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
First install the package globally:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g @playcanvas/splat-transform
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
splat-transform [GLOBAL] <input.{ply|splat|ksplat}> [ACTIONS] ... <output.{ply|compressed.ply|meta.json|csv}> [ACTIONS]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Key points:**
|
|
22
|
+
- Every time an `*.ply*` appears, it becomes the current working set; the following ACTIONS are applied in the order listed
|
|
23
|
+
- The last file on the command line is treated as the output; anything after it is interpreted as actions that modify the final result
|
|
24
|
+
|
|
25
|
+
## Supported Formats
|
|
26
|
+
|
|
27
|
+
**Input:**
|
|
28
|
+
- `.ply` - Standard PLY format
|
|
29
|
+
- `.splat` - Binary splat format (antimatter15 format)
|
|
30
|
+
- `.ksplat` - Compressed binary splat format (mkkellogg format)
|
|
31
|
+
|
|
32
|
+
**Output:**
|
|
33
|
+
- `.ply` - Standard PLY format
|
|
34
|
+
- `.compressed.ply` - Compressed PLY format
|
|
35
|
+
- `meta.json` - SOGS format (JSON + WebP images)
|
|
36
|
+
- `.csv` - Comma-separated values
|
|
37
|
+
|
|
38
|
+
## Actions
|
|
39
|
+
|
|
40
|
+
Actions can be repeated and applied in any order:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
-t, --translate x,y,z Translate splats by (x, y, z)
|
|
44
|
+
-r, --rotate x,y,z Rotate splats by Euler angles (deg)
|
|
45
|
+
-s, --scale x Uniformly scale splats by factor x
|
|
46
|
+
-n, --filterNaN Remove any Gaussian containing NaN/Inf
|
|
47
|
+
-c, --filterByValue name,cmp,value Keep splats where <name> <cmp> <value>
|
|
48
|
+
cmp ∈ {lt,lte,gt,gte,eq,neq}
|
|
49
|
+
-b, --filterBands {0|1|2|3} Strip spherical-harmonic bands > N
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Global Options
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
-w, --overwrite Overwrite output file if it already exists
|
|
56
|
+
-h, --help Show help and exit
|
|
57
|
+
-v, --version Show version and exit
|
|
58
|
+
-g, --no-gpu Disable gpu when compressing spherical harmonics.
|
|
59
|
+
-i, --iterations <number> Specify the number of iterations when compressing spherical harmonics. More iterations generally lead to better results. Default is 10.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Examples
|
|
63
|
+
|
|
64
|
+
### Basic Operations
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Simple format conversion
|
|
68
|
+
splat-transform input.ply output.csv
|
|
69
|
+
|
|
70
|
+
# Convert from .splat format
|
|
71
|
+
splat-transform input.splat output.ply
|
|
72
|
+
|
|
73
|
+
# Convert from .ksplat format
|
|
74
|
+
splat-transform input.ksplat output.ply
|
|
75
|
+
|
|
76
|
+
# Convert to compressed PLY
|
|
77
|
+
splat-transform input.ply output.compressed.ply
|
|
78
|
+
|
|
79
|
+
# Convert to SOGS format
|
|
80
|
+
splat-transform input.ply output/meta.json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Transformations
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Scale and translate
|
|
87
|
+
splat-transform bunny.ply -s 0.5 -t 0,0,10 bunny_scaled.ply
|
|
88
|
+
|
|
89
|
+
# Rotate by 90 degrees around Y axis
|
|
90
|
+
splat-transform input.ply -r 0,90,0 output.ply
|
|
91
|
+
|
|
92
|
+
# Chain multiple transformations
|
|
93
|
+
splat-transform input.ply -s 2 -t 1,0,0 -r 0,0,45 output.ply
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Filtering
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Remove entries containing NaN and Inf
|
|
100
|
+
splat-transform input.ply --filterNaN output.ply
|
|
101
|
+
|
|
102
|
+
# Filter by opacity values (keep only splats with opacity > 0.5)
|
|
103
|
+
splat-transform input.ply -c opacity,gt,0.5 output.ply
|
|
104
|
+
|
|
105
|
+
# Strip spherical harmonic bands higher than 2
|
|
106
|
+
splat-transform input.ply --filterBands 2 output.ply
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Advanced Usage
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Combine multiple files with different transforms
|
|
113
|
+
splat-transform -w cloudA.ply -r 0,90,0 cloudB.ply -s 2 merged.compressed.ply
|
|
114
|
+
|
|
115
|
+
# Apply final transformations to combined result
|
|
116
|
+
splat-transform input1.ply input2.ply output.ply -t 0,0,10 -s 0.5
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Getting Help
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Show version
|
|
123
|
+
splat-transform --version
|
|
124
|
+
|
|
125
|
+
# Show help
|
|
126
|
+
splat-transform --help
|
|
127
|
+
```
|
package/bin/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { main } from '../dist/index.mjs';
|
|
4
|
-
|
|
5
|
-
await main();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { main } from '../dist/index.mjs';
|
|
4
|
+
|
|
5
|
+
await main();
|