René's URL Explorer Experiment


Title: Opening applied to sole instance of a typed/mapped representation silently disappears in Object mode · Issue #9348 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: Opening applied to sole instance of a typed/mapped representation silently disappears in Object mode · Issue #9348 · IfcOpenShell/IfcOpenShell

X Title: Opening applied to sole instance of a typed/mapped representation silently disappears in Object mode · Issue #9348 · IfcOpenShell/IfcOpenShell

Description: Summary When an IfcOpeningElement voids an element that is the sole occurrence of a shared/type representation (e.g. a MappedRepresentation from an IfcElementType), the element's Body geometry silently disappears in Bonsai's Object mode ...

Open Graph Description: Summary When an IfcOpeningElement voids an element that is the sole occurrence of a shared/type representation (e.g. a MappedRepresentation from an IfcElementType), the element's Body geometry sile...

X Description: Summary When an IfcOpeningElement voids an element that is the sole occurrence of a shared/type representation (e.g. a MappedRepresentation from an IfcElementType), the element's Body geometry ...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Opening applied to sole instance of a typed/mapped representation silently disappears in Object mode","articleBody":"## Summary\n\nWhen an `IfcOpeningElement` voids an element that is the **sole occurrence** of a shared/type representation (e.g. a `MappedRepresentation` from an `IfcElementType`), the element's Body geometry silently disappears in Bonsai's Object mode — no exception, no warning/error logged, mesh ends up with 0 vertices. Edit mode / Item mode still show the geometry correctly, since those bypass this code path entirely.\n\nReproduced with `IfcRoofType`/`IfcRoof` and `IfcWallType`/`IfcWall` alike — this is not element-class-specific.\n\n## Root cause\n\n`IfcGeom::mapping::reuse_ok_()` in [`src/ifcgeom/mapping/mapping.cpp`](https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/src/ifcgeom/mapping/mapping.cpp):\n\n```cpp\nbool mapping::reuse_ok_(const IfcSchema::IfcProduct::list::ptr& products) {\n    if (settings_.get\u003csettings::UseWorldCoords>().get()) return false;\n    if (products->size() == 1) return true;   // \u003c-- short-circuits before the openings check below\n    for (...) {\n        if (!DisableOpeningSubtractions && find_openings(product)->size()) return false;\n        ...\n    }\n    return ...;\n}\n```\n\n`reuse_ok_` is called from `mapping::get_representations()` on a product list that has already been narrowed by whatever `include=` filter the caller supplied to `ifcopenshell.geom.iterator` (e.g. Bonsai's `reimport_element_representations`, which scopes the iterator to just the occurrence(s) being reimported). Whenever that filtered list happens to contain exactly one product — the common case when editing the only instance of a type — the `products->size() == 1` fast path returns `true` **without ever reaching the `find_openings()` check**, regardless of whether that single product actually has an opening.\n\nBecause reuse is (incorrectly) reported as OK, geometry generation proceeds down the shared/reuse path instead of computing an individual cut shape for the occurrence. The resulting shape ends up attributed to a different product than the one requested (or to the type product, which typically has no consuming scene object in downstream tooling), so the actually-edited occurrence never receives updated geometry. Nothing throws or logs an error, so the failure is silent.\n\nWith **two or more** products in the filtered list, the loop's `find_openings()` check runs as intended, correctly disqualifies reuse, and each occurrence is processed individually — which is why the bug only manifests for singleton occurrences and is easy to miss in testing (any file with ≥2 instances of the affected type masks it).\n\n## Reproduction\n\n1. Create a mesh-based `IfcElementType` (e.g. `IfcRoofType` or `IfcWallType`) with a `Body`/`MappedRepresentation`.\n2. Create exactly **one** occurrence of that type in the model.\n3. Void the occurrence with an `IfcOpeningElement` (`IfcRelVoidsElement`).\n4. Regenerate/reimport the occurrence's Body representation (in Bonsai: this happens automatically after adding the opening).\n\n**Observed:** the occurrence's mesh comes back with 0 vertices/faces in Object mode. `ifcopenshell.geom.create_shape()` called directly on the element returns correct, non-empty geometry with the opening properly subtracted — confirming the boolean/CSG kernel itself is not at fault. The bug is entirely in the reuse-detection short-circuit above.\n\n**Workaround:** add a second occurrence of the same type (or unlink the occurrence from its type, converting the representation to an immediate/non-shared one) — either avoids the buggy code path.\n\n## Suggested fix\n\nDon't let the `size() == 1` fast path bypass the openings check — e.g. only take the fast path when the single product also has no openings (and no other per-product disqualifying condition), so `reuse_ok_` degrades to running the same check it would for a multi-product list.\n\n## Environment\n\n- Investigated against the `v0.8.0` branch of this repo.\n- Confirmed via direct `ifcopenshell.geom.create_shape()` calls and by instrumenting `ifcopenshell.util.element.get_elements_by_representation` / `resolve_representation` / `tool.Loader.get_representation_id_from_shape` / `tool.Geometry.change_object_data` inside a running Bonsai session, comparing a reproducing single-occurrence case against a non-reproducing multi-occurrence case.\n","author":{"url":"https://github.com/sboddy","@type":"Person","name":"sboddy"},"datePublished":"2026-08-23T14:47:20Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9348"}

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:d002c581-217d-ff57-d8da-1b0c54070022
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBCB6:3D1C6E:349669:4A0622:6B046D47
html-safe-noncebcf5e7dd39c45893df124d84d19fc352260dc54f4a12c633048a0f7da06275f9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0I2OjNEMUM2RTozNDk2Njk6NEEwNjIyOjZCMDQ2RDQ3IiwidmlzaXRvcl9pZCI6IjM3NjE4MTUxNDAyNzkwMjA4NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac30e7b44fd2258e716c16933130b2d1fa82d984e8173cd149b6704c14edc82b8e
hovercard-subject-tagissue:5227444189
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/9348/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a3350b06d3abac20934972aac10cee573ba27e2ee9e6bad4b1ad4d4343377568/IfcOpenShell/IfcOpenShell/issues/9348
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a3350b06d3abac20934972aac10cee573ba27e2ee9e6bad4b1ad4d4343377568/IfcOpenShell/IfcOpenShell/issues/9348
og:image:altSummary When an IfcOpeningElement voids an element that is the sole occurrence of a shared/type representation (e.g. a MappedRepresentation from an IfcElementType), the element's Body geometry sile...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesboddy
hostnamegithub.com
expected-hostnamegithub.com
Noneae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f
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
releasecfb5f24c6e01d85f70804652a5107e5cac03a161
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/issues/9348#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F9348
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%2F9348
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/9348
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/9348
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/9348
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/9348
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/9348
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
#9349https://github.com/IfcOpenShell/IfcOpenShell/pull/9349
Opening applied to sole instance of a typed/mapped representation silently disappears in Object modehttps://github.com/IfcOpenShell/IfcOpenShell/issues/9348#top
#9349https://github.com/IfcOpenShell/IfcOpenShell/pull/9349
https://github.com/sboddy
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
IfcOpenShell-Corehttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22IfcOpenShell-Core%22
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
Severity:MajorBroken feature, invalid IFChttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Severity%3AMajor%22
https://github.com/sboddy
sboddyhttps://github.com/sboddy
on Aug 23, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/9348#issue-5227444189
src/ifcgeom/mapping/mapping.cpphttps://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/src/ifcgeom/mapping/mapping.cpp
sboddyhttps://github.com/sboddy
on Aug 23, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/9348#event-29874085504
sboddyhttps://github.com/sboddy
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
IfcOpenShell-Corehttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22IfcOpenShell-Core%22
Severity:MajorBroken feature, invalid IFChttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Severity%3AMajor%22
on Aug 23, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/9348#event-29874095087
sboddyhttps://github.com/sboddy
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
on Aug 23, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/9348#event-29874097576
sboddyhttps://github.com/sboddy
on Aug 23, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/9348#event-29877276939
Fix silent geometry loss for sole occurrence of a typed openinghttps://github.com/sboddy/IfcOpenShell/commit/90940943c0bf0423e8eefae9ca0a7cce5cb214fb
https://docs.github.com/articles/closing-issues-via-commit-messages
9094094https://github.com/sboddy/IfcOpenShell/commit/90940943c0bf0423e8eefae9ca0a7cce5cb214fb
sboddyhttps://github.com/sboddy
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
on Aug 23, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/9348#event-29877472143
sboddyhttps://github.com/sboddy
Fix silent geometry loss for sole occurrence of a typed opening #9349https://github.com/IfcOpenShell/IfcOpenShell/pull/9349
on Aug 23, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/9348#event-29877479766
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/9348
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/9348
sboddyhttps://github.com/sboddy
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
IfcOpenShell-Corehttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22IfcOpenShell-Core%22
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
Severity:MajorBroken feature, invalid IFChttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Severity%3AMajor%22
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
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.