cd /news/ai-tools/why-raster-image-ai-fails-at-floor-p… · home › topics › ai-tools › article
[ARTICLE · art-176877] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Why Raster Image AI Fails at Floor Plans (and How to Compile Prompts and Sketches into Real Vector CAD in TypeScript)

The team behind PlanCaliber, a browser-based 2D/3D CAD drafting studio, built a TypeScript pipeline that compiles plain-English building programs and hand-drawn sketches or PDFs into editable vector floor plans rather than raster images. The system parses inputs into a PlanDocument intermediate representation with coordinates in real-world US inches quantized to a 0.25-inch drafting grid, then runs a synchronous geometry healer that welds near-duplicate vertices, snaps walls within ±6° of orthogonal axes, and closes micro-gaps so rooms form watertight polygons. The output supports vector PDFs at 1/4"=1'-0" and 8-layer AutoCAD R12 .DXF export.

recommendation

Run a synchronous geometry healer on generated or scanned plans—weld near-duplicate vertices, snap walls within ±6° of 0°/90°, and re-weld at 4"—before rendering, or room areas collapse to zero.

more in playbook: Verifying model output
by read5 min views11 publishedNov 26, 2026

Ask any general-purpose image diffusion model for a "3-bedroom, 1,500 sq ft ranch floor plan with a 12×10 kitchen island" and you will get something that looks architectural from six feet away—and falls apart the second you zoom in.

The dimension strings are melted gibberish. A bedroom labeled "14' x 12'" sits next to a bathroom that is visually wider than the bedroom. Doors open directly into kitchen islands. And worst of all, the output is a flat raster PNG. If a homeowner wants to move one partition wall 18 inches to widen a pantry, or hand the drawing to a draftsman in AutoCAD, the image is useless. You have to redraw the entire house from scratch.

When we built PlanCaliber—a browser-based 2D/3D CAD drafting studio—we made a strict architectural rule from day one: never generate pixels where the user needs geometry.

Here is how our compilation pipeline turns either a plain-English building program or a hand-drawn phone photo / PDF into an editable, closed-polygon CAD wall graph in TypeScript, ready for true 1/4"=1'-0" vector PDFs and 8-layer AutoCAD R12 .DXF export.

A real architectural floor plan is a planar straight-line graph (PSLG) with semantic constraints attached to edges, vertices, and faces:

degree >= 2) so rooms form watertight polygons whose areas can be computed deterministically via the shoelace formula—and classified into ANSI Z765 heated Gross Living Area (GLA) vs. unheated garage, shop, or porch bays.6" exterior framing, 4.5" interior partitions), double-line mitered corners, and collinearity relationships across T-junctions.(wallId, offsetIn, widthIn, swingDir) rather than disconnected ink lines—so moving a wall moves every door and window mounted on it.42" for a single cook (48" for two cooks), and an IRC R310 bedroom egress window needs 5.7 sq ft of net clear opening (20" min width, 24" min height). Diffusion models operate in latent pixel space. They have no concept of an invariant graph, no unit coordinate system ($INSUNITS=1 US inches), and no way to guarantee that Room A + Room B + Wall Thickness = Exterior Footprint.

Instead of asking a model to paint an image, our AI Floor Plan Generator treats both Text-to-CAD and Sketch/PDF-to-CAD as front-end parsing stages into a strict intermediate representation (PlanDocument):

export interface PlanDocument {
  walls: WallSegment[];      // endpoints in inches, thicknessIn, isExterior
  openings: WallOpening[];   // host wallId, offsetIn, widthIn, kind, swing
  fixtures: PlanFixture[];   // cabinets, islands, plumbing, electrical
  roomHints: RoomHint[];     // semantic labels + heated/unheated flags
}

Every coordinate in PlanDocument lives in real-world US inches, quantized on a 0.25" (1/4") drafting grid via snapInches(value, 0.25).

Even with strict JSON schemas, raw coordinates extracted from a napkin sketch or synthesized from a natural-language prompt always contain small topological flaws:

2.5" apart (degree 1 dangling edges that prevent room polygon closure).2° to 5° off true horizontal or vertical. If you hand that raw graph straight to a CAD renderer or .DXF exporter, room areas collapse to 0 sq ft and dimension chains break.

healPlanDocument) Before a generated or scanned floor plan ever reaches the interactive canvas, it runs synchronously through our TypeScript geometry healer (healPlanDocument):

weldVerticesInPlace) 0.25"-quantized centroid, and closes micro-gaps that would otherwise break face traversal.snapWallAnglesInPlace)±6° of 0° or 90° rotates cleanly onto the orthogonal axis around its midpoint, followed by a tight 4" re-weld pass. Intentional 45° bay windows or angled walls outside splitCrossingsAndTJunctionsInPlace) clampOpeningsInPlace) 3" clear of corner miters so jambs never collide with perpendicular drywall. Once healed, our planar half-edge face solver extracts every minimal enclosed cycle, removes the unbounded outer perimeter face, matches room hint points inside polygons, and computes exact wall-to-wall square footage and ANSI Z765 heated GLA in milliseconds—entirely client-side in the browser.

rescalePlanToWall) When someone snaps a phone photo of a hand sketch or uploads a multi-page PDF into PlanCaliber's Sketch & PDF-to-CAD studio, pixel dimensions don't automatically equal feet and inches.

Our two-point calibration engine (rescalePlanToWall) lets the user click any single known wall—or even a standard 36" entry door—and type its real measurement (for example 24'-6"). From that single reference ratio:

2" framing increments (18" to 120"), while cabinetry and fixtures snap to And when a user later edits a wall length directly (setWallLength), the engine walks collinear split wall chains across healed T-junctions so stretching a bedroom wall shifts the entire aligned facade cleanly without ripping the perimeter apart.

Because the source of truth is a true-scale planar CAD graph instead of a flat image, every downstream export compiles deterministically from the exact same math:

1/4"=1'-0" or 1/8"=1'-0" scale (A-101 Dimensioned Floor Plan, A-102 Furniture & Fixture Plan, E-101 Electrical & Lighting Plan, A-201 Exterior Elevations, and M-101 Clean White MLS Presentation Plan).AC1009) ASCII .DXF`` 1:1 Model Space scale ($INSUNITS=1 inches, North-up +Y) across 8 standard AIA layers ( A-WALL, A-DOOR, A-GLAZ, A-CABN, A-FURN, E-POWR, A-ROOM, and A-DIMS), opening directly in AutoCAD, Revit, SketchUp Pro, Rhino, LibreCAD, and QCAD..OBJ/.MTL & Framing Takeoff .CSV You can inspect unlocked real compiler output directly before opening the studio:

AI shines in drafting when it eliminates the tedious blank-page step—converting a messy paper sketch, a real-estate PDF, or a plain-English room list into a clean starting geometry—while deterministic CAD engineering takes over for scale, clearances, editing, and plotting.

You can open PlanCaliber's AI Floor Plan Generator right in your browser with no account required, run up to 2 free AI scans or text-to-CAD generations per day, edit every wall to 1/4" precision in 2D and 3D, and only pay a simple one-time pass ($9 for clean scaled PDF/PNG/SVG + share link, or $19 for the full 5-sheet CAD + AutoCAD .DXF pack, no subscription, 14-day instant refund) when you are ready for clean exports.

Note: PlanCaliber produces preliminary space-planning and architectural drafting documents—not licensed architectural or structural engineering stamps. Always verify dimensions and local building codes on site before construction or permit submission.

── more in #ai-tools 4 stories · sorted by recency
── more on @plancaliber 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/why-raster-image-ai-…] indexed:0 read:5min 2026-11-26 · —