Allow users to generate custom 3D chess piece models using the existing Trellis3D (image → GLB) pipeline and use them in place of the default static piece set.
Depends on
#40 — Chess Three.js display must land first; it introduces the ChessPieceModelProvider injection token abstraction that this feature plugs into.
Background
The chess 3D renderer (#40) introduces a ChessPieceModelProvider interface with an InjectionToken. The default StaticChessPieceModelProvider loads GLTF models from local assets. This ticket adds a second provider implementation — Trellis3dChessPieceModelProvider — that loads user-generated GLB models from the Trellis3D backend via ThreeDGeneratorService.getDownloadUrl().
GET /api/threedmodel/{id}/download (authenticated, streams GLB)
ThreeDGeneratorService on the Angular side with GLTFLoader consumption
Scope
New: "Piece Set" concept
A piece set is a collection of 6 ThreeDModel IDs (one per piece type: king, queen, rook, bishop, knight, pawn).
Users create a piece set by uploading 6 images (one per piece type) or optionally via text prompts (requires extending SourceType.Text in the Trellis worker).
Piece sets are persisted per user — new Mongo entity or sub-document on user profile.
New: Trellis3dChessPieceModelProvider
Implements ChessPieceModelProvider interface from #40.
Custom flow: upload 6 images, preview each as it generates (real-time progress via existing SignalR Receive3DModelProgress), save set.
The component-level providers array swaps CHESS_PIECE_MODEL_PROVIDER based on user selection.
Backend considerations
Auth caveat: GLTFLoader (Three.js FileLoader) does not pass Angular HttpClient interceptors. The provider must fetch the GLB as an authenticated blob and create an object URL, or configure a custom Three.js loader with setRequestHeader.
Extend ThreeDModel entity if chess-specific metadata is needed (e.g., chessPieceType field).
Acceptance criteria
Users can generate a complete custom 6-piece set from uploaded images.
Generated pieces render correctly in the 3D chess board with proper scale, orientation, and color tinting.
Progress updates display in real-time during generation.
Graceful fallback to default pieces if generation is incomplete or fails.
Piece set selection persists across sessions.
No regression to default static piece set behavior.
References
ChessPieceModelProvider interface: introduced in #40
## Summary
Allow users to generate custom 3D chess piece models using the existing Trellis3D (image → GLB) pipeline and use them in place of the default static piece set.
## Depends on
- **#40** — Chess Three.js display must land first; it introduces the `ChessPieceModelProvider` injection token abstraction that this feature plugs into.
## Background
The chess 3D renderer (#40) introduces a `ChessPieceModelProvider` interface with an `InjectionToken`. The default `StaticChessPieceModelProvider` loads GLTF models from local assets. This ticket adds a second provider implementation — `Trellis3dChessPieceModelProvider` — that loads user-generated GLB models from the Trellis3D backend via `ThreeDGeneratorService.getDownloadUrl()`.
The Trellis3D pipeline already supports:
- Image upload → RabbitMQ → TRELLIS worker → GLB output
- `GET /api/threedmodel/{id}/download` (authenticated, streams GLB)
- `ThreeDGeneratorService` on the Angular side with `GLTFLoader` consumption
## Scope
### New: "Piece Set" concept
- A piece set is a collection of 6 `ThreeDModel` IDs (one per piece type: king, queen, rook, bishop, knight, pawn).
- Users create a piece set by uploading 6 images (one per piece type) or optionally via text prompts (requires extending `SourceType.Text` in the Trellis worker).
- Piece sets are persisted per user — new Mongo entity or sub-document on user profile.
### New: `Trellis3dChessPieceModelProvider`
- Implements `ChessPieceModelProvider` interface from #40.
- `loadPrototype(type, color)` calls `ThreeDGeneratorService.getDownloadUrl(modelId)` → authenticated fetch → blob URL → `GLTFLoader.load()`.
- Handles color tinting (white/black) on the loaded model's materials.
- Falls back to `StaticChessPieceModelProvider` if any model in the set is still generating, failed, or missing.
### New: UI for piece set management
- Chess settings panel gains a "Piece Set" section.
- Options: Default (static) | Custom (user-generated).
- Custom flow: upload 6 images, preview each as it generates (real-time progress via existing SignalR `Receive3DModelProgress`), save set.
- The component-level `providers` array swaps `CHESS_PIECE_MODEL_PROVIDER` based on user selection.
### Backend considerations
- **Auth caveat**: `GLTFLoader` (Three.js `FileLoader`) does not pass Angular `HttpClient` interceptors. The provider must fetch the GLB as an authenticated blob and create an object URL, or configure a custom Three.js loader with `setRequestHeader`.
- Extend `ThreeDModel` entity if chess-specific metadata is needed (e.g., `chessPieceType` field).
## Acceptance criteria
- [ ] Users can generate a complete custom 6-piece set from uploaded images.
- [ ] Generated pieces render correctly in the 3D chess board with proper scale, orientation, and color tinting.
- [ ] Progress updates display in real-time during generation.
- [ ] Graceful fallback to default pieces if generation is incomplete or fails.
- [ ] Piece set selection persists across sessions.
- [ ] No regression to default static piece set behavior.
## References
- `ChessPieceModelProvider` interface: introduced in #40
- Trellis3D service: `spikersoft-backend/SpikerSoft.EventHandlers.Trellis3D.Python/`
- Angular service: `libraries/tools/src/services/threed-generator/threed-generator.service.ts`
- Backend API: `SpikerSoft.Api/Domain/ThreeDModel/ThreeDModelController.cs`
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Allow users to generate custom 3D chess piece models using the existing Trellis3D (image → GLB) pipeline and use them in place of the default static piece set.
Depends on
ChessPieceModelProviderinjection token abstraction that this feature plugs into.Background
The chess 3D renderer (#40) introduces a
ChessPieceModelProviderinterface with anInjectionToken. The defaultStaticChessPieceModelProviderloads GLTF models from local assets. This ticket adds a second provider implementation —Trellis3dChessPieceModelProvider— that loads user-generated GLB models from the Trellis3D backend viaThreeDGeneratorService.getDownloadUrl().The Trellis3D pipeline already supports:
GET /api/threedmodel/{id}/download(authenticated, streams GLB)ThreeDGeneratorServiceon the Angular side withGLTFLoaderconsumptionScope
New: "Piece Set" concept
ThreeDModelIDs (one per piece type: king, queen, rook, bishop, knight, pawn).SourceType.Textin the Trellis worker).New:
Trellis3dChessPieceModelProviderChessPieceModelProviderinterface from #40.loadPrototype(type, color)callsThreeDGeneratorService.getDownloadUrl(modelId)→ authenticated fetch → blob URL →GLTFLoader.load().StaticChessPieceModelProviderif any model in the set is still generating, failed, or missing.New: UI for piece set management
Receive3DModelProgress), save set.providersarray swapsCHESS_PIECE_MODEL_PROVIDERbased on user selection.Backend considerations
GLTFLoader(Three.jsFileLoader) does not pass AngularHttpClientinterceptors. The provider must fetch the GLB as an authenticated blob and create an object URL, or configure a custom Three.js loader withsetRequestHeader.ThreeDModelentity if chess-specific metadata is needed (e.g.,chessPieceTypefield).Acceptance criteria
References
ChessPieceModelProviderinterface: introduced in #40spikersoft-backend/SpikerSoft.EventHandlers.Trellis3D.Python/libraries/tools/src/services/threed-generator/threed-generator.service.tsSpikerSoft.Api/Domain/ThreeDModel/ThreeDModelController.cs