Update readme to include new library usage#141
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the README to document the library usage of SplatTransform, expanding its documentation beyond just CLI usage.
Changes:
- Updated the project description to clarify it's both a library and CLI tool
- Added installation instructions for library usage as a dependency
- Renamed "Usage" section to "CLI Usage" for clarity
- Added comprehensive "Library Usage" section with API documentation, examples, and reference material
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| filename: 'output.ply', | ||
| outputFormat, | ||
| dataTable: processed, | ||
| options: {} |
There was a problem hiding this comment.
The empty Options object passed to writeFile would fail TypeScript compilation. The writeFile function's WriteOptions type includes an options property of type Options, which has several required properties. However, looking at the write.ts implementation, it appears only specific properties (iterations, unbundled, viewerSettingsJson, lodChunkCount, lodChunkExtent) are actually used and only for specific output formats. The example should either provide all required Options properties or clarify which properties are needed for the specific output format being used.
| type ProcessAction = | ||
| | { kind: 'translate'; value: Vec3 } | ||
| | { kind: 'rotate'; value: Vec3 } // Euler angles in degrees | ||
| | { kind: 'scale'; value: number } | ||
| | { kind: 'filterNaN' } | ||
| | { kind: 'filterByValue'; columnName: string; comparator: 'lt'|'lte'|'gt'|'gte'|'eq'|'neq'; value: number } | ||
| | { kind: 'filterBands'; value: 0|1|2|3 } | ||
| | { kind: 'filterBox'; min: Vec3; max: Vec3 } | ||
| | { kind: 'filterSphere'; center: Vec3; radius: number } | ||
| | { kind: 'lod'; value: number } | ||
| | { kind: 'summary' }; |
There was a problem hiding this comment.
The ProcessAction type definition is incomplete. According to the source code in src/lib/process.ts, there is an additional action type { kind: 'param'; name: string; value: string } that is not documented here. This action should be included in the type definition for completeness.
| }, memFs); | ||
|
|
||
| // Get the output data | ||
| const outputBuffer = memFs.files.get('output.ply'); |
There was a problem hiding this comment.
The MemoryFileSystem class uses a property named 'results' to store the output files, not 'files'. The correct code should be const outputBuffer = memFs.results.get('output.ply'); instead of memFs.files.get('output.ply').
| const dataTables = await readFile({ | ||
| filename: 'https://example.com/scene.ply', | ||
| inputFormat, | ||
| options: { iterations: 10 }, |
There was a problem hiding this comment.
The Options object passed to readFile is incomplete and would fail TypeScript compilation. According to the Options type definition in src/lib/types.ts, the following required properties are missing: lodSelect (number[]), unbundled (boolean), lodChunkCount (number), and lodChunkExtent (number). The example should either provide all required properties or the documentation should clarify which properties are actually needed for basic operations.
No description provided.