<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Simone Ellery</title>
    <description>The latest articles on DEV Community by Simone Ellery (@plumbdraft).</description>
    <link>https://dev.to/plumbdraft</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4272389%2Ff66366f1-4e07-485b-890d-a752c8923e86.png</url>
      <title>DEV Community: Simone Ellery</title>
      <link>https://dev.to/plumbdraft</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/plumbdraft"/>
    <language>en</language>
    <item>
      <title>Why LLMs Fail at Closed Floor Plan Geometry (And How We Built a Deterministic Imperial CAD + DXF + Hosted MCP Engine in TypeScript)</title>
      <dc:creator>Simone Ellery</dc:creator>
      <pubDate>Sun, 29 Nov 2026 13:55:49 +0000</pubDate>
      <link>https://dev.to/plumbdraft/why-llms-fail-at-closed-floor-plan-geometry-and-how-we-built-a-deterministic-imperial-cad-dxf--8j</link>
      <guid>https://dev.to/plumbdraft/why-llms-fail-at-closed-floor-plan-geometry-and-how-we-built-a-deterministic-imperial-cad-dxf--8j</guid>
      <description>&lt;p&gt;If you have ever asked an LLM to generate a 20x20 garage ADU floor plan in SVG or AutoCAD DXF, you already know what happens: walls miss their corners by 14 inches, doors float outside walls, room square footage contradicts the labeled dimensions, and the resulting DXF refuses to open cleanly in AutoCAD or LibreCAD.&lt;/p&gt;

&lt;p&gt;Recently, a lot of developers have been wiring Claude Code and Cursor to local Blender MCP setups just to get usable 3D floor plans. That works well for cinematic renders, but it takes local installs and still does not give a contractor or homeowner a scaled 1/4" = 1'-0" ANSI B blueprint PDF, a layered AutoCAD DXF, or an accurate framing and drywall material takeoff.&lt;/p&gt;

&lt;p&gt;When building &lt;a href="https://www.plumbdraft.com/studio" rel="noopener noreferrer"&gt;PlumbDraft&lt;/a&gt;, we decided to split the problem cleanly: let humans or AI agents describe walls and openings in US imperial inches, and let a deterministic TypeScript CAD kernel handle every geometric invariant, clearance rule, 3D extrusion, and vector export.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Treating a Floor Plan as a Planar Wall Graph (Not a Bag of Rectangles)
&lt;/h2&gt;

&lt;p&gt;Consumer floor-plan apps often model rooms as independent rectangles. That breaks down the moment you draw an L-shaped kitchen, share a 4.5" interior partition between a bedroom and a closet, or cut a 36" entry door through a 6" exterior stud wall.&lt;/p&gt;

&lt;p&gt;Instead, PlumbDraft stores walls as segments &lt;code&gt;(x1, y1) -&amp;gt; (x2, y2)&lt;/code&gt; in integer/decimal inches with wall thickness (&lt;code&gt;6"&lt;/code&gt; exterior, &lt;code&gt;4.5"&lt;/code&gt; interior) and host-relative openings (&lt;code&gt;wallId&lt;/code&gt;, &lt;code&gt;offsetIn&lt;/code&gt;, &lt;code&gt;widthIn&lt;/code&gt;, &lt;code&gt;swingDir&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;When &lt;code&gt;compileFloorPlan(plan)&lt;/code&gt; runs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Endpoints within snap tolerance merge cleanly into shared graph vertices, and T-junction intersections split crossing walls automatically.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;detectRoomsFromWalls()&lt;/code&gt; extracts minimal closed interior cycles from the planar wall graph to compute exact net square footage and perimeter linear feet.&lt;/li&gt;
&lt;li&gt;For non-convex polygons (like L-shaped living/dining zones or wrap-around hallways), &lt;code&gt;computeInteriorLabelPoint()&lt;/code&gt; searches strictly inside the polygon so room labels and area readouts never drift into an adjacent room or wall.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  2. Automated Architectural Clearance Audits &amp;amp; Material Takeoffs
&lt;/h2&gt;

&lt;p&gt;Because every wall, door swing arc, window opening, and fixture footprint lives in real imperial inches, engineering checks become plain deterministic math rather than LLM guesswork:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hallway width checks:&lt;/strong&gt; flags passageways narrower than 36".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Door swing conflict checks:&lt;/strong&gt; detects overlapping door arcs or fixtures obstructing clearance zones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kitchen work-aisle checks:&lt;/strong&gt; flags counter-to-island clearances tighter than 42" (single-cook) or 48" (two-cook).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Material takeoff (&lt;code&gt;calculateMaterialTakeoff&lt;/code&gt;):&lt;/strong&gt; derives net flooring square footage (plus waste allowance), 4x8 drywall sheet count from wall face area minus door/window rough openings, top/bottom plates and stud counts, linear baseboard trim, paint gallons, and structured door/window schedules.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Pure TypeScript Vector Exporters (Zero Native Binaries)
&lt;/h2&gt;

&lt;p&gt;Running CAD exports on edge workers means no headless Chromium, no LibreOffice, and no native C++ bindings. Both deliverable formats are emitted directly from the compiled wall graph in pure TypeScript:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Layered AutoCAD R12 DXF (&lt;code&gt;exportFloorPlanDxf&lt;/code&gt;):&lt;/strong&gt; writes standard &lt;code&gt;HEADER&lt;/code&gt;, &lt;code&gt;TABLES&lt;/code&gt;, and &lt;code&gt;ENTITIES&lt;/code&gt; sections with AIA architectural layers (&lt;code&gt;A-WALL&lt;/code&gt;, &lt;code&gt;A-DOOR&lt;/code&gt;, &lt;code&gt;A-WIND&lt;/code&gt;, &lt;code&gt;A-FURN&lt;/code&gt;, &lt;code&gt;A-DIMS&lt;/code&gt;, &lt;code&gt;A-ANNO&lt;/code&gt;) so files open cleanly in AutoCAD, AutoCAD LT, QCAD, LibreCAD, and SketchUp. You can inspect real sample R12 DXF output directly on &lt;a href="https://www.plumbdraft.com/developers" rel="noopener noreferrer"&gt;plumbdraft.com/developers&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2-Sheet 1/4" = 1'-0" Scaled Blueprint PDF (&lt;code&gt;exportBlueprintPdf&lt;/code&gt;):&lt;/strong&gt; generates exact vector PDF drawing commands sized to ANSI B (11"x17") or US Letter (8.5"x11") at true architectural scale (18 PDF points per real-world foot at 1/4" = 1'-0"), complete with dimension strings, north arrow, title block, and Sheet A1.1 room/door/window schedules.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Zero-Install Hosted MCP Server for Claude, Cursor &amp;amp; AI Agents
&lt;/h2&gt;

&lt;p&gt;Instead of forcing every developer to install local Python or Blender addons, PlumbDraft exposes the exact same CAD engine over a hosted &lt;strong&gt;Streamable HTTP MCP server&lt;/strong&gt; (&lt;code&gt;https://www.plumbdraft.com/mcp&lt;/code&gt;, registered as &lt;code&gt;com.plumbdraft/cad&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Connect it in one command in Claude Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add --transport http plumbdraft https://www.plumbdraft.com/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or with universal &lt;code&gt;add-mcp&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx add-mcp &lt;span class="s1"&gt;'https://www.plumbdraft.com/mcp'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or in Claude Desktop / Cursor JSON config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"plumbdraft"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://www.plumbdraft.com/mcp"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What works free with zero API key:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;compile_floorplan_geometry&lt;/code&gt;: compiles imperial walls, openings, and rooms into closed polygons, validates geometry, and returns a &lt;strong&gt;live shareable 2D + 3D browser preview link&lt;/strong&gt; (&lt;code&gt;/p/&amp;lt;id&amp;gt;&lt;/code&gt;) that the user can open immediately.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;validate_clearance_ergonomics&lt;/code&gt;: runs hallway, door-swing, and kitchen aisle checks.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;calculate_material_takeoff&lt;/code&gt;: computes flooring, 4x8 drywall sheets, framing lumber, trim, paint, and schedules.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;export_blueprint_dxf&lt;/code&gt; / &lt;code&gt;export_blueprint_pdf&lt;/code&gt;: even without an API key, stages the validated plan to a live &lt;code&gt;/p/&amp;lt;id&amp;gt;&lt;/code&gt; studio preview with a one-click unlock link; with a Bearer API key (&lt;code&gt;$39&lt;/code&gt; Builder 5-Pack includes 50 API/MCP credits), returns the raw &lt;code&gt;.DXF&lt;/code&gt; or base64 scaled Blueprint &lt;code&gt;.PDF&lt;/code&gt; bytes inline directly to the agent.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try It Directly (No Sign-Up Required)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Interactive 2D/3D CAD Studio: &lt;a href="https://www.plumbdraft.com/studio" rel="noopener noreferrer"&gt;plumbdraft.com/studio&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;12 US Imperial Starter Templates (ADUs, kitchens, apartments, offices): &lt;a href="https://www.plumbdraft.com/templates" rel="noopener noreferrer"&gt;plumbdraft.com/templates&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Claude &amp;amp; Cursor MCP Setup Guide: &lt;a href="https://www.plumbdraft.com/tools/claude-mcp-floor-plan-cad" rel="noopener noreferrer"&gt;plumbdraft.com/tools/claude-mcp-floor-plan-cad&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;REST API Playground &amp;amp; Live DXF Inspector: &lt;a href="https://www.plumbdraft.com/developers" rel="noopener noreferrer"&gt;plumbdraft.com/developers&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Drafting, 3D walkthroughs, cloud save, and free MCP geometry/clearance/takeoff calls cost $0. When you actually need clean unwatermarked Blueprint PDF, High-Res PNG, CSV takeoff, and AutoCAD DXF files for a project, unlocking a single project is $14 one-time (no recurring subscription, 30-day refund).&lt;/p&gt;

&lt;p&gt;Happy to answer questions in the comments about planar wall-graph cycle detection, DXF R12 quirks across CAD viewers, or hosting Streamable HTTP MCP servers on Cloudflare Workers.&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>typescript</category>
      <category>claude</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
