-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add GLTF model loading support to circuit-json-to-gltf #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lessuselesss
wants to merge
6
commits into
tscircuit:main
Choose a base branch
from
lessuselesss:feat/gltf-support-clean
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implements tscircuit/tscircuit#758 by adding comprehensive GLTF loader functionality. Features: - GLTF 2.0 file format parsing with base64 buffer support - Triangle mesh extraction from GLTF primitives - Coordinate system transformation (Y-up to Z-up) - Integration with existing STL/OBJ pipeline - Comprehensive error handling and input validation - Performance caching and optimization - 91 test cases with 1,057 assertions across 13 test files Core Implementation: - lib/loaders/gltf.ts: GLTF parser with buffer decoding - lib/types.ts: GLTFMesh interface integration - lib/converters/circuit-to-3d.ts: Pipeline integration - lib/gltf/geometry.ts: Mesh creation utilities Testing Coverage: - Unit tests: Core parsing, triangulation, edge cases, security - Integration tests: End-to-end workflow validation - Performance tests: Caching and memory efficiency - Error handling: Malformed data and network failures 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Remove optional chaining where arrays are guaranteed to exist - Add non-null assertions for required properties - Fix array access patterns for stricter type checking
- Add global JSX IntrinsicElements declaration for model-viewer - Add @ts-ignore directive to suppress TypeScript error for web component - Ensures TypeScript compilation passes for demo site
c5ab658
to
905d23b
Compare
- Add optional chaining for db.pcb_board, db.pcb_component, and db.source_component - Fixes TypeScript errors TS18048 in CI type-check 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
905d23b
to
b5a9f11
Compare
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements tscircuit/tscircuit#758 by adding comprehensive GLTF loader functionality to complete the circuit-json-to-gltf pipeline.
This completes the final missing piece of the GLTF support chain:
Features
Implementation Details
Core Files
lib/loaders/gltf.ts
: GLTF parser with buffer decoding and triangle extractionlib/types.ts
: GLTFMesh interface extending existing mesh patternslib/converters/circuit-to-3d.ts
: Integration point for model_gltf_url processinglib/gltf/geometry.ts
: Mesh creation utilities following project conventionsTesting Coverage
Data Flow
Test Plan
Related Issues
Closes tscircuit/tscircuit#758
🤖 Generated with Claude Code
/claim #758