A few hours into launching TrueDraft CAD on Product Hunt today, a maker asked a great question in the comments:
"With the .OBJ export, could you print the house as a little scale model on a Bambu P2S? Split by floor sounds great, you could lift the roof off and look inside."
Exporting a 3D mesh that renders nicely in Three.js is very different from exporting a mesh that slices and prints cleanly on an FDM 3D printer. Instead of leaving it on a roadmap, I wrote a zero-dependency binary .STL architectural compiler in pure TypeScript (src/lib/exporters/stl.ts) and shipped it in TrueDraft CAD v1.4.0 (AGPL-3.0), along with a free interactive Floor Plan to STL Scale & Build-Plate Calculator.
Here are the four geometric problems you hit immediately when turning a 2D/3D architectural floor plan into an FDM-printable .STL, and how we solved them in ~800 lines of client-side TypeScript.
1. Coordinate System, Units, and the 80-Byte Binary .STL Trap
Architectural web CAD engines typically work in real-world meters with Y-up (matching Three.js). Every major FDM slicer (Bambu Studio, OrcaSlicer, PrusaSlicer, and Cura) expects millimeters with Z-up and the model resting flat on z = 0.
Converting a floor plan at scale 1:S (for example 1:100, where 1 m = 10 mm) maps world (x, y, z) to slicer millimeters:
const mmPerMeter = 1000 / scaleDenominator; const xMm = (worldX - originMinX) * mmPerMeter; const yMm = (originMaxY - worldY) * mmPerMeter; // flip 2D canvas Y to preserve right-handed orientation const zMm = worldZ * mmPerMeter; Two subtle details matter in the binary .STL buffer (84 + 50 * triangleCount bytes, little-endian DataView):
- Never start the 80-byte header with
"solid ": Many slicers sniff the first 5 bytes to decide whether a file is ASCII or binary.STL. Starting the header with"TrueDraft CAD Binary STL..."avoids misdetection. - Enforce exact outward unit normals: Every triangle computes
(v1 - v0) × (v2 - v0), normalizes it, and drops degenerate zero-area triangles before writing so slicers never complain about non-finite normals.
2. Why Real Drywall Partitions Vanish on a 0.4 mm Nozzle
A standard US interior partition wall is 4.5 inches (0.1143 m) thick. Look at what happens when you scale it down:
| Scale | 6" Exterior Wall | 4.5" Interior Partition | 0.4 mm Nozzle Behavior |
|---|---|---|---|
1:50 | 3.05 mm | 2.29 mm | Prints solidly |
1:100 | 1.52 mm | 1.14 mm | Borderline: thin walls risk gaps |
1:150 | 1.02 mm | 0.76 mm | Interior walls drop or print brittle |
1:200 | 0.76 mm | 0.57 mm | Below 2 perimeters: vanishes in slicer |
Instead of letting slicers silently delete interior rooms, src/lib/exporters/stl.ts clamps wall thickness in world meters before extrusion:
const minWallMeters = minWallThicknessMm / mmPerMeter; // default 1.2 mm = 3 perimeters on 0.4 mm nozzle const effectiveThickness = Math.max(wall.thickness, minWallMeters); We also emit solid square corner posts wherever walls meet at L-junctions or T-junctions so mitered corners never leave vertical hairline seams, and we deliberately omit fragile floating door leaves and 25 mm window glass planes while keeping real doorway headers (lintels) and window sills as closed 6-face prisms.
3. Solid Bed-Aligned Baseplates (z = 0)
A raw wall shell floating on thin footprints warps off an FDM build plate. TrueDraft CAD ear-clips every detected room polygon (with a rectangular footprint fallback for open walls) and extrudes a solid 1.6 mm baseplate seated strictly at z = 0.0 mm. Every wall starts flush on top of that plate (z = baseplateMm), giving clean first-layer bed adhesion and zero floating overhangs.
4. Split-by-Floor Multi-Story Exports (Lift-Off Study Models)
Printing a 2-story or 3-story house as one fused solid traps support material inside the ground floor and hides the rooms you actually want to inspect.
With compilePlanLevelsToStl(), every story is compiled to its own .STL file with two invariants:
- Independent
z = 0bed seating: Level 1, Level 2, and Basement each start flat atz = 0with their own1.6 mmslab baseplate, so zero interior supports are required. - Shared global XY origin: Every floor uses the exact same
originMinX/originMaxYcomputed across the union of all stories, so when you print Level 1 and Level 2 separately, the upper story stacks cleanly on top of the lower perimeter walls like a real architectural study model.
Try It Free in Your Browser (AGPL-3.0)
- 3D-Print Build-Plate & Scale Calculator (Bambu Lab, Prusa, Ender presets): truedraftcad.com/floor-plan-to-stl
- Live Multi-Story CAD Studio (zero signup): truedraftcad.com/studio?template=two-story-house-1840
- Source Code & v1.4.0 Release (AGPL-3.0): github.com/truedraftcad/truedraft-cad/releases/tag/v1.4.0
If you print a floor plan from TrueDraft CAD or have ideas for roof pitches or magnetic alignment lips between stories, drop a comment or open an issue on GitHub!