
Loading

Loading
We use strictly necessary cookies to run this site, and analytics cookies to understand how it's used. See our Privacy Policy for details.

If you try to render an architectural floor plan on HTML5 or in SVG by stroking thick centerlines (ctx.lineWidth = wallThickness), the drawing breaks down on the very first house you load: Notched L-corners: lineCap = 'butt' leaves a triangular bite out of every exterior corner.
Summary
Mixed-thickness mismatches: When a 6.5" exterior insulated wall meets a 4.5" interior drywall partition, lineJoin = 'miter' cannot even run because they are separate strokes with different thicknesses. 3D Z-fighting at T-junctions & X-junctions: Extending every wall segment to the shared centerline vertex makes overlapping coplanar faces flicker in WebGL and produces broken overlaps in AutoCAD .DXF and .OBJ exports. Hacking door & window cutouts: Painting a white rectangle over a dark wall stroke works poorly in 2D (it smears grid lines and room fills) and does nothing for 3D wall piers, window sills, and door headers.
In PlanCaliber, every wall is compiled into exact mitered 2D quads and analytic 3D solid pieces (WallSolidPiece) using one deterministic joint solver in pure TypeScript — zero CSG boolean libraries, zero flickering seams. Here is the exact math and edge-case handling behind computeWallEndCap and buildSolvedWalls. Step 1: Collect Oriented Incident Walls at Every Vertex For every vertex in the floor plan, build an adjacency list of incident walls with unit vectors pointing outward from that joint: From here, every wall endpoint falls into one of four clean topological cases based on others = incident.filter(i => i.wall.id !== wall.id).
Step 2: Mixed-Thickness L-Corner Miters (With Acute-Angle Clamp) When others.length === 1 and the two walls are not collinear (dot >= -0.985), each wall has two parallel boundary lines offset by ± thicknessIn / 2 from its centerline. By intersecting the matching left-side offset lines and right-side offset lines via 2D line intersection, a 6.5" exterior wall and a 4.5" partition meet cleanly at an exact miter point — no gap on the outside, no overhang on the inside: Notice the 2.2 × maxThickness miter limit: if a user drags an angled bay wall to a very tight acute corner, the solver falls back to a clean bevel cap instead of firing a 4-foot needle off the sheet. Step 3: Priority Trimming at T-Junctions & X-Junctions Once a vertex has degree >= 3, miter intersections no longer apply — you need clean architectural butt-trimming so walls never overlap: T-junction: One pair of incident walls is collinear (dot < -0.97).
That collinear pair is the through-wall (trimDistIn = 0). The perpendicular stem wall trims back by maxPerpHalfT (half the through-wall's thickness) so its drywall butts flush against the through-wall's face. X-junction: Two collinear pairs cross.
We rank by structural priority (exterior = 3, interior = 2, half_wall = 1, deterministic ID tie-break). The higher-priority wall runs unbroken; the lower-priority crossing wall trims back by higherCross.wall.thicknessIn / 2. That eliminates 100% of overlapping faces in Three.js 3D cutaways AND prevents duplicate double-lines when exporting to AutoCAD .DXF and vector PDFs.
Step 4: One Cap Solver Feeds Both 2D Cutouts & 3D Piers/Sills/Headers Once startCap and endCap are computed, slicing a wall around its hosted doors and windows becomes a simple 1D interval sweep from effStart to effEnd: Walk the sorted hostedOpenings along the wall: Solid pier before/between/after openings: quadForSpan(cursor, opening.s, ...) -> full height 0 to wallH (9'-0"), drawn as crisp filled poché in 2D and extruded as a solid prism in 3D. Door opening (sillHeightIn = 0): Empty gap in 2D (where the door leaf and 90° quarter-circle swing arc render cleanly over the floor fill!) + one 3D header lintel box from 80" (6'-8") to 108" (9'-0"). Window opening (sillHeightIn = 36", headHeightIn = 84"): Crisp glass & frame lines in 2D + two analytic 3D solids (sill wall 0" -> 36", header wall 84" -> 108").
Zero CSG mesh booleans, zero degenerate triangles, and every 2D opening aligns to the exact sixteenth of an inch with the 3D cutaway. Step 5: Free Bonus — Clear Drywall-to-Drywall Interior Span Because computeWallEndCap already computes each perpendicular wall's intrusion (perpInsetIn = otherHalfT * sinAngle), you immediately get the true clear interior wall length: When a user lays out a 12'-0" centerline kitchen wall bounded by two 6.5" exterior walls, the cabinetry and clearance engine automatically knows the clear drywall-to-drywall run is 11'-5 1/2" — preventing cabinets or appliances from colliding with corner framing. Test the Miter & Cutaway Engine Live You can drag walls, place mixed-thickness partitions, cut doors and egress windows, and watch the 2D poché, 3D cutaway, and scaled 1/4" = 1'-0" blueprint PDF update live in your browser (free to draft and inspect): Open the Blueprint & DXF Studio: PlanCaliber Blueprint & AutoCAD .DXF Maker Try AI Sketch-to-CAD: Convert a Hand Sketch or PDF to Scaled CAD Check Print Scale Math: Free Architectural Floor Plan Scale Calculator Note: PlanCaliber generates preliminary space-planning drawings; always verify final dimensions and code compliance on site before construction.
KazaSec's take
AI-related security incidents are a genuinely new category, prompt injection, model manipulation, and data leakage through an LLM integration don't map cleanly onto traditional application security testing, and are worth assessing deliberately rather than assuming existing controls already cover them.
Coverage details
We've archived 59 other articles touching the same topic (algorithms, webdev, programming) , see the full security news archive.
Relevant from KazaSec
More coverage on this topic
We help organizations find and fix the gaps before they make headlines.