Skip to content

About

Deterministic IRC R311.7 & IBC 1011 multi-flight stair, headroom cutout, LVL stairwell framing & balustrade plugin for Pascal Editor (24 MIT 3D CAD .glb models)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Pascal Plugin Stairs (@kruschdev/pascal-plugin-stairs)

License: MIT Pascal Plugin API v1 Kernel MIT 3D CAD Models 12-Rule IRC/IBC Code Gate

An open-source, MIT-licensed Deterministic IRC R311.7 / R312.1 / IBC 1011 Multi-Flight Stair & Balustrade Engineering plugin for Pascal Editor (pluginId: krusch:stairs).

I built this plugin to solve the structural and architectural gaps of vertical circulation in web-based CAD. While upstream Pascal provides foundational StairNode and StairSegmentNode primitives, real multi-story homes require multi-flight solvers that fit bounded stairwell bays, enforce zero riser variance across landings, cut exact 6'-8" headroom openings in floor slabs, frame code-compliant trimmer headers, split upper-floor handrails during dollhouse cutaways, and quantify expensive CSI Division 05/06 millwork in the project bill of materials.

Pascal Plugin Stairs Social Preview

Pascal Plugin Stairs Walkthrough Demo

Pascal Plugin Stairs 4-Panel 3D Cutaways Showcase

Why a Dedicated Stair Plugin?

In architectural drafting, stairs are frequently treated as simple decorative 2D ramps. In actual construction, stairs represent one of the most litigated, code-dense, and geometrically unforgiving assemblies in the entire building. Upstream @pascal-app/core explicitly notes in its schema documentation that its designTargets are "optional riser, going and headroom preferences in metres, not code certification".

I created @kruschdev/pascal-plugin-stairs to turn stairs into deterministic, code-certified structural engineering assemblies that coordinate directly with framing, slabs, and MEP runs.

Architectural & Engineering Feature Matrix

Feature / Architectural Scope Built-In @pascal-app/core (StairNode) @kruschdev/pascal-plugin-stairs (krusch:stairs)
Bay-Constrained Multi-Flight Solver Single straight flight only (children: [flight.id]). Multi-segment chains require manual positioning. Deterministic solver for straight, l-turn, u-turn (switchback with daylight well gap), and 3-step quarter-turn winder bays.
Riser Variance & Code Certification Advisory preferences only (riserTarget, goingTarget). Allows arbitrary per-flight step variations. Strict certification (STR-IRC-00 through STR-IRC-11). Enforces IRC R311.7.5.1 maximum riser (7-3/4" / 0.1969 m), minimum tread (10" / 0.254 m), and max variance (<= 3/8" / 0.0095 m) across all flights.
Headroom Cutouts & Floor Framing Does not cut upper floor slabs or ceilings. Upper levels remain solid over stair wells. Headless 6'-8" (2.032 m) projection that writes exact clearance polygon holes into upper SlabNode.holes and CeilingNode.holes, accompanied by an IRC R502.10 doubled LVL stairwell trimmer and header assembly (stairs:trimmer-header).
Cutaway-Clean 3D Millwork Basic volumetric risers and treads without species texturing, hardware, or cutaway-aware upper rails. Clean-room procedural 3D millwork across 6 construction styles and 6 guard systems. Upper-level handrails are flagged (isUpperStairRail) and suppressed during 1F dollhouse cutaway rendering so 2F rails never float in mid-air.
Mezzanine & Open-Well Gallery Guards None. Guardrails exist only as side properties on individual stair flights. Standalone stairs:guardrail node supporting custom polygonal balustrade runs around floor well openings with IRC R312.1 4-inch sphere baluster spacing.
CSI Div 05 / 06 / 09 Bill of Materials Unpriced volumetric count. Treads, risers, stringers, newels, hardware, and drywall under-soffits are omitted from cost rollups. Complete CSI Div 06 43 00 (Wood Stairs), 05 51 00 (Metal Stairs), and 09 29 00 (Gypsum Soffits) priced BOM (pascal-bom/1.2) with @kruschdev/pascal-mep-kernel CallerInjectedPart per-node overrides.
Autonomous Agent Tools & Symbols None. 8 pure Zod agent tools (E-016) for automated headless floorplan generation, plus 2D diagonal stair cut lines (UP NR ->).

24 Clean-Room MIT Stair & Balustrade CAD Models

Key Architectural Capabilities

1. Bay-Constrained Multi-Flight Sizing

Given floor-to-floor total rise and a target stairwell bay (length and width), the solver deterministically distributes riser counts, tread depths, and intermediate landing elevations. For switchbacks (u-turn), it calculates the daylight stairwell gap between flights (0.05 m to 0.15 m) and ensures landing length measured in the direction of travel equals or exceeds the flight walk width (IRC R311.7.6). For winder configurations, it calculates tread depth at the standard 12-inch (0.305 m) walkline while maintaining a minimum 6-inch (0.152 m) tread width at the narrow edge (IRC R311.7.5.2.1).

2. Deterministic 12-Rule Code Certification (STR-IRC-00 through STR-IRC-11)

The plugin audits whole scenes against residential (IRC 2024) and light-commercial (IBC 2024) codes:

  • STR-IRC-00: Multi-storey building egress continuity (flags buildings with >= 2 habitable levels missing a stair, IRC R311.7 / IBC 1006).
  • STR-IRC-01: Riser height bounds (4.00" to 7.75" residential, 4.00" to 7.00" commercial) and flight-to-flight riser uniformity (<= 3/8" variance, IRC R311.7.5.1).
  • STR-IRC-02: Minimum tread going (>= 10.00" residential, >= 11.00" commercial) and winder 12-inch walk-line / 6-inch narrow-end checks (IRC R311.7.5.2).
  • STR-IRC-03: Minimum clear stair width (>= 36.0" residential, >= 44.0" commercial, IRC R311.7.1).
  • STR-IRC-04: Top arrival elevation alignment against destination floor datum (<= 35 mm tolerance).
  • STR-IRC-05: Vertical 6'-8" (2.032 m) headroom clearance through upper SlabNode.holes plus solid walkable slab arrival (+0.35 m past top nosing, IRC R311.7.2).
  • STR-IRC-06: Intermediate landing travel dimension (>= 36.0" / 44.0", IRC R311.7.6) and zero flight centerline wall-slice collisions.
  • STR-IRC-07: Viewer multi-segment rendering and isUpperStairRail cutaway rail clipping hygiene.
  • STR-IRC-08: Maximum single-flight vertical rise between landings (<= 151" IRC R311.7.3 / <= 144" IBC 1011.8).
  • STR-IRC-09: Handrail height (34" to 38", IRC R311.7.8.1) and presence on flights with >= 4 risers (>= 2 IBC).
  • STR-IRC-10: Open-side guard height (>= 36" IRC R312.1.2 / >= 42" IBC 1015.3) and < 4" sphere opening compliance on stair and gallery guards.
  • STR-IRC-11: Notched wood stringer minimum effective throat (>= 5.0" per AWC DCA 6), horizontal span limits, and IRC R302.7 enclosed under-stair gypsum fire protection.

Documentation

Guide What It Covers
Why a Dedicated Stair Plugin? Deep dive into the 6 architectural and structural failure modes across 246 Pascal scenes, headroom ray math, and notched stringer throat formulas
24-Model MIT 3D CAD Catalog Full inventory of all 24 procedural .glb stair, balustrade, Simpson hardware, and code cutaway models
Media Kit & Launch Copy Social preview (1280 x 640), 4-panel studio cutaways, CAD contact sheet, and ready-to-post launch copy

3. Automated Slab Headroom Cutouts and Trimmer Headers

Upper floors must not collide with stair clearance envelopes. The plugin projects a 3D ray envelope along the stair slope and automatically updates the destination SlabNode.holes and CeilingNode.holes. It generates an associated stairs:trimmer-header node specifying doubled LVL or 2x10/2x12 boundary framing, Simpson Strong-Tie LSCZ stringer connectors, and HUS210-2 / HHUS410 joist hangers.

4. Cutaway-Aware 3D Millwork

When viewing a ground-floor architectural cutaway (dollhouse view), standard BIM handrails that rise to the second floor often protrude into empty air. This plugin splits upper handrail segments at the level boundary (isUpperStairRail), automatically hiding upper-floor rail geometry when the camera peels lower levels.

5. Construction and Guard Styles

The plugin supports 6 primary construction archetypes and 6 railing configurations:

  • Construction Styles: White Oak Open-Stringer, Housed Box Oak, Mono-Steel Center Spine, Floating Cantilever, Poured Architectural Concrete, and Pressure-Treated Exterior Deck.
  • Guardrail Styles: Square Wood Picket, Turned Colonial Baluster, Stainless Horizontal Cable, Frameless Low-Iron Laminated Glass, Modern Flat-Bar Steel, and Craftsman Square-Panel.

6. CSI Division Priced Bill of Materials

Staircases represent thousands of dollars in high-finish architectural woodwork and hardware. Across the 5 multi-storey open-source Pascal Community Homes (pacific-northwest-aframe, modern-farmhouse-2story, nordic-minimalist-barnhouse, urban-row-townhouse, and coastal-stilted-beach-house), staircases account for $7,948 to $15,871 per home ($49,832 total across 6 staircases) that was previously unpriced across Structural, Plumbing, HVAC, Electrical, Surfaces, and Furnishings. The built-in pricing engine outputs pascal-bom/1.2 structural fragments covering hardwood treads, risers, cove mouldings, cut carriages, center steel spines, newels, balusters, wall handrail brackets, Simpson connectors, and Type X or 1/2" drywall under-soffits. Per-node custom parts are injected cleanly via @kruschdev/pascal-mep-kernel without modifying upstream schemas.

Subpath Exports and Package Architecture

This plugin enforces clean architectural entrypoints to keep bundles lightweight:

Entrypoint Export Purpose / Boundary Guarantee
. stairsPlugin, stairsHostPanel, stairsScheduleView, stairsChatExtension, stairsInspectorExtensions Full Pascal Editor suite (host panels, schedule views, inspector tools, and chat cards).
./render stairsRenderPlugin Lightweight, viewer-only manifest. Zero imports from @pascal-app/editor or Next.js.
./irc solveStairGeometry, auditSceneStairs, generateStairsBom, etc. Pure TypeScript engineering logic. Zero imports from Three.js, React, or @pascal-app/*.
./solver solveStairGeometry, computeSegmentTransforms, etc. Mirror of ./irc mathematical solver utilities. Zero Three.js or DOM dependencies.
./cad STAIRS_CAD_CATALOG, buildArchitecturalStair3D, buildBalustradeRun3D Three.js procedural CAD mesh generators. Zero imports from React or @pascal-app/editor.
./agent-tools stairsAgentTools 8 pure Zod-schema agent tools conforming to Pascal E-016 agent standards.
./agent-operations stairsAgentOperations Headless scene manipulation handlers returning uniform { ok, changes, data } envelopes.

Quick Start

Installation

npm install @kruschdev/pascal-plugin-stairs
# or
bun add @kruschdev/pascal-plugin-stairs

Registering in Pascal Editor

import { extendPluginDiscovery } from '@pascal-app/core'
import { registerEditorHostPanel, registerEditorHostView } from '@pascal-app/editor'
import {
  stairsPlugin,
  stairsHostPanel,
  stairsScheduleView,
} from '@kruschdev/pascal-plugin-stairs'

extendPluginDiscovery(async () => [stairsPlugin])
registerEditorHostPanel(stairsHostPanel)
registerEditorHostView(stairsScheduleView)

Registering in a Read-Only Viewer

import { setPluginDiscovery } from '@pascal-app/core'
import { stairsRenderPlugin } from '@kruschdev/pascal-plugin-stairs/render'

setPluginDiscovery(async () => [stairsRenderPlugin])

Agent Tools (E-016)

The plugin exports 8 headless Zod agent tools for autonomous pipelines and MCP servers:

  1. stairs_solve_and_place: Solves IRC/IBC multi-flight geometry, places the stair and assembly, cuts upper slab headroom holes, and adds structural trimmer headers.
  2. stairs_autopopulate_scene: Scans all buildings in a scene, inserts required stairs between connected floor levels, cuts slab openings, and places perimeter balcony guardrails.
  3. stairs_cut_headroom_opening: Computes and punches exact 6'-8" headroom polygon cutouts into upper SlabNode.holes and CeilingNode.holes.
  4. stairs_place_balcony_guard: Places custom stairs:guardrail runs along open stairwells, balconies, and mezzanine edges.
  5. stairs_configure_assembly: Modifies structural and millwork parameters (construction style, rail style, lumber stock, wood species) on an existing stair.
  6. stairs_audit_irc: Runs the deterministic 12-rule STR-IRC-00 through STR-IRC-11 compliance audit against all stairs in the scene.
  7. stairs_generate_schedule: Produces a complete 5-table engineering schedule (Geometry, Framing, Guards, Code Audit, Priced BOM).
  8. stairs_export_bom: Generates CSV, Markdown, or pascal-bom/1.2 structured bill of materials.

Development and Verification

bun install
bun run check          # Runs type checks, unit tests, render boundary probes, and production build
bun test src           # Runs deterministic solver, audit, CAD, and BOM pricing test suites
bun run export:cad     # Re-exports all 24 clean-room binary .glb models to assets/cad/
bun run render:catalog # Re-renders the CAD contact sheet

Engineering Disclaimer

All calculations, riser/tread distributions, stringer sizing recommendations, fire-blocking suggestions, and bill of materials estimates generated by this plugin are deterministic pre-engineering aids. They must always be reviewed and approved by a licensed architect, structural engineer, or local authority having jurisdiction (AHJ) prior to fabrication or construction.

License

MIT. Created by @kruschdev.

About

Deterministic IRC R311.7 & IBC 1011 multi-flight stair, headroom cutout, LVL stairwell framing & balustrade plugin for Pascal Editor (24 MIT 3D CAD .glb models)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages