@adatechnology/game-floorplan-structure

中文文档
2.1.7发布于 2026/11/08MITTypeScriptES Module构建来源已验证近 30 天下载 3554

Structure pack for @adatechnology/game-floorplan: construction systems (masonry, wood frame, log, improvised, canvas), the load path of every plan (roof, trusses, beams, pillars, bearing walls, foundation, porches), the destructible spec of the structure,

原始使用文档

@adatechnology/game-floorplan-structure

Structure pack for @adatechnology/game-floorplan: construction systems, the load path of every plan and its DestructibleSpec.

import { engine } from '@adatechnology/game-floorplan'
import { register } from '@adatechnology/game-floorplan-structure'

register(engine)
const plan = engine.generate('townhouse', { seed: 7 })
plan.structure.parts // the parts that carry load, each with role, material, box, mass
plan.structure.supports // what each part rests on, down to 'ground'

A free-standing wall: buildStructure(plan, { roof: false }) leaves the roof out, so a plan with one exterior wall stands as a house wall does (on the strip footing, with the bond beam on it). wallPiece of game-floorplan-three builds and draws such a wall; every wall of a scene or a game is made that way.

Structural validation: validateStructure(structure, { doors, wallDetail }) checks a structure as a structural engineer would sign it and returns typed violations ({ code, part, message }, codes in STRUCTURAL_VIOLATION): load paths (FLOATING_PART, PILLAR_NOT_GROUNDED), reinforced concrete by NBR 6118 (CONCRETE_BELOW_MIN_SECTION: pillars of 19 cm and 360 cm², beams 12 cm wide and L/10 deep between point supports; UNREINFORCED_CONCRETE; BEAM_ON_WEAK_MASONRY) and, in masonry, confined masonry: MISSING_GROUND_BEAM, WALL_END_WITHOUT_PILLAR, CORNER_WITHOUT_PILLAR, WALL_JUNCTION_WITHOUT_PILLAR, WALL_SPAN_WITHOUT_PILLAR (more than MAX_PILLAR_SPACING, 4 m), PILLAR_DOES_NOT_REACH_BOND_BEAM, MISSING_BOND_BEAM, OPENING_WITHOUT_LINTEL, OPENING_WITHOUT_SILL, UNBONDED_MASONRY, MISSING_PLASTER. validateSpec(spec) checks a spec built straight (towers, skyscrapers) for load paths and sections; countViolations tallies them. Every typology of the floorplan packages runs through it in its tests/construction.test.ts:

const plan = engine.generate('townhouse', { seed: 7 })
validateStructure(plan.structure, { doors: plan.doors }) // [] : nothing a structural engineer would refuse

A masonry house stands on reinforced concrete ground beams (ground_beam_*, viga baldrame, GROUND_BEAM_DEPTH deep, buried, anchored in the spec; groundBeams: false leaves them out), with concrete pillars from the floor to the bond beam, a lintel over every opening (h = L/10, the wide doors on jamb pillars) and a sill beam (_sillbeam_, SILL_BEAM_DEPTH) under every window.

Tall buildings: buildTower() builds a frame with continuous columns, a concrete core with stairs and elevator shafts, a glass curtain wall, a flat roof with its membrane and the mechanical floor (addCore, addCurtainWall, addFlatRoof, addMechanicalFloor add each one to any frame spec). Wind: buildTower({ wind: { speed, terrain }, damper: true }) sizes the tower for the wind and adds a tuned mass damper (addTunedMassDamper, DAMPER_DEFAULTS) on the mechanical floor; both are off by default. The world needs createDestruction({ wind: {} }).

Skyscrapers: buildSkyscraper({ storeys, height, bay, facade, ... }, preset) turns a handful of numbers (SKYSCRAPER_DEFAULTS: 40 storeys, 3.6 m, 12 m bays, curtain wall, a plant floor every 20, a damper above 150 m, city wind, piles to the sand under soft clay) into the tower: columns and beams sized by the load, the core sized by the height (walls never thicker than a third of the storey, bars closer on the tall ones), a relay plant floor every N storeys (mechanicalEvery), a curtain wall or a punched masonry facade (facade: 'punched', addPunchedFacade), and piles for the load and the soil (pilesFor, PILE_DEFAULTS). skyscraperLayout gives just the numbers, and towerPlate / towerFloors / exteriorWindows the room-level plan of the same layout, which game-floorplan-commercial (office_tower) and game-floorplan-residential (residential_tower) fill with rooms. Every number is an option of the layout or a field of the preset.

See .claude/skills/game-floorplan-structure/SKILL.md for the API and MIGRATION.md for the names the Visor de casas 3D used.

版本与发布记录

@adatechnology/game-floorplan-structure 共发布 28 个版本,首次发布于 2026/10/24;过去 12 个月发布了 28 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.1.7latest2026/11/08今天
2.1.62026/11/07今天
2.1.52026/11/07今天
2.1.42026/11/07今天
2.1.32026/11/07今天
2.1.22026/11/071 天前

关于 @adatechnology/game-floorplan-structure 的常见问题

@adatechnology/game-floorplan-structure 是什么?

Structure pack for @adatechnology/game-floorplan: construction systems (masonry, wood frame, log, improvised, canvas), the load path of every plan (roof, trusses, beams, pillars, bearing walls, foundation, porches), the destructible spec of the structure,

如何安装 @adatechnology/game-floorplan-structure?

在项目目录运行 npm install @adatechnology/game-floorplan-structure,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@adatechnology/game-floorplan(^0.3.9)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@adatechnology/game-floorplan-structure 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@adatechnology/game-floorplan-structure 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@adatechnology/game-floorplan-structure 可以商用吗?

@adatechnology/game-floorplan-structure 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@adatechnology/game-floorplan-structure 的下载量有多少?

根据 npm 官方下载统计,@adatechnology/game-floorplan-structure 在 2026/10/05 – 2026/11/03 这 30 天内被下载 3,554 次,日均约 118 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adatechnology/game-floorplan-structure 还在维护吗?

最新版本 2.1.7 发布于 2026/11/08(今天);至今共发布 28 个版本,其中过去 12 个月发布了 28 个;首次发布于 2026/10/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。