Skip to content

feat(ifc): a room's furniture, fixtures and equipment are contained in its space (B63) - #645

Merged
DrunkOnJava merged 5 commits into
mainfrom
feat/b63-space-containment
Oct 4, 2026
Merged

DrunkOnJava merged 5 commits into
mainfrom
feat/b63-space-containment

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

B63. Revit's export of RE1 Architecture contains its 39 furniture items, sanitary terminals and equipment proxies in the IfcSpace of the room they stand in; rvt-rs contained all 73 elements in the storey.

  • New IfcEntity::SpaceContainment: a family instance written as IfcFurniture, IfcSanitaryTerminal or IfcBuildingElementProxy, hosted by nothing, whose location lies in the plan outline of a space on its storey (the space's body profile at its placement, voids excluded).
  • The writer contains those in the space instead of the storey. They keep their storey_index, so the viewer tree and the diagnostics' storey counts do not change.

Red (draft #644, run 37211033155): RE1 Architecture, 39 of 60 elements contained differently from Revit's; the other four models 0. Output in the test commit's message.

Only RE1 Architecture has rooms with such contents among the measured models; Core Interior's family instances are columns, doors and windows, which stay in their storey as in Revit's export.


Note

Medium Risk
Changes how spatial containment is emitted in IFC export (storey vs space), with geometry-based room assignment that could mis-place elements if outlines or locations are wrong.

Overview
Implements B63 so rvt-rs matches Revit’s IFC spatial containment: unhosted family instances exported as IfcFurniture, IfcSanitaryTerminal, or IfcBuildingElementProxy (with RevitClass = FamilyInstance) are linked to the IfcSpace whose plan outline contains their XY location, instead of only appearing under the storey.

Export adds IfcEntity::SpaceContainment and contain_in_spaces, which builds each space’s plan polygon from its extrusion profile (including voids), tests containment via the newly public inside, and appends containment records. The STEP writer skips those elements in storey IFCRELCONTAINEDINSPATIALSTRUCTURE relations and emits separate relations into the space; storey_index is unchanged on the elements themselves.

A corpus integration test space_containment compares containment by element Tag against reference IFC exports, and CI registers it as a real target.

Reviewed by Cursor Bugbot for commit cb7566d. Configure here.

…ns them in (B63)

tests/space_containment.rs (real) exports the four RE1 models and Core Interior and checks, for every element both files hold (by Tag), that rvt-rs contains it in an IfcSpace exactly where Revit's export does, in the space of the same Name (the room number).

Red on main, draft #644, corpus run 37211033155:

  test elements_are_contained_in_revits_spaces ... FAILED
  RE1-Architecture.rvt: 60 elements in both, 39 in a space in Revit's, 39 contained differently
  RE1-Mechanical.rvt: 74 elements in both, 0 in a space in Revit's, 0 contained differently
  RE1-Plumbing.rvt: 123 elements in both, 0 in a space in Revit's, 0 contained differently
  RE1-Electrical.rvt: 49 elements in both, 0 in a space in Revit's, 0 contained differently
  2024_Core_Interior.rvt: 854 elements in both, 0 in a space in Revit's, 0 contained differently
  RE1-Architecture.rvt: 39 of 60 elements are contained differently from Revit's export; first: ["351456: Revit 'RE-7', rvt-rs storey", "352342: Revit 'RE-7', rvt-rs storey", ...]
  test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 20.84s
…n its space (B63)

Revit's export of RE1 Architecture contains all 39 of its furniture, sanitary terminals and equipment proxies in the IfcSpace of the room they stand in, and its walls, doors, slabs, coverings and curtain walls in their storey; rvt-rs put all 73 in the storey. A new IfcEntity::SpaceContainment holds a space's contents: each family instance written as IfcFurniture, IfcSanitaryTerminal or IfcBuildingElementProxy, hosted by nothing, whose location lies in the plan outline of a space on its storey (the space's body profile at its placement, voids excluded). The writer contains those in the space instead of the storey; they keep their storey_index, so the viewer's storey tree and the diagnostics' storey counts do not change.
@DrunkOnJava
DrunkOnJava enabled auto-merge (squash) October 4, 2026 15:03
@DrunkOnJava
DrunkOnJava merged commit 24ba0d5 into main Oct 4, 2026
22 of 23 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/b63-space-containment branch October 4, 2026 15:26
DrunkOnJava added a commit that referenced this pull request Oct 4, 2026
…ocked on B38, new B69 (#652)

Second session 3 progress update. B49, B50, B57, B61, B63 and B52 done;
B44 (#651), B47, B53 and B66 in progress with their evidence runs; B62
blocked on B38; new B69: rvt-write exits 0 on a patch whose re-encoded
stream spans a checksummed page, found by B53's real-file test.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only update to BACKLOG.md; no runtime, test, or exporter
behavior changes in this diff.
> 
> **Overview**
> This is a **session 3 backlog refresh** in `BACKLOG.md`: ranked-item
statuses and the progress log are brought in line with work landed or
re-scoped since the last update.
> 
> **Completed** items are marked **done** with PR links where
applicable: **B49** (export diagnostics / `Pset_` parameter counting,
#638), **B61** (IFC2X3 vs IFC4 type-entity scorer, #641), **B63**
(`IfcSpace` containment, #645), **B50** (dead code, #647), **B52**
(local branch cleanup), and **B57** (launch docs drift, #646).
> 
> **Regressions / blockers** are recorded: **B62** moves from committed
to **blocked on B38** (extra plumbing connection to tank 442378 Revit
does not export); **B47**, **B44**, **B53**, and **B66** shift to **in
progress** with Measure/RE evidence; **B53** notes discovery of **B69**.
> 
> **B69** is added: `rvt-write` could exit 0 on patches whose re-encoded
stream spans a checksummed page, producing streams readers cannot
decode; fix direction is `Error::WriteRefused` in `src/writer.rs`,
blocking B53’s real-file CLI E2E.
> 
> The progress log adds red/green runs, witness/fixture notes,
pr-queue/rerun policy, and a **rule slip** (forbidden `git checkout
<ref> -- <file>` during scratch-branch file copies).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3699bab. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
DrunkOnJava added a commit that referenced this pull request Oct 4, 2026
…lth; neither is green (#654)

Corrects #652, which recorded B63 as done from the required checks
alone. Corpus health, the only job with the project corpus and not a
required check, fails space_containment on main since #645 (1 of 60:
element 375441 is in Revit's space RE-6 and rvt-rs's storey), and fails
#651's own test 42 of 42. Both are being fixed.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only backlog corrections; no code, tests, or CI
configuration changes.
> 
> **Overview**
> Updates **BACKLOG.md** so maintainer status matches **Corpus health**,
not only required CI—fixing a drift introduced when #652 treated B63 as
done after #645 auto-merged on required checks alone.
> 
> **B63** moves from **done** to **in progress**: #645 fixed 38 of 39
space-containment cases, but element **375441** still sits in Revit's
`IfcSpace` `RE-6` while rvt-rs keeps it on the storey;
`space_containment` fails **1 of 60** on `main` since `24ba0d5` (runs
**37212742187** on the PR, same on main).
> 
> **B44** (#651) stays in progress but is marked **disarmed**: Corpus
health fails its NominalDiameter test **42 of 42** (run
**37214338189**); RE-165 shows connector data is correct, so the gap is
between scan and IFC write. The ranked table and progress log both
record these red Corpus runs and the auto-merge / not-required-check
context.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
4d3cff3. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
DrunkOnJava added a commit that referenced this pull request Oct 4, 2026
…oom's space (B63) (#656)

Turns main's Corpus health green again: space_containment has failed on
main since #645 (1 of 60, element 375441, a medicine cabinet recessed
into RE-6's wall, 0.08 ft outside the room's outline). An element whose
point lies in no space is contained in the one space its plan box
overlaps, when exactly one does. Evidence (probe runs 37214796046,
37215316216, 37215827984) is in the commit message.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes IFC spatial structure for edge-case placements; logic is
conservative (unique overlap only) but affects export parity validation
for space containment.
> 
> **Overview**
> **Space containment** for unhosted family-instance room content
(furniture, sanitary terminals, proxies) now has a second rule when the
instance **placement point** lies outside every room outline on its
storey.
> 
> After the existing point-in-outline check, the exporter builds the
element’s **plan box** from rotation and extrusion (default rectangular
profile only) and assigns it to the **sole** space whose outline
overlaps that box—corner-in-space or space-vertex-in-box—matching Revit
for fixtures slightly outside the room boundary (e.g. a recessed
medicine cabinet).
> 
> Refactoring introduces a shared `holds` helper and storey-scoped space
iteration; assignment still requires **exactly one** overlapping space
so ambiguous cases are not forced into a room.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
cba940e. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
DrunkOnJava added a commit that referenced this pull request Oct 4, 2026
…64 and B70 in progress, B60 found (#660)

Third session 3 progress update: five items landed, B64 (#659) and B70
in progress, new B70 and B71 rows (MEP sample performance), B68 blocked
on B70, and RE-167's finding for B60.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Documentation-only backlog and session notes; no runtime, CI config,
or exporter behavior changes in this diff.
> 
> **Overview**
> Updates **BACKLOG.md** for maintainer session 3: the ranked table and
progress log reflect landed work and new perf backlog, without any code
changes.
> 
> **Status moves in the ranked table:** **B44**, **B63**, **B66**,
**B53**, and **B69** are marked **done** (with PR refs #651, #645/#656,
#657, #653). **B60** and **B64** move from **committed** to **in
progress** (RE-167 type GlobalId rule; #659 curtain-wall door
aggregation). **B68** is **blocked** on **B70** (MEP sample export
timeout). Two new rows: **B70** (`rvt-ifc` ~33.5 min on MEP samples;
`attach_mep_systems` / `attach_pipe_type_names` scans) and **B71**
(double file walk for export vs diagnostics).
> 
> **Progress log additions** document how each item closed or advanced:
B63’s plan-box overlap rule for medicine cabinet 375441; B53/B69 writer
fixes (refuse checksummed pages, full gzip members); B44’s three-reader
NominalDiameter path; B66 curtain material offsets; B64 curtain-grid
door parts; B70’s one-pass-per-stream improvement (30 s walk,
byte-identical RE1 MEP IFC); B60’s original-symbol GlobalId finding; and
a note that unresolved Bugbot threads block merges until resolved.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
a2c5a15. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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