Skip to content

fix(ifc): a ceiling of separate loops is one IfcCovering whose body holds every piece, as Revit's export writes it (#823) - #861

Merged
DrunkOnJava merged 1 commit into
mainfrom
fix/823-ceiling-pieces
Oct 20, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
fix/823-ceiling-pieces

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #823. rvt-rs wrote each piece of an element whose sketch has separate loops as an element of its own, named <name>:2, <name>:3 and so on (#331). That is how Revit's export writes floors (Snowdon Towers). For ceilings, Revit's export writes one IfcCovering whose body holds every piece. On the BIM4LCA office that is 19 as-built and 20 permit ceilings of 2 to 8 pieces, with the union of rvt-rs's pieces equal to Revit's top surface (Measure run 39240535083).

  • export_content::PIECES_IN_BODY_CLASSES (Ceiling): where such an element's body is an extrusion, the exporter names its pieces in a new IfcModel::body_pieces (element index → piece indices).
  • The STEP writer writes those pieces' extrusions as further IfcExtrudedAreaSolid items of the element's Body representation, in the element's frame, and skips them as elements. Every relation the writer emits looks entity indices up through entity_index_to_el_id and leaves out unwritten ones, so no containment, property set, material or type relation refers to a skipped piece.
  • A piece is folded only where the element and the piece are both plain extrusions, or neither has geometry (the no-geometry modes). Any other piece is written as before.
  • The pieces stay in IfcModel::entities, so the glTF export, the scene graph and the viewer draw them as before.
  • Floors keep one element per piece, as Revit's export writes them.

Verification

  • CI.
  • Measure A/B against main with the office and the sample projects, run 39366624352 on 52dbee5. Office, as built:
    • The 47 entities that were further ceiling pieces are gone, and repeated Tags fall from 47 to 0 (class_sets_vs_ifc), so the 19 ceilings now pair by Tag. names_vs_ifc loses its "47 IfcCovering, Name differs" row.
    • storeys_vs_ifc counts 12,708 elements instead of 12,755, with every one still on Revit's storey but the same 440. layer_sets_vs_ifc writes 712 sets instead of 759, with the same agreement.
    • IfcCovering with a PredefinedType goes from 158 to 111.
  • The permit file shows the same changes.
  • The IfcOpenShell validator and the IFC4 property set check give 0 findings on both office files, multi-item bodies included.
  • Core Interior, Einhoven and the four RE1 models export byte-identically.
  • Snowdon Towers' architectural sample loses 3 covering pieces. No Revit export of it is in CI, so that part is not measured against Revit.

…olds every piece, as Revit's export writes it (#823)

Pieces of an element of separate loops were each written as an element of their own (#331), as Revit's export writes floors. For ceilings Revit writes one IfcCovering with a body item per piece (BIM4LCA office, Measure run 39240535083). The exporter now names a ceiling's pieces in IfcModel::body_pieces, and the STEP writer writes their extrusions as further items of the ceiling's Body representation and skips them as elements, so no relation refers to them. They stay in the model's entities, so the glTF export and the viewer still draw them.
@DrunkOnJava
DrunkOnJava merged commit d69c2e1 into main Oct 20, 2026
31 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/823-ceiling-pieces branch October 20, 2026 04:09
DrunkOnJava added a commit that referenced this pull request Oct 20, 2026
…lan union of its upward faces, so a sloped top counts whole (#824) (#866)

Part of #824. `tools/re/plan_profiles_vs_ifc.py` kept only the upward
faces at a body's highest level. Revit writes a layered floor as one
solid per layer, so that filter stopped each layer from being counted.
On a tilted floor, though, the faces at the highest level are one
triangle of the top's two. So the BIM4LCA office's 8 sloped floors read
as exactly twice Revit's area, and looked like triangles (#824, the
comment of 2026-10-20).

The scorer now takes the plan union of every upward face. That still
counts a stacked layer's outline once, and it keeps a sloped top whole.
Points and the outline come from all upward faces.

## Measured

Measure run
[39370597357](https://github.com/DrunkOnJava/rvt-rs/actions/runs/39370597357)
scored the same exports as main's latest run. Main's own exports did not
change between the two (#861 and #863 touched no slab).

| model | area off (before → after) | outline off | vertices off |
|---|---|---|---|
| office, as built | 31 → 23 | 31 → 23 | 35 → 29 |
| office, permit | 32 → 24 | 33 → 25 | 37 → 31 |
| Core Interior | unchanged (80 of 80) | unchanged | unchanged |
| RE1 Architecture | unchanged | unchanged | unchanged |

The 8 slabs that move are the sloped floors. Their outline was always
Revit's: the gap is their slope, which rvt-rs does not read and this
scorer does not compare.

Tooling only; no export changes.
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.

BIM4LCA office: 19 ceilings written as separate pieces where Revit's export writes one IfcCovering each

1 participant