Skip to content

fix(ifc): cut each door's and window's opening to its host wall's depth (#227) (RE-83) - #440

Merged
DrunkOnJava merged 1 commit into
mainfrom
fix/opening-through-wall
Sep 28, 2026
Merged

DrunkOnJava merged 1 commit into
mainfrom
fix/opening-through-wall

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Each door's and window's IfcOpeningElement is now as deep as the host wall it cuts, instead of the element's whole box (RE-83). Width and height stay the element's box.

Motivation

#227: openings stood up to 4.9 ft out of both faces of their wall, because the opening was the door's box (swing and trim included).

Changes

  • src/ifc/mod.rs opening_cuts_through_hosts: for a hosted element with a rectangular extrusion, the host's plan outline (the one its body is built from) is measured along the element's two local plan axes. The axis on which the wall is a thin band (at most 3 ft, under half the other axis) is the through-axis; the opening spans the band there. Otherwise the element's box is kept. The element's rotation is not used to pick the axis: on Core Interior some walls run along Y with a door rotation of 0.
  • IfcModel::opening_cuts (entities::OpeningCut, serde default) and the writer's opening chain use it for the profile size and origin.
  • tools/re/openings_vs_ifc.py: scores openings against Revit's export by filler Tag.
  • reports/element-framing/RE-83-openings-through-walls.md; README, supported profile, support matrix notes, CHANGELOG.
  • Doc correction: the README said the host pairs Revit's "on every measured model". Snowdon pairs 107 of 110 (Snowdon: three doors and windows cut a different host wall than Revit's export #439, filed with the measurements).

Testing

tools/re/openings_vs_ifc.py, rvt-rs's export against Revit's own IFC4 export:

file openings in both within 0.26 ft, before now largest, before now
Core Interior (slim export) 138 0 138 4.92 ft 0.25 ft
Snowdon Towers (local only) 110 0 72 5.83 ft 5.83 ft

The Snowdon residual is itemised in the report: 23 in "Solar Wall" hosts that Revit meshes as faceted face sets (the element's box is kept), 7 frame margin, 5 chase-wall windows (one with a different host, #439), 2 curtain-wall doors (host, #439), 1 overhead door.

  • fmt, clippy -D warnings, rustdoc -D warnings
  • tools/ci/verify-real-files.sh --profile ci with the family and project corpora: pass
  • cargo +1.85.0 check --profile ci --all-targets, cargo +nightly check of the fuzz workspace (a fuzz target builds IfcModel)
  • Witness verdicts for both Core Interior artifacts replay (three "replay: match" each); ifc_schema_arity.py --witness-agreement passes. Entity counts are unchanged, so the committed observations are unchanged.
  • No unit tests added (banned in this repository).

Audit-honesty checklist

Legal and contribution hygiene

  • Apache-2.0; measurements against public and local reference exports, no Autodesk code.

Breaking changes

None. IfcModel gains a field with a serde default.

Related issues

Refs #227 (not closed), #439.


Note

Medium Risk
Changes IFC void geometry for all hosted doors/windows and touches the export pipeline and STEP writer; behavior is gated on host outline heuristics with documented fallbacks, but viewers that subtract openings will see different wall cuts.

Overview
Door and window IfcOpeningElement geometry now matches host wall thickness (#227, RE-83). Previously the void used the door/window bounding box (swing and trim included), so openings could extend several feet past both wall faces. Export now derives an OpeningCut per hosted filler: width and height stay the element box; depth comes from projecting the host wall’s plan outline onto the filler’s local axes and taking the thin “through-wall” band (≤3 ft and under half the other span). Non–straight-extrusion hosts keep the full element box.

IfcModel::opening_cuts (serde-default map by filling entity index) is filled in opening_cuts_through_hosts during export; the STEP writer uses it for opening profile dimensions and centre instead of the body extrusion. tools/re/openings_vs_ifc.py scores world-space opening boxes against Revit’s IFC by filler Tag.

Docs and changelog record validation (e.g. Core Interior 138/138 within 0.25 ft) and correct the claim that every measured model matches Revit on host pairs — Snowdon is 107/110 (#439).

Reviewed by Cursor Bugbot for commit f9012d9. Configure here.

…th (#227) (RE-83)

A door's or window's IfcOpeningElement took the element's whole box and
stood up to 4.9 ft out of the wall. The opening's depth now comes from
the host wall's plan outline, measured along the element's own axes;
width and height stay the element's box.

Against Revit's export (tools/re/openings_vs_ifc.py): Core Interior 138
of 138 within 0.25 ft (none before); Snowdon Towers 72 of 110 within
0.26 ft (none before). Walls that are not straight extrusions keep the
element's box. Snowdon pairs 107 of 110 hosts with Revit's (#439), so the
docs no longer say every host pairs.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) September 28, 2026 00:17
@cursor

cursor Bot commented Sep 28, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_e3cb84f4-575a-4eec-bf3e-6139c3dc43d3)

@DrunkOnJava
DrunkOnJava merged commit d0eb003 into main Sep 28, 2026
20 checks passed
@DrunkOnJava
DrunkOnJava deleted the fix/opening-through-wall branch September 28, 2026 00:19
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