Skip to content

feat(ifc): write layered walls, floors, roofs and ceilings as IfcMaterialLayerSetUsage with their material names (#355) (RE-58) - #366

Merged
DrunkOnJava merged 2 commits into
mainfrom
feat/material-layer-sets
Sep 24, 2026
Merged

DrunkOnJava merged 2 commits into
mainfrom
feat/material-layer-sets

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

Material names are now read by ElementId, and the IFC export writes layered walls, floors, roofs and ceilings as IfcMaterialLayerSetUsage over an IfcMaterialLayerSet, with each layer's material and thickness (RE-58).

Where a material's name is. It sits in the material's own object, in the first of three places:

  1. the name field after the class tag;
  2. after parameter entries in that field: the one u32 n · UTF-16 × n ending at the first ff ff ff ff plus 17 0c (2024) or 6b 0c (2025);
  3. a framed string or a name-parameter entry.
file release materials named
Snowdon Towers (local only) 2024 219 of 220
2024_Core_Interior 2024 78 of 86
RE1 Architecture 2025 69 of 69
the MIT tutorial house (local only) 2024 and 2025 171 of 171 in each
Projeto1, teste_export_2025 (local only) 2025 114 of 114 each

Every named material that Revit's own export styles by that name has Revit's colour for it: 174 of 174.

Layer sets. Scored end to end against Revit's own exports (tools/re/layer_sets_vs_ifc.py, IfcOpenShell 0.8.5):

file layer sets layer names Revit's, in Revit's order whole sets within 0.001 ft of Revit's body
Snowdon Towers 1,216 3,321 of 3,322 1,196 of 1,207
2024_Core_Interior 88 89 of 89 88 of 88
RE1 Architecture 15 37 of 37 15 of 15
  • The 11 Snowdon sets beyond 0.001 ft are RE-53's soffit walls, whose stud layer Revit cuts back.
  • RE1's 2025 export writes its own layer sets: the same 4, with the same thicknesses in the same order. On RE1's 6 ceilings and 2 floors, Revit's own usage disagrees with Revit's own body; rvt-rs follows the body.
  • The MIT house gives identical sets from its 2024 and 2025 saves, with all 150 layers named.

Viewer. Selecting a layered element shows a Layers group with the order, each layer's material and thickness, and the total. Checked in the browser on the MIT house's brick wall, joist floor and metal roof.

Changes

  • src/partition_materials.rs:
    • name_at, scan_material_names, material_name_frame_tag and material_name_end_tag;
    • the module doc.
  • src/partition_schema_mvp.rs: layer bands carry the layer material's name.
  • src/ifc/mod.rs:
    • material_layer_sets_from_layers and material_layer_set_usage;
    • IfcModel::material_layer_usages;
    • LayerBand::name.
  • src/ifc/entities.rs:
    • MaterialLayer::material_index is now Option<usize>;
    • new LayerSetDirection and MaterialLayerSetUsage.
  • src/ifc/step_writer.rs: a layer with no material writes $, and each usage writes its direction, sense and offset.
  • src/ifc/scene_graph.rs: PanelLayers and ElementInfoPanel::layers.
  • src/ifc/compare.rs: the catalogued note for IFCMATERIALLAYERSETUSAGE says what rvt-rs writes.
  • viewer/src/main.ts: the Layers group.
  • viewer/index.html: the "Not ready" copy.
  • examples/probe_re58_material_names.rs, tools/re/layer_sets_vs_ifc.py, reports/element-framing/RE-58-material-layer-sets.md.
  • Docs:
    • a support-matrix row, ifc-material-layer-sets, at partial;
    • README, status, supported-profile, user-guide, ifc-compare, contribution-map, viewer-api, the reconnaissance addendum and CHANGELOG.
  • research/witness/magnetar-2024-core-interior{,-slim}/observations/rvt-rs.json regenerated:
    • IFCMATERIAL 102 to 104;
    • 88 usages over 4 sets.

Testing

End to end, against real files. No unit tests were added.

  • rvt-ifc on Snowdon, Core Interior, RE1 and the MIT house (2024 and 2025), then tools/re/layer_sets_vs_ifc.py. The report's §3 has the inputs' sha256 and the output.
  • examples/probe_re58_material_names.rs on seven files. Against the names read without rule 2, no name is lost or changed.
  • python -m ifcopenshell.validate and tools/ci/ifc_schema_arity.py report nothing on all five exports.
  • The CI witness steps, replayed locally: both Core verdicts PASS against IfcOpenShell and IFClite, and --witness-agreement holds.
  • The viewer, in Chromium: the MIT house loads with no page error, and three elements show their layers. The wasm imports no network primitive.
  • Local gates:
    • fmt, clippy -D warnings, rustdoc -D warnings;
    • the workspace suite (191 test binaries);
    • the corpus tests under --profile ci with the family and project corpora (48 binaries);
    • viewer typecheck and build, and the wasm network-import audit;
    • the fuzz workspace check;
    • cargo +1.85.0 check.

What this does not do

Audit-honesty checklist

  • Status partial with the residuals above. Every count is measured against Revit's own export of the same model, or across the two saves of one model.
  • RE finding: report, probe, reconnaissance addendum, end-to-end scorer.
  • No emojis, private paths or personal data.

Legal and contribution hygiene

  • Apache-2.0
  • Clean-room: byte observations of the files, and Revit's own IFC exports as oracles. No Autodesk or ODA source, disassembly or SDK material.
  • Snowdon, the MIT house and the ribeiro files stay local.

Breaking changes

  • ifc::entities::MaterialLayer::material_index is Option<usize>.
  • IfcModel gains material_layer_usages (serde default).
  • LayerBand gains name and is no longer Copy.
  • ElementInfoPanel gains layers (serde default).

Related issues

Refs #355, #88, #34.


Note

Medium Risk
IFC export and public IFC model types change (layer sets, optional materials, new usages); behavior is gated on thickness/orientation heuristics but affects downstream IFC consumers and serde snapshots.

Overview
RE-58 closes the gap where layered geometry was drawn in glTF but IFC export omitted compound assemblies: material names are decoded from OST_Materials partition objects (by ElementId), and IFC4 now emits shared IfcMaterialLayerSet definitions plus per-element IfcMaterialLayerSetUsage (direction, sense, offset) for walls, floors, roofs, and ceilings whose extruded bodies match their layer thickness sums.

Implementation adds partition_materials::name_at / scan_material_names, threads names into layer bands in partition_schema_mvp, builds sets/usages in ifc::material_layer_sets_from_layers, extends the STEP writer for optional layer materials and non-default usages, and surfaces PanelLayers in the viewer element panel. Docs, support matrix, witness observations, probe_re58_material_names, and tools/re/layer_sets_vs_ifc.py document and score the change against Revit exports.

Breaking: MaterialLayer::material_index → Option<usize>; IfcModel::material_layer_usages; LayerBand gains name and is no longer Copy.

Reviewed by Cursor Bugbot for commit db33a62. Configure here.

…rialLayerSetUsage with their material names (#355) (RE-58)

A material's name is read from its own object by ElementId. It is taken
from the name field, from after the field's parameter entries (ending at
ff ff ff ff and 17 0c on 2024, 6b 0c on 2025), or from a framed string
or name entry. Named: Snowdon 219 of 220, Core Interior 78 of 86, and
every material of RE1, Projeto1, teste_export_2025 and the tutorial
house. Every material Revit's export styles by name has Revit's colour,
174 of 174.

The IFC export writes each layered element's type layers as an
IfcMaterialLayerSet, with each layer's material and thickness. Each
element gets an IfcMaterialLayerSetUsage placing the set on its body.
Against Revit's exports, the layer names are Revit's, in Revit's order,
on 3,321 of 3,322 Snowdon layers and on all of Core Interior's and RE1's.
Whole sets sit within 0.001 ft of Revit's body on 1,196 of 1,207 Snowdon
elements, 88 of 88 on Core Interior and 15 of 15 on RE1.

The viewer's element panel lists the layers.
@cursor

cursor Bot commented Sep 24, 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_bce5b767-0e78-4865-bda5-c1d3b509c114)

@DrunkOnJava
DrunkOnJava merged commit d7f7a05 into main Sep 24, 2026
23 checks passed
@DrunkOnJava
DrunkOnJava deleted the feat/material-layer-sets branch September 24, 2026 03:30
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