Skip to content

red: B63 space containment (scratch, do not merge) - #644

Closed
DrunkOnJava wants to merge 1 commit into
mainfrom
red/b63-space-containment
Closed

DrunkOnJava wants to merge 1 commit into
mainfrom
red/b63-space-containment

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Scratch branch: shows B63's new test red on main. Deleted after the red run is recorded.


Note

Low Risk
Test and CI registration only; no exporter or runtime behavior changes in this diff.

Overview
Adds B63 coverage: a new real integration test that exports RVT models with RvtDocExporter, parses IfcRelContainedInSpatialStructure from STEP (by element Tag), and asserts each shared element is contained in the same IfcSpace name (or storey-level container) as Revit’s reference IFC.

The test runs when RVT_PROJECT_CORPUS_DIR is set, pairing the four RE1-*.rvt/RE1-*.ifc models plus 2024_Core_Interior.rvt with its slim IFC export; missing pairs are skipped. space_containment is registered in tools/ci/test-targets.txt so CI and the local gate run it like other corpus tests.

Reviewed by Cursor Bugbot for commit 99c927e. Configure here.

…ns them in (B63)

Red run pending on the scratch draft PR.
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Red run recorded in the B63 PR's test commit (corpus 37211033155).

@DrunkOnJava DrunkOnJava closed this Oct 4, 2026
@DrunkOnJava
DrunkOnJava deleted the red/b63-space-containment branch October 4, 2026 15:02
DrunkOnJava added a commit that referenced this pull request Oct 4, 2026
…n its space (B63) (#645)

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.

<!-- CURSOR_SUMMARY -->
---

> [!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.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
cb7566d. 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