@playcanvas/splat-transform 0.4.0 → 0.4.1

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 CHANGED
@@ -1,19 +1,19 @@
1
- Copyright (c) 2011-2024 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-2024 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,125 +1,125 @@
1
- # Splat Transform - 3D Gaussian Splat Converter
2
-
3
- Splat Transform 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
- ```
59
-
60
- ## Examples
61
-
62
- ### Basic Operations
63
-
64
- ```bash
65
- # Simple format conversion
66
- splat-transform input.ply output.csv
67
-
68
- # Convert from .splat format
69
- splat-transform input.splat output.ply
70
-
71
- # Convert from .ksplat format
72
- splat-transform input.ksplat output.ply
73
-
74
- # Convert to compressed PLY
75
- splat-transform input.ply output.compressed.ply
76
-
77
- # Convert to SOGS format
78
- splat-transform input.ply output/meta.json
79
- ```
80
-
81
- ### Transformations
82
-
83
- ```bash
84
- # Scale and translate
85
- splat-transform bunny.ply -s 0.5 -t 0,0,10 bunny_scaled.ply
86
-
87
- # Rotate by 90 degrees around Y axis
88
- splat-transform input.ply -r 0,90,0 output.ply
89
-
90
- # Chain multiple transformations
91
- splat-transform input.ply -s 2 -t 1,0,0 -r 0,0,45 output.ply
92
- ```
93
-
94
- ### Filtering
95
-
96
- ```bash
97
- # Remove entries containing NaN and Inf
98
- splat-transform input.ply --filterNaN output.ply
99
-
100
- # Filter by opacity values (keep only splats with opacity > 0.5)
101
- splat-transform input.ply -c opacity,gt,0.5 output.ply
102
-
103
- # Strip spherical harmonic bands higher than 2
104
- splat-transform input.ply --filterBands 2 output.ply
105
- ```
106
-
107
- ### Advanced Usage
108
-
109
- ```bash
110
- # Combine multiple files with different transforms
111
- splat-transform -w cloudA.ply -r 0,90,0 cloudB.ply -s 2 merged.compressed.ply
112
-
113
- # Apply final transformations to combined result
114
- splat-transform input1.ply input2.ply output.ply -t 0,0,10 -s 0.5
115
- ```
116
-
117
- ## Getting Help
118
-
119
- ```bash
120
- # Show version
121
- splat-transform --version
122
-
123
- # Show help
124
- splat-transform --help
125
- ```
1
+ # Splat Transform - 3D Gaussian Splat Converter
2
+
3
+ Splat Transform 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
+ ```
59
+
60
+ ## Examples
61
+
62
+ ### Basic Operations
63
+
64
+ ```bash
65
+ # Simple format conversion
66
+ splat-transform input.ply output.csv
67
+
68
+ # Convert from .splat format
69
+ splat-transform input.splat output.ply
70
+
71
+ # Convert from .ksplat format
72
+ splat-transform input.ksplat output.ply
73
+
74
+ # Convert to compressed PLY
75
+ splat-transform input.ply output.compressed.ply
76
+
77
+ # Convert to SOGS format
78
+ splat-transform input.ply output/meta.json
79
+ ```
80
+
81
+ ### Transformations
82
+
83
+ ```bash
84
+ # Scale and translate
85
+ splat-transform bunny.ply -s 0.5 -t 0,0,10 bunny_scaled.ply
86
+
87
+ # Rotate by 90 degrees around Y axis
88
+ splat-transform input.ply -r 0,90,0 output.ply
89
+
90
+ # Chain multiple transformations
91
+ splat-transform input.ply -s 2 -t 1,0,0 -r 0,0,45 output.ply
92
+ ```
93
+
94
+ ### Filtering
95
+
96
+ ```bash
97
+ # Remove entries containing NaN and Inf
98
+ splat-transform input.ply --filterNaN output.ply
99
+
100
+ # Filter by opacity values (keep only splats with opacity > 0.5)
101
+ splat-transform input.ply -c opacity,gt,0.5 output.ply
102
+
103
+ # Strip spherical harmonic bands higher than 2
104
+ splat-transform input.ply --filterBands 2 output.ply
105
+ ```
106
+
107
+ ### Advanced Usage
108
+
109
+ ```bash
110
+ # Combine multiple files with different transforms
111
+ splat-transform -w cloudA.ply -r 0,90,0 cloudB.ply -s 2 merged.compressed.ply
112
+
113
+ # Apply final transformations to combined result
114
+ splat-transform input1.ply input2.ply output.ply -t 0,0,10 -s 0.5
115
+ ```
116
+
117
+ ## Getting Help
118
+
119
+ ```bash
120
+ # Show version
121
+ splat-transform --version
122
+
123
+ # Show help
124
+ splat-transform --help
125
+ ```
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();