Personal project
Invite-only studio pilotTerraPlanar
Floor plans to reviewable 3D models, for interior and renovation studios.
- Role
- Founder and sole engineer · TerraPlanar FZE LLC
- Period
- May 2026 – present
- Built with
- Gemini on Vertex AIPythonPyTorchSDXL + ControlNetCloud Run (GPU)PostgreSQLPrismaCloud SQLNext.js 16React 19TypeScriptThree.jsReact Three FiberAuth.js
TerraPlanar turns an existing apartment floor plan (an image or a PDF) into a reviewable spatial draft, a downloadable 3D model and a separate styled concept image. It's built for small interior, design and renovation studios preparing early client conversations. The central design decision is to keep what the AI guesses separate from what the code guarantees, with an explicit human approval in between.
- 1 GPU
- L4 job per render, scaled to zero, no automatic retries
- 117
- automated tests: geometry, billing and API rules
- 1–40
- rooms per validated layout
- 9k
- lines of TypeScript and Python
The core idea: separate the guess from the guarantee
A 3D model can faithfully reflect the geometry that was entered without proving the drawing was read correctly. The whole product is organised around that distinction.
- Modelcan be wrong
- Codedeterministic
- Persondecides
- 1
Upload a plan
PNG, JPEG, WebP or the first page of a PDF, up to 10 MiB.
Person - 2
Gemini reads it
Rooms, orthogonal outlines, open edges, door and window openings, and a scale estimate.
Model - 3
Validate
Shared boundaries and numeric rules. One bounded correction pass. Rejects rather than fits.
Code - 4
Designer reviews
Compares the trace with the source, calibrates scale from a known length, edits by hand or by chat.
Person - 5
Approve the layout
A fingerprint of the exact saved layout. Any geometry change invalidates it.
Person - 6
Build exact geometry
Floors, ceilings and walls exported as a GLB by deterministic code.
Code - 7
Styled preview
SDXL with depth ControlNet on an L4 GPU, composited onto a clean backdrop.
Model
The exact 3D geometry comes from deterministic code, not from the image model. The styled preview is a separate, clearly labelled picture.
Decisions I'd defend
- Reject, don't guess
- Multi-floor sheets, multi-dwelling plans and non-plans are rejected with a reason. A failed import never replaces the current draft with a partial result.
- Approval is versioned
- Every save carries the project version, and a stale save is refused instead of overwriting. Saved versions can be restored, and changing the geometry invalidates the approval.
- The queue lives in Postgres
- Usage is reserved and the job admitted in one transaction. A dispatcher takes an advisory lock and a dispatch permit before starting a Cloud Run Job, and a signed scheduler call reconciles every minute, so an open browser tab is never the only recovery path.
- Cost-bounded GPU
- One L4 job per render, scaled to zero between runs, with timeouts, no automatic retries, and per-workspace and global admission limits.
- A chat assistant that can only propose
- A Gemini tool-calling assistant suggests edits to existing rooms. The designer inspects the proposal and applies it explicitly; manual controls always remain.
- Private outputs
- Generated files are served through owner-checked endpoints, not public buckets.
I audited my own marketing
Before opening the pilot I removed every claim from the product that I couldn't back up: invented figures, on-shore processing promises, a placeholder address and phone number. The app and docs now say plainly what it can and can't do, such as one apartment on one floor, horizontal and vertical outlines only, and exports limited to GLB, layout JSON and PNG with no CAD or BIM formats.
I'd rather have a smaller claim that survives a customer reading it closely.
Under the hood
- Web tier
- Next.js 16 and React 19 on Cloud Run. Auth.js sign-in, Prisma over PostgreSQL, Zustand for the editor's draft geometry, and a Three.js viewer built with React Three Fiber.
- GPU worker
- Python on a CUDA base image, run as a Cloud Run Job with one L4 GPU. trimesh builds the GLB; Diffusers runs SDXL with ControlNet for the preview.
- Data and storage
- Cloud SQL (PostgreSQL 16) for users, projects, versions, jobs and usage ledgers. Cloud Storage for normalised sources, models and previews.
- Plan reading
- Gemini vision on Vertex AI, within a shared model budget per import. Geometry validation is deterministic and covered by tests.
Where it stands
- Deployed, in an invitation-only pilot
- Studios get a timed, no-card trial with quotas. Billing is wired but in test mode, and public paid plans are not open. Whether studios find it useful, how long corrections take and whether they'd pay are what the pilot is for.
- Honest limits
- One complete apartment on one floor; no diagonal or curved walls; estimated scale needs human review. A styled preview takes a few minutes while the exact model returns first.