Skip to content

Add material associations to IFC4 Demo Library window/door types#7653

Open
jaliste wants to merge 3 commits intoIfcOpenShell:v0.8.0from
jaliste:fix/demo-library-materials
Open

Add material associations to IFC4 Demo Library window/door types#7653
jaliste wants to merge 3 commits intoIfcOpenShell:v0.8.0from
jaliste:fix/demo-library-materials

Conversation

@jaliste
Copy link
Contributor

@jaliste jaliste commented Feb 8, 2026

Window and door types in the demo library had IfcSurfaceStyles for
appearance but no IfcMaterial associations. This caused materials
to be lost when converting to parametric elements.

Added:

  • IfcMaterial entities for Frame, Glass, and Panel styles
  • IfcMaterialDefinitionRepresentation linking styles to materials
  • IfcMaterialConstituentSet with Framing/Glazing constituents
  • IfcRelAssociatesMaterial associating constituent sets with types

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

@Moult
Copy link
Contributor

Moult commented Feb 9, 2026

G'day! Thanks for the PR, a few comments:

  1. You might want to edit src/bonsai/scripts/generate_demo_library.py instead, as it is a generated library
  2. There are specific rules on how to associate material constituents to styles using shape aspects, perhaps https://docs.ifcopenshell.org/autoapi/ifcopenshell/api/material/index.html#ifcopenshell.api.material.set_shape_aspect_constituents can help explain

@jaliste jaliste force-pushed the fix/demo-library-materials branch from d6f0034 to 518fdc2 Compare February 9, 2026 16:47
@jaliste
Copy link
Contributor Author

jaliste commented Feb 9, 2026

Thanks, so I try now to do it in the genertae_demo_library.py and I added a map to translate from "Frame" to "Framing"... but maybe it's better to change the original names in the materials in the .blend file to match the IFC naming "Framing" "Glazing"?

@Moult
Copy link
Contributor

Moult commented Feb 10, 2026

Thanks, this is better! I think you need to add the shape aspects first though: https://docs.ifcopenshell.org/autoapi/ifcopenshell/api/geometry/index.html#ifcopenshell.api.geometry.add_shape_aspect

jaliste and others added 3 commits February 10, 2026 21:17
Add support for IfcMaterialConstituentSet and IfcShapeAspect to window
and door types in the demo library generator script. This enables proper
material-to-geometry association for parametric windows/doors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Regenerated IFC2X3, IFC4, and IFC4X3 demo library files with material
constituent sets and shape aspects for window and door types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When converting a window or door to parametric via AddWindow/AddDoor,
load material constituents from the element's type. This ensures the
materials display correctly from the start instead of appearing black.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jaliste jaliste force-pushed the fix/demo-library-materials branch from 518fdc2 to 50ddd25 Compare February 11, 2026 00:26
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.

2 participants