Repository navigation
feat(elements): contain elements naming two Levels in their base constraint's storey (#365) (RE-59) - #368
Merged
Conversation
…traint's storey (#365) (RE-59) A partition element record naming two Levels names its base and top constraint, in no fixed order. The base is the higher of the two at or below the record's base, else the lower. That is the storey Revit's own export contains the element in on 650 of 650 Snowdon records, 482 of 482 on Core Interior and 7 of 7 on RE1. With it, Core Interior binds all 970 building elements, each in Revit's storey. Snowdon has 5,612 elements in Revit's storey (3,975 before) and 294 on none (1,931 before). The tutorial house goes from 230 elements on no storey to 1.
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_a8d1caf5-b08f-4220-95d8-97e705465a6c) |
This was referenced Sep 24, 2026
Closed
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
An element whose partition element record names two Levels, its base and top constraint, is now contained in its base constraint's storey (RE-59). The base constraint is the higher of the two Levels at or below the record's base, else the lower.
RE-27 declined these records, because the reference list does not order the two: the lower Level comes first on 452 of Snowdon's two-Level records and second on 198. Such elements fell back to matching their box base against storey elevations. That fallback misses:
The rule gives the storey Revit's own IFC export uses on every record that names two Levels:
Per element, against Revit's own containment (
tools/re/storeys_vs_ifc.py; a part takes its aggregate whole's storey):Changes
named_levelsandbase_constraint_level;CONSTRAINT_LEVELS_FIELD,LEVEL_BIND_SOURCE_FIELDandBASE_CONSTRAINT_SOURCE;element_record_decodedkeeps a two-Level record's pair;resolve_base_constraint_levelsbinds the base constraint from the Levels' own elevations (RE-51).LevelBindSourcecarriespartition_element_record_base_constraintfor those elements.apply_record_level_reference_storeys.core_interior_2024_storey_containment_is_evidence_backedpins the new measured state: 970 of 970 bound, all through the record's Level, none on the building.record-level-reference-storey-bind, whose reference side is now measured;Testing
End to end, against real files. No new tests; one existing corpus test's pinned numbers move to the new measurement.
rvt-ifcon the same files, thentools/re/storeys_vs_ifc.pybefore and after (the second table). The report's §3 has the inputs' sha256 and the output.--compare-committed,--witness-agreementholds, andifcopenshell.validatereports nothing.--profile ci;cargo +1.85.0 checkand the fuzz workspace check.What this does not do
IfcBuilding.Audit-honesty checklist
Legal and contribution hygiene
Related issues
Closes #365. Refs #219, #33.
Note
Medium Risk
Changes how IFC spatial containment is assigned for a large class of elements (walls, columns, stairs, curtain walls); behavior is evidence-backed against Revit exports but affects export structure and downstream storey grouping.
Overview
Storey containment now resolves two-Level element records instead of leaving them on elevation fallback or unplaced. When a partition element record names exactly two Levels (base and top constraint, in no fixed order), the exporter picks the base constraint: the higher Level at or below the record's base elevation, otherwise the lower. That Level becomes
m_levelIdwith bind sourcepartition_element_record_base_constraint, and IFC containment follows the existing record-level-reference path.Impact: Core Interior goes from 969/970 to 970/970 building elements on a named storey (including the last wall that named no single Level). Snowdon Towers gains ~1,637 elements in Revit-matching storeys; elements with no Level in the record still land in
IfcBuilding. Records with three+ Levels stay unresolved.Tooling and evidence: Adds
named_levels/base_constraint_level,resolve_base_constraint_levelsin the partition MVP,LevelBindSourceon export, probeprobe_re59_base_constraint_levels, scorertools/re/storeys_vs_ifc.py, RE-59 report, and updated corpus test / witness JSON / docs.Reviewed by Cursor Bugbot for commit b2bcf61. Configure here.