Repository navigation
feat(ifc): export stairs as aggregates of their runs, landings and stringers (#323) (RE-39) - #325
Merged
Merged
Conversation
…ringers (#323) (RE-39) A stair's runs, landings and stringers name the stair's ElementId in their reference lists. Each stair now exports as an IfcStair with no body of its own, related by IfcRelAggregates to its IfcStairFlight runs, IfcSlab .LANDING. landings and IfcMember .STRINGER. stringers, as Revit's own IFC4 export does. A part reaches the spatial structure through its stair and is left out of the storey containment. On Snowdon Towers Architectural (local only) the same 26 stairs aggregate as in Revit's export, every one of the 228 parts rvt-rs attaches is in the matching Revit aggregate, and all 256 new elements are Revit's. Railings stay standalone: Revit aggregates 65 of the 70 that name a stair, and nothing read tells the other five apart. Core Interior, the RE1 models and the structural sample export unchanged. IfcEntity::Aggregate carries the relation; the STEP writer emits it after every element id is assigned. examples/probe_re39_stair_parts.rs measures the link; the report is reports/element-framing/RE-39-stair-aggregates.md.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_23372859-239e-441e-8350-3706d9a8401b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stairs now export the way Revit exports them. Each stair is an
IfcStairwith no body of its own, andIfcRelAggregatesrelates it to its runs (IfcStairFlight), landings (IfcSlab.LANDING.) and stringers (IfcMember.STRINGER.). Each part names its stair in its reference list. On Snowdon Towers every aggregate relation rvt-rs writes is one Revit's own export has.Motivation
#323. RE-37 left stairs out because Revit exports them as aggregates, and bounding-box bodies for a stair plus each of its parts would double the volume.
Changes
src/ifc/entities.rs:IfcEntity::Aggregate { whole, parts }.src/ifc/step_writer.rs: oneIFCRELAGGREGATESper aggregate, resolved after all element ids are assigned. A part is left out ofIfcRelContainedInSpatialStructure: it reaches the storey through its whole. An aggregate whose whole is not a building element changes nothing.src/partition_element_records.rs:OST_STAIRS,OST_STAIRS_RUNS,OST_STAIRS_LANDINGSandOST_STAIRS_STRINGER_CARRIAGEjoin the product categories.src/ifc/category_map.rs:StairsRun→IFCSTAIRFLIGHT,StairsLanding→IFCSLAB.LANDING.,StairsStringer→IFCMEMBER.STRINGER..Stair→IFCSTAIRalready existed.src/partition_schema_mvp.rs:attach_aggregate_wholesgives each run, landing or stringer the one exported stair its reference list names (fail closed on none or several).record_referencesis shared with RE-38's name pass.src/ifc/export_content.rs: stairs carry no body, and parts are grouped intoAggregateentities.examples/probe_re39_stair_parts.rs,reports/element-framing/RE-39-stair-aggregates.md, a support-matrix row (experimental, local evidence), README, status, CHANGELOG.Measurements (Snowdon Towers Architectural, local only)
Revit's aggregates hold 67 more parts:
IfcOpenShell reports no issue on the 127,070-instance export, and the schema-arity gate passes. Core Interior, the RE1 models and the Snowdon structural sample export byte-identically, since none has stairs.
Testing
tools/check-local.shcargo +1.85.0 check --profile ci --all-targets,cargo +nightly check --manifest-path fuzz/Cargo.tomlpython -m ifcopenshell.validateandtools/ci/ifc_schema_arity.pyon the Snowdon exportAudit-honesty checklist
experimental: no licensed CI file has stairs.PredefinedTypes are unset because Revit's per-instance values are not decoded.Legal and contribution hygiene
Breaking changes
IfcEntitygains theAggregatevariant. Code that matches every variant must handle it. IfcModel JSON (the viewer's wasm output) can carry{"kind": "Aggregate", ...}rows.Related issues
Refs #323.
Note
Medium Risk
Adds a breaking
IfcEntity::Aggregatevariant and changes IFC spatial containment for stair parts; logic is scoped with fail-closed linking but affects core export and STEP emission paths.Overview
Stairs now export like Revit IFC4: each stair is a bodiless
IfcStair, with runs, landings, and stringers emitted asIfcStairFlight,IfcSlab.LANDING., andIfcMember.STRINGER.and linked viaIfcRelAggregates. Partition decoding adds stair-relatedBuiltInCategoryvalues;attach_aggregate_wholessetsm_aggregate_wholewhen a part’s reference list names exactly one exported stair (ambiguous or missing links stay standalone; railings are intentionally excluded).The export path introduces
IfcEntity::Aggregate, skips extrusion geometry for aggregate wholes, groups parts after the production walk, and the STEP writer emitsIFCRELAGGREGATESwhile omitting aggregate parts from storey containment (spatial structure is reached through the stair). IFC class mappings and docs/support matrix/changelog/probeprobe_re39_stair_partsdocument RE-39 / #323.Reviewed by Cursor Bugbot for commit 7d2b40f. Configure here.