Repository navigation
fix(ifc): a material's colour reaches IFC viewers through an IfcMaterialDefinitionRepresentation - #1940
Merged
Conversation
…ialDefinitionRepresentation
Each coloured material's IfcStyledItem was written with no Item, outside any
representation, so nothing tied the colour to the material or to any
element. It now sits in an IfcStyledRepresentation ('Style', 'Material') of
an IfcMaterialDefinitionRepresentation naming the material, the IFC4
mechanism viewers read for a material's surface style.
…tion and styled representations (Measure 43511650641)
Owner
Author
|
Measure 43511650641: an unfiltered run against
The IFC4 schema validation of the new entities is CI's IfcOpenShell job, which runs now that the PR is ready. |
DrunkOnJava
marked this pull request as ready for review
November 13, 2026 22:10
# Conflicts: # research/witness/magnetar-2024-core-interior-slim/observations/rvt-rs.json # research/witness/magnetar-2024-core-interior/observations/rvt-rs.json
…1939's quantities and this change's material representations (Measure 43520712633)
DrunkOnJava
added a commit
that referenced
this pull request
Nov 13, 2026
…r --revit-property-sets, and docs and messages that say what the export does (batch 9) (#1946) ## Summary Batch 9's confirmed findings that change no IFC value, each re-read against the code by Claude: - **One material rule.** The viewer's schedule (`scene_graph::build_schedule`) read only an element's single material, so a layered wall showed none where the elements CSV names its layer set. `schedule_csv::MaterialNames` holds the CSV's rule (profile set, layer set, single material, constituents) and both use it. - **Counts after `--revit-property-sets`.** `export_pipeline` called `recount_exported` after every model-changing step but `revit_property_sets::attach`, so `exported.total_entities` missed the sets it adds. - **No storey means the building.** `BuildingElement.storey_index`, `ElementInput.storey_index`, a `step_writer` comment and the no-Level warning said an element with no storey goes to storey 0, or to a fallback storey. The writer contains it in the building (RE-27, RE-124), and they now say so. - **Docs that misstated the code.** - `BuilderOptions.units` named a `build_unit_list` that does not exist, and claimed the units become the `IfcUnitAssignment`; the writer's assignment is fixed SI (#403). - `ScheduleRow.guid` is the ElementId, not the GlobalId. - The pbr comment named the 2.2 gamma; the code applies the exact sRGB curve. - **Small guards.** - The element panel prints a length that rounds to zero as `0.000`, as its own rule says. - The glTF export drops a material index past the model's materials, as the STEP writer does. - `attach_wall_top_joins` replaces `m_wall_top_joined` rather than pushing a second copy. ## Motivation Batch 9, an export bug hunt: 40 DeepSeek checkers and 30 verifiers, $3.79. Two other fixes from it change exports and are their own PRs: #1939 (the opening box height) and #1940 (material colours). The rules that run on unmeasured releases are #1945. ## Testing No IFC value changes. `diagnostics.json` changes only in the no-Level warning's text, and in `total_entities` under `--revit-property-sets`, which no Measure run uses. The unfiltered Measure with the samples is in this PR's comments, to show the exports byte-identical and give the gates verdict. ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR - [x] A user-visible change has its entry as a fragment under `changelog.d/fixed/`
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
Every coloured material's surface style was written as an
IfcStyledItemwith noItem, outside any representation. IFC4 allows anIfcStyledItemwith noItemonly inside anIfcStyledRepresentationof anIfcMaterialDefinitionRepresentation, which is how a material carries its surface style. None was written, so no IFC viewer could tie the colour to the material or to an element. Each coloured material now getsIFCSTYLEDREPRESENTATION(#context,'Style','Material',(#styled_item))andIFCMATERIALDEFINITIONREPRESENTATION($,$,(#styled_representation),#material).Motivation
Found by the batch 9 export audit: a DeepSeek checker's lead, re-read against the code by Claude.
src/ifc/step_writer.rsemitted the colour and rendering entities with no path to the material. The glTF export already carries the colours, so only IFC consumers missed them.Changes
src/ifc/step_writer.rs: two entities per coloured material, and the comment that described them.changelog.d/fixed/material-colour-reaches-viewers.md.Testing
The unfiltered Measure against
mainis in this PR's comments, and should show:material_colours_vs_ifcandglb_material_colours_vs_ifcfind surface styles by name).The IfcOpenShell validator and schema jobs check the new entities against the IFC4 schema. Core Interior's witness observations count entities, so they are refreshed from CI's artifact if they drift.
Audit-honesty checklist
changelog.d/fixed/