Skip to content

red run: element_materials (B09, do not merge) - #579

Closed
DrunkOnJava wants to merge 1 commit into
mainfrom
red/b09-element-materials
Closed

DrunkOnJava wants to merge 1 commit into
mainfrom
red/b09-element-materials

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Scratch PR for a red run of tests/element_materials.rs on main. Closed and its branch deleted once CI reports.


Note

Low Risk
Test and CI target registration only; no production exporter or reader logic changes in this diff.

Overview
Adds a real-file integration test (tests/element_materials.rs) that encodes issue #355: for all 256 IFCCOLUMN instances in 2024_Core_Interior.rvt, rvt-rs IFC export must associate the same material name set as Revit’s reference export (2024_Core_Interior_slim.ifc), resolved via IfcRelAssociatesMaterial and nested IFC4 material definitions.

The test exports with RvtDocExporter, parses STEP text (entity index, material graph walk, tag mapping), and asserts full parity; it skips when RVT_PROJECT_CORPUS_DIR or the reference IFC is missing.

Registers element_materials under the real class in tools/ci/test-targets.txt so CI runs it with the corpus (aligned with the scratch “red run” intent on main).

Reviewed by Cursor Bugbot for commit 34c726f. Configure here.

A real-file target: exporting 2024_Core_Interior.rvt, every one of its
256 columns has the material set Revit's own export relates to it
('Default Wall' on the 149 walls join, <Unnamed> on the 107 no wall
joins). Expected red on main: rvt-rs gives the columns no material.
@DrunkOnJava

Copy link
Copy Markdown
Owner Author

Red run captured; the test lands in the B09 PR.

@DrunkOnJava DrunkOnJava closed this Oct 3, 2026
@DrunkOnJava
DrunkOnJava deleted the red/b09-element-materials branch October 3, 2026 11:43
DrunkOnJava added a commit that referenced this pull request Oct 3, 2026
…ake <Unnamed>, and joined columns their walls' material (#355) (#580)

Part of #355 (B09). puzzbobb's material rule starts from the map RE-82
reads, which is `FamilySymbol.m_geomTag2MaterialId`. Where every value
in that map is unset, rvt-rs read no map and gave the instances no
material.

**What Revit's export gives these elements:**
- Core Interior's 256 columns: `<Unnamed>` on 107, "Default Wall" on
149. The column-cuts module already found exactly those 149 joined to
walls, and those walls' material is "Default Wall" (356 of 360 walls).
- The RE1 MEP models: `<Unnamed>` on 150 of the 152 fittings, terminals,
proxies and control elements it relates a material to.

**What changes:**
- `partition_type_materials::unset_material_types`: a family type whose
first map holds only unset values, with distinct keys no larger than
0xffff (the geometry tags, RE-149 probe
`examples/probe_re149_type_value_blocks.rs`). A map with a material in
it answers no, so partial maps (RE-124) are untouched. Their columns and
products take `UNNAMED_MATERIAL`.
- `element_record_column_cuts::column_joined_walls`: each column's
overlapping named walls, carried as `m_column_joined_wall`. A column
that would take `<Unnamed>` takes its joined walls' layer material
instead, when every joined wall names the same set.
- Doors, windows, walls and slabs are unchanged, so RE-84's opening-only
doors and windows are untouched. The 2023 path is unchanged.
- The element-material scorer now also counts, by Revit entity, the
elements rvt-rs gives no materials.

**Commits:**
1. `test(ifc)` adds the real-file target `tests/element_materials.rs`:
all 256 Core Interior columns have Revit's material set. Its red run on
`main` (draft #579) is in the commit message: 0 of 256, all 256 with
none.
2. The scorer change.
3. The probe.
4. The feature.
5. The changelog.

## Measured

Measure run 37120595647 compared head against `main`. The
element-material scorer (elements with Revit's exact material set):

| model | before | after | still without materials |
|---|---|---|---|
| Core Interior | 580 | 836 | 12 slabs (Revit: `<Unnamed>`) |
| RE1 Electrical | 0 | 47 of 47 | 2 proxies |
| RE1 Mechanical | 0 | 43 of 43 | none |
| RE1 Plumbing | 0 | 60 of 60 | none |

- No element gained a wrong set.
- The GLB now draws the 149 joined columns in Revit's material name and
colour.
- RE1 Architecture and Einhoven are byte-identical to `main`.

**Pinned values, approved by the maintainer.** Core Interior's material
count goes from 86 to 87, the `<Unnamed>` material. The project-count
manifests change to 87. The committed rvt-rs witness observations are
regenerated from that Measure run; their hash is the one the
IfcOpenShell job's replay computes. These are in their own commit.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes partition binary heuristics and IFC material assignment for
columns and family products; wrong unset-map detection could mislabel
materials, though behavior is gated and checked against Revit’s Core
Interior export.
> 
> **Overview**
> **Family-instance materials now match Revit when a type has no real
geometry-material map (RE-149 / #355).** Types whose value block opens
with a geometry-tag map where every entry is unset (and no named map was
read) are detected via `partition_type_materials::unset_material_types`;
their **columns** and **products** get `m_type_material` = `<Unnamed>`.
Doors, windows, walls, and slabs are not touched.
> 
> **Joined columns** that would stay `<Unnamed>` can inherit wall
materials: `column_joined_walls` finds overlapping walls from each
column’s references, exposes them as `m_column_joined_wall` on decode,
and `attach_joined_wall_materials` replaces `<Unnamed>` only when every
joined wall’s layer names agree.
> 
> Adds the RE-149 probe example `probe_re149_type_value_blocks`, a
real-file IFC test `tests/element_materials` (256 Core Interior columns
vs Revit’s export), CI registration, changelog, and a small bump to the
Python material-vs-IFC scorer (tracks elements rvt-rs still gives no
materials).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
09a8de7. 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