René's URL Explorer Experiment


Title: Geometry iterator ignores a material's IfcSurfaceStyle when its IfcMaterialDefinitionRepresentation has more than one IfcStyledItem · Issue #10111 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: Geometry iterator ignores a material's IfcSurfaceStyle when its IfcMaterialDefinitionRepresentation has more than one IfcStyledItem · Issue #10111 · IfcOpenShell/IfcOpenShell

X Title: Geometry iterator ignores a material's IfcSurfaceStyle when its IfcMaterialDefinitionRepresentation has more than one IfcStyledItem · Issue #10111 · IfcOpenShell/IfcOpenShell

Description: Bug Description When an IfcMaterial has a surface style, the geometry iterator uses that style's colour for the shapes. This stops working as soon as the material's IfcMaterialDefinitionRepresentation carries more than one IfcStyledItem....

Open Graph Description: Bug Description When an IfcMaterial has a surface style, the geometry iterator uses that style's colour for the shapes. This stops working as soon as the material's IfcMaterialDefinitionRepresentat...

X Description: Bug Description When an IfcMaterial has a surface style, the geometry iterator uses that style's colour for the shapes. This stops working as soon as the material's IfcMaterialDefinitionRep...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/10111

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Geometry iterator ignores a material's IfcSurfaceStyle when its IfcMaterialDefinitionRepresentation has more than one IfcStyledItem","articleBody":"### Bug Description\n\nWhen an `IfcMaterial` has a surface style, the geometry iterator uses that style's colour for the shapes. This stops working as soon as the material's `IfcMaterialDefinitionRepresentation` carries more than one `IfcStyledItem`. One example is a Body/MODEL_VIEW `IfcSurfaceStyleShading` together with an Annotation/Plan SECTION_VIEW `IfcFillAreaStyle`. In that case the element falls back to the default 0.9 grey, and I could not find any warning.\n\nThe result is the same:\n- whatever the order of the representations,\n- whether the representation identifier is 'Body' or 'Style',\n- and when the file is written entirely with `ifcopenshell.api.style.assign_material_style`.\n\nA section-view fill and a body shading in one material are both legitimate. `IfcMaterialDefinitionRepresentation.Representations` is a list, and a different context per view is how IFC4 expects a material to be styled for different views.\n\n**Repro** (IfcOpenShell 0.9.0.post1 from PyPI, Python 3, Linux; IFC4 and IFC4X3 behave the same):\n\n```python\nimport ifcopenshell, ifcopenshell.api, ifcopenshell.geom\n\ndef build(second_rep, schema=\"IFC4\"):\n    f = ifcopenshell.api.run(\"project.create_file\", version=schema)\n    ifcopenshell.api.run(\"root.create_entity\", f, ifc_class=\"IfcProject\", name=\"P\")\n    ifcopenshell.api.run(\"unit.assign_unit\", f)\n    model = ifcopenshell.api.run(\"context.add_context\", f, context_type=\"Model\")\n    body = ifcopenshell.api.run(\"context.add_context\", f, context_type=\"Model\",\n        context_identifier=\"Body\", target_view=\"MODEL_VIEW\", parent=model)\n    wall = ifcopenshell.api.run(\"root.create_entity\", f, ifc_class=\"IfcWall\")\n    rep = ifcopenshell.api.run(\"geometry.add_wall_representation\", f, context=body, length=5, height=3, thickness=0.2)\n    ifcopenshell.api.run(\"geometry.assign_representation\", f, product=wall, representation=rep)\n    mat = ifcopenshell.api.run(\"material.add_material\", f, name=\"M\")\n    ifcopenshell.api.run(\"material.assign_material\", f, products=[wall], type=\"IfcMaterial\", material=mat)\n    red = ifcopenshell.api.run(\"style.add_style\", f)\n    ifcopenshell.api.run(\"style.add_surface_style\", f, style=red, ifc_class=\"IfcSurfaceStyleShading\",\n        attributes={\"SurfaceColour\": {\"Name\": None, \"Red\": 1.0, \"Green\": 0.0, \"Blue\": 0.0}, \"Transparency\": 0.0})\n    ifcopenshell.api.run(\"style.assign_material_style\", f, material=mat, style=red, context=body)\n    if second_rep:\n        plan = ifcopenshell.api.run(\"context.add_context\", f, context_type=\"Plan\")\n        sec = ifcopenshell.api.run(\"context.add_context\", f, context_type=\"Plan\",\n            context_identifier=\"Annotation\", target_view=\"SECTION_VIEW\", parent=plan)\n        fill = f.createIfcFillAreaStyle(\"Hatch\", [f.createIfcColourRgb(None, 0.0, 1.0, 0.0)], False)\n        ifcopenshell.api.run(\"style.assign_material_style\", f, material=mat, style=fill, context=sec)\n    return f, wall, mat\n\nfor second in (False, True):\n    f, wall, mat = build(second)\n    n = len(mat.HasRepresentation[0].Representations)\n    shape = ifcopenshell.geom.create_shape(ifcopenshell.geom.settings(), wall)\n    print(\"representations:\", n,\n          [(m.name, round(m.diffuse.r(), 2)) for m in shape.geometry.materials])\n```\n\n**Expected:** the second case also gives the red body shading (`r = 1.0`). The fill style belongs to a different context and is not a surface style.\n\n**Actual:**\n```\nrepresentations: 1 [('IfcSurfaceStyleShading-27', 1.0)]\nrepresentations: 2 [('IfcWall', 0.9)]\n```\n`ifcopenshell.geom.iterator` gives the same result.\n\n### Cause\n\n`mapping::map_impl(const IfcMaterial&)` gathers every `IfcStyledItem` from every `Representations` entry. It maps a style only when there is exactly one:\n\nhttps://github.com/IfcOpenShell/IfcOpenShell/blob/28bae192780ebd34936441f1f7bc1ffb9d282be9/src/ifcgeom/mapping/mapping.cpp#L594-L631\n\nThe condition is at L612:\nhttps://github.com/IfcOpenShell/IfcOpenShell/blob/28bae192780ebd34936441f1f7bc1ffb9d282be9/src/ifcgeom/mapping/mapping.cpp#L612\n\nWith two or more styled items, nothing is mapped and the function ends in `failed_on_purpose_.insert(material); return nullptr;`.\n\nRemoving that count check alone would not be enough. `map_impl(const IfcStyledItem&)` (L649) would warn \"Only IfcSurfaceStyle is supported\" and give up on the `IfcFillAreaStyle` item. A fix has to choose among the items rather than fail on the first.\n\nPossible directions; a maintainer may prefer another:\n- prefer styled items whose representation context is a MODEL_VIEW, 'Body' or 'Style' one, or\n- iterate over all styled items and use the first one that maps to a surface style, skipping curve, fill-area and text styles.\n\n### Related\n\n- #8662 and #8663 (material surface styles dropped by `append_asset`) touch the same data but a different code path.\n\n### Environment\n\nIfcOpenShell 0.9.0.post1 (PyPI wheel, CPython 3, Debian Linux x86_64). I checked the source at `28bae192780ebd34936441f1f7bc1ffb9d282be9` (2026-10-29, `main`), and the condition is unchanged there.\n","author":{"url":"https://github.com/GeneralPawz","@type":"Person","name":"GeneralPawz"},"datePublished":"2026-10-31T23:51:53Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/10111"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:fc0777fd-3072-5cb6-f35d-9dc28b8d6cac
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE15E:208411:18EADE:2249D1:6B0465B4
html-safe-noncef3049d2302eb3045380ac5d83f9ad6daea163abd56fbfa7646daba2cb4063c7f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTVFOjIwODQxMToxOEVBREU6MjI0OUQxOjZCMDQ2NUI0IiwidmlzaXRvcl9pZCI6IjU0OTYwNDY1MDExNjU4MTkzMTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac74768ad6c5edaa574c40dee74589d16de1cce7b52beda161cbd68adc33bfce36
hovercard-subject-tagissue:6141145225
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/10111/issue_layout
twitter:imagehttps://opengraph.githubassets.com/99527695330aa1a4928cc4e16bc45d6ced687b2b5b1a39e7fbe8338dd4a17cfb/IfcOpenShell/IfcOpenShell/issues/10111
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/99527695330aa1a4928cc4e16bc45d6ced687b2b5b1a39e7fbe8338dd4a17cfb/IfcOpenShell/IfcOpenShell/issues/10111
og:image:altBug Description When an IfcMaterial has a surface style, the geometry iterator uses that style's colour for the shapes. This stops working as soon as the material's IfcMaterialDefinitionRepresentat...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameGeneralPawz
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
turbo-cache-controlno-preview
go-importgithub.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git
octolytics-dimension-user_id13692563
octolytics-dimension-user_loginIfcOpenShell
octolytics-dimension-repository_id40473201
octolytics-dimension-repository_nwoIfcOpenShell/IfcOpenShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id40473201
octolytics-dimension-repository_network_root_nwoIfcOpenShell/IfcOpenShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/issues/10111#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F10111
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F10111
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10111
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10111
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10111
IfcOpenShellhttps://github.com/IfcOpenShell
IfcOpenShellhttps://github.com/IfcOpenShell/IfcOpenShell
Codehttps://github.com/IfcOpenShell/IfcOpenShell
Issues1.2k (1.2k)https://github.com/IfcOpenShell/IfcOpenShell/issues
Pull requests936 (936)https://github.com/IfcOpenShell/IfcOpenShell/pulls
Discussionshttps://github.com/IfcOpenShell/IfcOpenShell/discussions
Actionshttps://github.com/IfcOpenShell/IfcOpenShell/actions
Projectshttps://github.com/IfcOpenShell/IfcOpenShell/projects
Wikihttps://github.com/IfcOpenShell/IfcOpenShell/wiki
Security and qualityhttps://github.com/IfcOpenShell/IfcOpenShell/security
Insightshttps://github.com/IfcOpenShell/IfcOpenShell/insights
https://github.com/IfcOpenShell/IfcOpenShell
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10111
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10111
#10286https://github.com/IfcOpenShell/IfcOpenShell/pull/10286
Geometry iterator ignores a material's IfcSurfaceStyle when its IfcMaterialDefinitionRepresentation has more than one IfcStyledItemhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10111#top
#10286https://github.com/IfcOpenShell/IfcOpenShell/pull/10286
https://github.com/GeneralPawz
GeneralPawzhttps://github.com/GeneralPawz
on Oct 31, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/10111#issue-6141145225
IfcOpenShell/src/ifcgeom/mapping/mapping.cpphttps://github.com/IfcOpenShell/IfcOpenShell/blob/28bae192780ebd34936441f1f7bc1ffb9d282be9/src/ifcgeom/mapping/mapping.cpp#L594-L631
28bae19https://github.com/IfcOpenShell/IfcOpenShell/commit/28bae192780ebd34936441f1f7bc1ffb9d282be9
IfcOpenShell/src/ifcgeom/mapping/mapping.cpphttps://github.com/IfcOpenShell/IfcOpenShell/blob/28bae192780ebd34936441f1f7bc1ffb9d282be9/src/ifcgeom/mapping/mapping.cpp#L612
28bae19https://github.com/IfcOpenShell/IfcOpenShell/commit/28bae192780ebd34936441f1f7bc1ffb9d282be9
project.append_asset drops material surface styles when the material is reached via IfcMaterialLayerSetUsage #8662https://github.com/IfcOpenShell/IfcOpenShell/issues/8662
api.project.append_asset: preserve material styles reached via a layer set usage #8663https://github.com/IfcOpenShell/IfcOpenShell/pull/8663
3adoshkahttps://github.com/3adoshka
on Nov 20, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/10111#event-36718265952
fix(ifcgeom): map IfcStyledItem when material has multiple items (Ifc…https://github.com/3adoshka/IfcOpenShell/commit/5850876f39928c01dd115825d4d03eda406ca1a2
Ifc…https://github.com/IfcOpenShell/IfcOpenShell/issues/10111
5850876https://github.com/3adoshka/IfcOpenShell/commit/5850876f39928c01dd115825d4d03eda406ca1a2
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10111
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10111
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.