Skip to content

Update readme to include new library usage#141

Merged
slimbuck merged 1 commit intoplaycanvas:mainfrom
slimbuck:readme-dev
Jan 14, 2026
Merged

Update readme to include new library usage#141
slimbuck merged 1 commit intoplaycanvas:mainfrom
slimbuck:readme-dev

Conversation

@slimbuck
Copy link
Member

No description provided.

@slimbuck slimbuck requested review from a team and Copilot January 14, 2026 16:44
@slimbuck slimbuck self-assigned this Jan 14, 2026
@slimbuck slimbuck added the enhancement New feature or request label Jan 14, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: {}
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +342 to +352
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' };
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
}, memFs);

// Get the output data
const outputBuffer = memFs.files.get('output.ply');
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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').

Copilot uses AI. Check for mistakes.
const dataTables = await readFile({
filename: 'https://example.com/scene.ply',
inputFormat,
options: { iterations: 10 },
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@slimbuck slimbuck merged commit ec17fd4 into playcanvas:main Jan 14, 2026
8 checks passed
@slimbuck slimbuck deleted the readme-dev branch January 14, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants