feat(ai): GLB pipeline v2 — semantic scene graph architecture#10
Merged
Conversation
Replaces the single-pass Gemini prompt + hardcoded template system with a 9-phase AI-driven pipeline that understands product structure semantically before generating any geometry. **Core changes** - `SceneGraph` type replaces flat `ShapeParams` as the central data model; each part has its own shape, dimensions, position, rotation, and per-part PBR material including glass transmission and emissive support - 4 new geometry primitives in `glb-builder.ts`: `torus` (wheels), `frustum` (car hood/roof), `tapered-cylinder` (bottle necks), `extruded-ellipse` (car body cross-section) - `sceneGraphToPartDefs()` converts the v2 scene graph to `PartDef[]` with automatic symmetry mirroring (`symmetryMirror: "x" | "z"`) **9-phase orchestrator (gemini-3d-generator.ts)** - Phase A: `GeminiProductUnderstandingAnalyzer` — part-level structural analysis - Phase B: `GeminiGeometryClassifier` — tessellation and shading rules - Phase C: `GeminiSceneGraphReconstructor` — multi-view 3D reconstruction - Phase D: topology-aware GLB encoding via `sceneGraphToPartDefs` - Phase E: category correctors — `VehicleGenerator`, `ElectronicsGenerator`, `FurnitureGenerator`, `PackagingGenerator`, `ClothingGenerator`, `JewelryGenerator` via `CategoryGeneratorFactory` - Phase F: `GeminiPbrMaterialAnalyzer` — per-part color sampling from images - Phase G: `getStaticScaleBounds` — 25+ product-type size priors - Phase H: `SceneGraphValidator` + `autoRepairSceneGraph` + `GlbValidator` - Phase I: `GenerationFeedbackService` + migration 014 for approval/rejection signals v1 (convert-2d-to-3d) kept as automatic fallback; zero regression in existing test suite (133 tests pass). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ofcskn
added a commit
that referenced
this pull request
May 19, 2026
feat(ai): GLB pipeline v2 — semantic scene graph architecture
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
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
detectedType+ 8 scalar fields) with a richSceneGraph— a part-by-part descriptor with individual geometry, position, rotation, and PBR material per structural componentglb-builder.ts:torus(wheels),frustum(car hoods/roofs),tapered-cylinder(bottle necks),extruded-ellipse(car body cross-sections)gemini-3d-generator.ts: product understanding → geometry classification → multi-view scene graph reconstruction → category enforcement → per-part PBR materials → scale estimation → validation + auto-repair → GLB encoding → post-encode validationCategoryGeneratorFactory: vehicle, electronics, furniture, packaging, clothing, jewelry — each enforces domain-specific constraints (e.g., car wheels are always torii, fabric parts always have roughness > 0.7)SceneGraphValidatorcatches box wheels, missing vehicle wheels, zero dimensions, implausible scales;autoRepairSceneGraphfixes common errors before encodingGenerationFeedbackService+ migration014_generation_feedback.sqlrecords approve/reject signals per subtype for future few-shot improvementTest plan
libs/aitest suite: 133/133 passinglibs/aiandapps/apibuild with zero TypeScript errors🤖 Generated with Claude Code