Inspiration
Stowage planning—the art of packing cargo into vessels and trucks—is a high-stakes puzzle. Inefficient loading leads to wasted space, while poor weight distribution can cause catastrophic stability failures.
After conducting a feasibility study with Gemini 2.5, I realized that while LLMs could generate static data, the industry needed something more: Interactivity and Physical Validation. With the release of Gemini 3, I was inspired to build a bridge between generative AI and industrial safety. I wanted to see if Gemini 3’s advanced spatial reasoning could act as a "Senior Stowage Engineer," transforming a complex manifest into a safe, stable, and visual 3D Digital Twin.
What it does
Smart Stowage Optimizer is a hybrid logistics sandbox that allows users to:
- Simulate 3D Loading: Visualize cargo in a high-fidelity environment using Three.js.
- Choose Your Engine: Toggle between a fast, deterministic Algorithmic Mode (Heuristic) and a safety-conscious Gemini AI Mode.
- Analyze Stability: The system automatically calculates the Center of Gravity (COG) and visualizes it with a red marker.
- Enforce Safety Rules: Gemini 3 reasons through "Soft Constraints," such as placing heavy generators at the base and fragile electronics on top.
- Export Loading Reports: Download optimized 3D coordinates as a CSV for real-world operations.
How we built it
The project is built on a modern full-stack web architecture:
- The Brain: We used the Google GenAI SDK to interface with Gemini 3 Pro. We leveraged its strict JSON output mode to map textual manifests into precise 3D coordinates.
- The Eyes: React 19 and React Three Fiber (Three.js) provide the visualization. We used Instanced Rendering to ensure high performance even when rendering hundreds of cargo units.
- The Physics: We implemented a validation layer that calculates mass distribution using the following statics formula: $$COG_{position} = \frac{\sum (mass_i \times position_i)}{\sum mass_i}$$ This ensures that the AI's "creativity" is always grounded in physical reality.
Challenges we ran into
The primary challenge was Coordinate Hallucination. Earlier LLMs often placed items overlapping or outside the container boundaries. Gemini 3 is significantly better at spatial reasoning, but for industrial safety, 99% accuracy isn't enough.
To solve this, we developed a "Safety Rail" Validation Layer. This TypeScript middleware intercepts Gemini's suggestions, checks for boundary violations (e.g., $x + width > container_width$), and automatically "clamps" coordinates to the nearest safe boundary without breaking the overall layout logic.
Accomplishments that we're proud of
- Gemini 3 Spatial Mapping: We successfully prompted Gemini 3 to handle complex 3DBPP (3D Bin Packing Problems) that usually require dedicated, heavy optimization software.
- Performance: Achieving a smooth 60FPS digital twin experience using instanced meshes.
- The Hybrid Engine: Creating a UI that lets users compare traditional heuristics vs. AI reasoning side-by-side.
What we learned
Building this project proved that Gemini 3 is a generational leap in spatial intelligence. Its ability to understand the concept of "up vs. down" and "heavy vs. light" in a 3D coordinate system is remarkable. We also learned that the best AI applications aren't "AI-only"—they are hybrid systems that combine the reasoning of an LLM with the deterministic safety of a physics engine.
What's next for Smart Stowage Optimizer
The next step is Multi-modal Integration. We plan to allow dock workers to snap a photo of a physical manifest or a cluttered warehouse. Gemini 3 could then OCR the items and instantly generate a 3D stowage plan in the Digital Twin. We are also looking into AR (Augmented Reality) support to overlay the loading plan directly onto physical containers.
Built With
- 3d-rendering:-three.js
- frontend:-react-19
- gemini
- lucide-react
- mermaid.js-(architecture-diagrams)
- papaparse-(csv-processing)
- react
- react-three-drei
- react-three-fiber
- styling:-tailwind-css
- three.js
- typescript
- utilities:-vite
- vite
Log in or sign up for Devpost to join the conversation.