Skip to content

fix(elements): write the storey of a project with one Level - #1086

Merged
DrunkOnJava merged 4 commits into
mainfrom
fix/single-level-storey
Oct 29, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
fix/single-level-storey

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

A project with exactly one Level now exports its storey. recovered_levels_are_a_storey_set required at least two Levels; it now requires at least one, and scan_partition_levels keeps a single Level only when scan_partition_level_ids (the broader Level-id scan) also finds exactly one.

Motivation

R2025 01_Walls (puzzbobb's Apache-2.0 models, research/r2025-models.tsv) exports its five walls (2787, 2788, 2789, 2790, 2892) on no storey, while Revit's export of it has IfcBuildingStorey 'Level 1' containing all five. Measure run 40934704557 (probe_re51_level_names, main af50068) shows its one Level decodes whole: 'Level 1', ElementId 1951, 0.0 ft, and the same on 00_Blank, while the four-Level control 02_1Slope recovers all four. The two-Level floor was arbitrary: the one-block-per-Level check is what keeps a partial recovery out, and the broader id scan now covers the one-Level case.

Changes

  • src/partition_level_records.rs: the guard and its doc.
  • changelog.d/fixed/single-level-storey.md.

Testing

Unit tests are banned in this repository: do not add them.

  • tools/check-local.sh: not run locally by policy; CI runs every gate.
  • Verified on real files: Measure run 40942112911 on this head against main with r2025, nordic and samples: of 89 models only r2025-00_Blank and r2025-01_Walls moved (storeys_vs_ifc on 01_Walls: 5 same storey as Revit's; global_ids: storeys 1 of 1 on both). On 00_Blank, NumberOfStoreys moves from missing to different, the pre-26.1 exporter rule tracked in NumberOfStoreys: Revit's exporter before IFC 26.1 counts only storeys that hold an element #1097. Details in a comment.
  • Exporter touched only through the storey set; witness observations do not move on Core Interior (15 Levels).

Audit-honesty checklist

  • Changelog fragment under changelog.d/fixed/.
  • No emojis, private paths or internal jargon.

Legal and contribution hygiene

  • Apache-2.0; no Autodesk material; no fixtures.

Breaking changes

None.

Related issues

None open; found by the 2026-10-29 identity sweep. Related: #1097.

recovered_levels_are_a_storey_set asked for at least two Levels, so R2025
01_Walls (one Level, 'Level 1' at 0 ft, ElementId 1951, decoded whole by
probe_re51_level_names in Measure 40934704557) exported its five walls on
no storey while Revit's export has them on Level 1. The floor was
arbitrary: the one-block-per-Level check is what keeps a partial recovery
out. One Level is now accepted only when scan_partition_level_ids, the
broader id scan, finds no other Level either.
Einhoven (Revit 2023) decodes one Level while its ArcWalls stand at two or
more base elevations, which RE-15's storeys from wall bases show; the
corpus test arcwall_decoder_yields_ifcwall_on_einhoven caught the lone
Level replacing them. With no Revit export of Einhoven to say which is
right, the one-Level rule is narrowed to the releases its oracle, R2025
01_Walls, is on.
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Measure run 40942112911 (head 4f3c265 against main af50068, every model and scorer): 89 models, two IFCs moved, r2025-00_Blank and r2025-01_Walls. Every other ifc.sha256 is unchanged.

  • 01_Walls: storeys_vs_ifc 5 elements, 0 not on a storey, 5 same storey as Revit's (base: 5 on no storey); global_ids storeys 1 of 1 equal Revit's; the unsupported_geometry_missing_level skipped item is gone; psets equal 25 → 28, missing 14 → 13, different 0.
  • 00_Blank: storey 'Level 1' written, its GlobalId Revit's (1 of 1); psets equal 0 → 2. Pset_BuildingCommon.NumberOfStoreys goes from missing to different: rvt-rs writes 1, Revit's IFC 25.0 export 0. It is the rule 20 of the other R2025 models already count different at base, not one this PR adds: Revit's exporter before IFC 26.1 counts only storeys that hold an element (NumberOfStoreys: Revit's exporter before IFC 26.1 counts only storeys that hold an element #1097).

@DrunkOnJava
DrunkOnJava merged commit c98b5ab into main Oct 29, 2026
29 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/single-level-storey branch October 29, 2026 20:39
DrunkOnJava added a commit that referenced this pull request Oct 29, 2026
…FC 26.1 writes (#1097) (RE-263) (#1098)

## Summary

Closes #1097. Revit's exporter writes
`Pset_BuildingCommon.NumberOfStoreys` by two rules: up to IFC 26.0 the
number of storeys that contain an element, from IFC 26.1 the number of
storeys (revit-ifc `NumberOfStoreysCalculator`, changed in the "IFC 26.1
for Revit 2026" commit ef15008e2e). rvt-rs writes the number of storeys,
IFC4's definition. The W7 census now counts the older value apart
instead of as different.

## Changes

- `tools/re/psets_vs_ifc.py`: reads the reference export's exporter
version from its `FILE_NAME` originating system, its storeys and the
storeys some element is contained in; counts `NumberOfStoreys` apart, on
its own line, where the exporter is older than 26.1, not every storey
contains an element, and Revit's value is the number that do. An export
naming no exporter is scored as before.
- `reports/element-framing/RE-263-number-of-storeys.md`: the measured
table (24 of 24 named pre-26.1 exports, plus BIMcollab, follow the older
rule; 5 of 5 from 26.1 the newer).
- RE-253: its artefacts line said both held-out ribeiro exports were
Revit 25.4's; `modelo_bim`'s header names Revit 26.2 (IFC 26.1.0.23).
- `changelog.d/research/number-of-storeys.md`.

## Testing

Unit tests are banned in this repository: do not add them.

- [x] Verified on real files: Measure run 40948455973 (main ed337dd
with this branch's census, r2025 and nordic): the RE-263 line counts the
property apart on 21 R2025 models (the 20 that differ, and 00_Blank,
which main does not yet give its storey, #1086) and nowhere else. RE1's
four and the office's two stay equal; 01_Walls stays scored.
- [x] `python3 tools/ci/api-doc-ids.py` and `python3
tools/release/changelog.py check` pass.

No export changes.

## Legal and contribution hygiene

- [x] revit-ifc (CLEANROOM.md source 5) read and cited by file, class
and commit; nothing copied. Held-out models: counts only.
Repository owner deleted a comment from chatgpt-codex-connector Bot Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant