Repository navigation
feat(ifc): write layered walls, floors, roofs and ceilings as IfcMaterialLayerSetUsage with their material names (#355) (RE-58) - #366
Merged
Conversation
…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.
…8's layer paragraph superseded (RE-58)
Bugbot couldn't run - usage limit reachedBugbot 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Material names are now read by ElementId, and the IFC export writes layered walls, floors, roofs and ceilings as
IfcMaterialLayerSetUsageover anIfcMaterialLayerSet, 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:
u32 n · UTF-16 × nending at the firstff ff ff ffplus17 0c(2024) or6b 0c(2025);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):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
name_at,scan_material_names,material_name_frame_tagandmaterial_name_end_tag;material_layer_sets_from_layersandmaterial_layer_set_usage;IfcModel::material_layer_usages;LayerBand::name.MaterialLayer::material_indexis nowOption<usize>;LayerSetDirectionandMaterialLayerSetUsage.$, and each usage writes its direction, sense and offset.PanelLayersandElementInfoPanel::layers.IFCMATERIALLAYERSETUSAGEsays what rvt-rs writes.ifc-material-layer-sets, at partial;Testing
End to end, against real files. No unit tests were added.
rvt-ifcon Snowdon, Core Interior, RE1 and the MIT house (2024 and 2025), thentools/re/layer_sets_vs_ifc.py. The report's §3 has the inputs' sha256 and the output.examples/probe_re58_material_names.rson seven files. Against the names read without rule 2, no name is lost or changed.python -m ifcopenshell.validateandtools/ci/ifc_schema_arity.pyreport nothing on all five exports.--witness-agreementholds.--profile ciwith the family and project corpora (48 binaries);cargo +1.85.0 check.What this does not do
Family:Type. Layers carry no name or category.Audit-honesty checklist
Legal and contribution hygiene
Breaking changes
ifc::entities::MaterialLayer::material_indexisOption<usize>.IfcModelgainsmaterial_layer_usages(serde default).LayerBandgainsnameand is no longerCopy.ElementInfoPanelgainslayers(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_Materialspartition objects (by ElementId), and IFC4 now emits sharedIfcMaterialLayerSetdefinitions plus per-elementIfcMaterialLayerSetUsage(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 inpartition_schema_mvp, builds sets/usages inifc::material_layer_sets_from_layers, extends the STEP writer for optional layer materials and non-default usages, and surfacesPanelLayersin the viewer element panel. Docs, support matrix, witness observations,probe_re58_material_names, andtools/re/layer_sets_vs_ifc.pydocument and score the change against Revit exports.Breaking:
MaterialLayer::material_index→Option<usize>;IfcModel::material_layer_usages;LayerBandgainsnameand is no longerCopy.Reviewed by Cursor Bugbot for commit db33a62. Configure here.