René's URL Explorer Experiment


Title: regenerate_wall_representation raises TypeError when IfcRelConnectsPathElements has RelatingPriorities/RelatedPriorities · Issue #10054 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: regenerate_wall_representation raises TypeError when IfcRelConnectsPathElements has RelatingPriorities/RelatedPriorities · Issue #10054 · IfcOpenShell/IfcOpenShell

X Title: regenerate_wall_representation raises TypeError when IfcRelConnectsPathElements has RelatingPriorities/RelatedPriorities · Issue #10054 · IfcOpenShell/IfcOpenShell

Description: Bug Description ifcopenshell.api.geometry.regenerate_wall_representation raises TypeError when the wall's IfcRelConnectsPathElements carries per-connection priorities (RelatingPriorities / RelatedPriorities): TypeError: 'PrioritisedLayer...

Open Graph Description: Bug Description ifcopenshell.api.geometry.regenerate_wall_representation raises TypeError when the wall's IfcRelConnectsPathElements carries per-connection priorities (RelatingPriorities / RelatedP...

X Description: Bug Description ifcopenshell.api.geometry.regenerate_wall_representation raises TypeError when the wall's IfcRelConnectsPathElements carries per-connection priorities (RelatingPriorities / Rela...

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

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":"regenerate_wall_representation raises TypeError when IfcRelConnectsPathElements has RelatingPriorities/RelatedPriorities","articleBody":"### Bug Description\n\n`ifcopenshell.api.geometry.regenerate_wall_representation` raises `TypeError` when the wall's `IfcRelConnectsPathElements` carries per-connection priorities (`RelatingPriorities` / `RelatedPriorities`):\n\n```\nTypeError: 'PrioritisedLayer' object does not support item assignment\n```\n\n**Versions:** IfcOpenShell 0.9.0 (Python 3.11.14, macOS arm64). The same lines are on the current `v0.9.0` branch (`src/ifcopenshell-python/ifcopenshell/api/geometry/regenerate_wall_representation.py` L573–575) and in the 0.8.5 copy bundled with Bonsai 0.8.5.\n\n**Steps to reproduce** (script below; only IfcOpenShell + NumPy):\n\n1. IFC4 file with Model/Body and Plan/Axis contexts and one `IfcMaterialLayerSet` (one 230 mm layer, priority 50).\n2. Two `IfcWall`s with `IfcMaterialLayerSetUsage` and an axis, meeting in an L.\n3. `ifcopenshell.api.geometry.connect_path(..., \"ATEND\", \"ATSTART\")`, then `rel.RelatingPriorities = [51]`, `rel.RelatedPriorities = [50]` (a butt: the first wall runs through).\n4. `ifcopenshell.api.geometry.regenerate_wall_representation(f, wall, height=3.0)` → `TypeError`.\n\n**Cause:** `Regenerator.combine_layers`:\n\n```python\nif override_priorities:\n    for i, priority in enumerate(override_priorities[: len(layers)]):\n        layers[i][0] = priority          # layers[i] is a PrioritisedLayer namedtuple\n```\n\n**Expected:** the per-connection priorities replace the layer priorities for this connection, as IFC4 documents for `IfcRelConnectsPathElements.RelatingPriorities` / `RelatedPriorities`.\n\n**Suggested fix:**\n\n```diff\n-            for i, priority in enumerate(override_priorities[: len(layers)]):\n-                layers[i][0] = priority\n+            for i, priority in enumerate(override_priorities[: len(layers)]):\n+                layers[i] = layers[i]._replace(priority=priority)\n```\n\nWith that change (applied in the script as a subclass override, `--fixed`) the reproduction gives wall A 4.21935 m³ and wall B 2.68065 m³: A runs through to B's far face, total 6.9 m³ (= 2.3 m² × 3 m), as expected.\n\n**Why it matters:** `connect_path` writes `RelatingPriorities=[]`, so the default path never reaches this line. But per-connection priorities are the standard way to express a butt join between layered walls, and any file that carries them (from another authoring tool, or written by hand) cannot be regenerated.\n\n### Attachments\n\n\u003cdetails>\u003csummary>repro_priorities_typeerror.py — run with \u003ccode>python repro_priorities_typeerror.py\u003c/code> (TypeError) and \u003ccode>--fixed\u003c/code> (workaround)\u003c/summary>\n\n```python\n\"\"\"Minimal reproduction: IfcOpenShell 0.9.0 regenerate_wall_representation\nraises TypeError when an IfcRelConnectsPathElements carries per-connection\npriorities (RelatingPriorities / RelatedPriorities).\n\nRun (only IfcOpenShell + NumPy needed):\n\n    python -I -B repro_priorities_typeerror.py           # shows the TypeError\n    python -I -B repro_priorities_typeerror.py --fixed   # same model, workaround\n\nCause: ``Regenerator.combine_layers`` does ``layers[i][0] = priority`` on a\nlist of ``PrioritisedLayer`` namedtuples (regenerate_wall_representation.py,\naround L571-575 in 0.9.0); tuples are immutable.\n\"\"\"\nimport sys\n\nimport numpy as np\nimport ifcopenshell\nimport ifcopenshell.api.context\nimport ifcopenshell.api.geometry\nimport ifcopenshell.api.material\nimport ifcopenshell.api.project\nimport ifcopenshell.api.root\nimport ifcopenshell.api.unit\nimport ifcopenshell.geom\nimport ifcopenshell.util.element\nimport ifcopenshell.util.shape\nimport ifcopenshell.util.shape_builder\nfrom ifcopenshell.api.geometry.regenerate_wall_representation import PrioritisedLayer, Regenerator\n\n\nclass FixedRegenerator(Regenerator):\n    \"\"\"Workaround: replace the tuple instead of assigning into it.\"\"\"\n\n    def combine_layers(self, layers, override_priorities):\n        layers = [PrioritisedLayer(*layer) for layer in layers]\n        for i, priority in enumerate((override_priorities or [])[: len(layers)]):\n            layers[i] = layers[i]._replace(priority=priority)\n        results = []\n        for layer in layers:\n            if results and not layer.thickness:\n                continue\n            if results and layer.priority == results[-1].priority:\n                results[-1] = PrioritisedLayer(layer.priority, results[-1].thickness + layer.thickness)\n            else:\n                results.append(layer)\n        return results\n\n\ndef main(fixed: bool) -> int:\n    f = ifcopenshell.api.project.create_file(version=\"IFC4\")\n    ifcopenshell.api.root.create_entity(f, ifc_class=\"IfcProject\")\n    ifcopenshell.api.unit.assign_unit(f, length={\"is_metric\": True, \"raw\": \"METERS\"})\n    model = ifcopenshell.api.context.add_context(f, context_type=\"Model\")\n    ifcopenshell.api.context.add_context(f, context_type=\"Model\", context_identifier=\"Body\",\n                                         target_view=\"MODEL_VIEW\", parent=model)\n    plan = ifcopenshell.api.context.add_context(f, context_type=\"Plan\")\n    axis = ifcopenshell.api.context.add_context(f, context_type=\"Plan\", context_identifier=\"Axis\",\n                                                target_view=\"GRAPH_VIEW\", parent=plan)\n    layer_set = ifcopenshell.api.material.add_material_set(f, name=\"Brick 230\", set_type=\"IfcMaterialLayerSet\")\n    layer = ifcopenshell.api.material.add_layer(f, layer_set=layer_set,\n                                                material=ifcopenshell.api.material.add_material(f, name=\"Brick\"))\n    ifcopenshell.api.material.edit_layer(f, layer=layer, attributes={\"LayerThickness\": 0.23, \"Priority\": 50})\n    builder = ifcopenshell.util.shape_builder.ShapeBuilder(f)\n    walls = []\n    for name, origin, direction in ((\"A\", (0.0, 0.0), (1.0, 0.0)), (\"B\", (6.0, 0.0), (0.0, 1.0))):\n        wall = ifcopenshell.api.root.create_entity(f, ifc_class=\"IfcWall\", name=name)\n        ifcopenshell.api.material.assign_material(f, products=[wall], type=\"IfcMaterialLayerSetUsage\",\n                                                  material=layer_set)\n        ifcopenshell.util.element.get_material(wall).OffsetFromReferenceLine = 0.115\n        ifcopenshell.util.element.get_material(wall).DirectionSense = \"NEGATIVE\"\n        ux, uy = direction\n        ifcopenshell.api.geometry.edit_object_placement(f, product=wall, matrix=np.array(\n            [[ux, -uy, 0, origin[0]], [uy, ux, 0, origin[1]], [0, 0, 1, 0], [0, 0, 0, 1]], dtype=float))\n        ifcopenshell.api.geometry.assign_representation(f, product=wall, representation=builder.get_representation(\n            axis, items=[builder.polyline([(0.0, 0.0), (6.0 if name == \"A\" else 4.0, 0.0)])]))\n        walls.append(wall)\n    rel = ifcopenshell.api.geometry.connect_path(f, relating_element=walls[0], related_element=walls[1],\n                                                 relating_connection=\"ATEND\", related_connection=\"ATSTART\")\n    # A butt join: A's layer runs through B (IFC4 IfcRelConnectsPathElements.Relating/RelatedPriorities).\n    rel.RelatingPriorities = [51]\n    rel.RelatedPriorities = [50]\n    print(f\"ifcopenshell {ifcopenshell.version}, Python {sys.version.split()[0]}\")\n    try:\n        for wall in walls:\n            if fixed:\n                FixedRegenerator(f).regenerate(wall, height=3.0)\n            else:\n                ifcopenshell.api.geometry.regenerate_wall_representation(f, wall, height=3.0)\n    except TypeError as exc:\n        print(f\"TypeError: {exc}\")\n        return 1\n    settings = ifcopenshell.geom.settings()\n    volumes = [ifcopenshell.util.shape.get_volume(ifcopenshell.geom.create_shape(settings, w).geometry)\n               for w in walls]\n    print(\"volumes (A runs through B):\", [round(v, 6) for v in volumes], \"total\", round(sum(volumes), 6))\n    return 0\n\n\nif __name__ == \"__main__\":\n    raise SystemExit(main(\"--fixed\" in sys.argv))\n```\n\nThe workaround class is a copy of `combine_layers` with the one-line change; feel free to use it under IfcOpenShell's licence (LGPL-3.0-or-later).\n\u003c/details>\n\n### Debug and Error Output\n\n```\n$ python -I -B repro_priorities_typeerror.py\nifcopenshell 0.9.0, Python 3.11.14\nTypeError: 'PrioritisedLayer' object does not support item assignment\n$ python -I -B repro_priorities_typeerror.py --fixed\nifcopenshell 0.9.0, Python 3.11.14\nvolumes (A runs through B): [4.21935, 2.68065] total 6.9\n```\n\nA possibly related but separate observation, not part of this report: `connect_path` removes any existing `ATSTART`/`ATEND` relation at the same wall end, so with three or more walls meeting at one point only one relation survives and the regenerated solids overlap without an error. Happy to open a separate issue if that is not intended.\n","author":{"url":"https://github.com/konevenkatesh","@type":"Person","name":"konevenkatesh"},"datePublished":"2026-10-24T13:57:41Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/10054"}

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:5efe481d-2bc0-ad38-1bb9-4ddf4acb8372
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE3F2:15EB96:169DC1:1F6FF0:6B04658B
html-safe-nonce02b50b8d19c8d853bf25bb25eb940e9ee59e103a1285a8cc86595481c8a68758
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0YyOjE1RUI5NjoxNjlEQzE6MUY2RkYwOjZCMDQ2NThCIiwidmlzaXRvcl9pZCI6IjEwMzc5ODI3NTI3MjI2NzUwODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3bd77d541e3724dc8b789ef22ff777422d58173cfa4cc89315aa375e21410251
hovercard-subject-tagissue:6013694357
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/10054/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3d2bb83cf9d446f9fbb11e4002e9c971dc73f98514b78cec7e569da8f27864e1/IfcOpenShell/IfcOpenShell/issues/10054
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3d2bb83cf9d446f9fbb11e4002e9c971dc73f98514b78cec7e569da8f27864e1/IfcOpenShell/IfcOpenShell/issues/10054
og:image:altBug Description ifcopenshell.api.geometry.regenerate_wall_representation raises TypeError when the wall's IfcRelConnectsPathElements carries per-connection priorities (RelatingPriorities / RelatedP...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekonevenkatesh
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/10054#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F10054
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%2F10054
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/10054
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10054
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10054
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/10054
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10054
#10202https://github.com/IfcOpenShell/IfcOpenShell/pull/10202
#10071https://github.com/IfcOpenShell/IfcOpenShell/pull/10071
regenerate_wall_representation raises TypeError when IfcRelConnectsPathElements has RelatingPriorities/RelatedPrioritieshttps://github.com/IfcOpenShell/IfcOpenShell/issues/10054#top
#10202https://github.com/IfcOpenShell/IfcOpenShell/pull/10202
#10071https://github.com/IfcOpenShell/IfcOpenShell/pull/10071
https://github.com/konevenkatesh
konevenkateshhttps://github.com/konevenkatesh
on Oct 24, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/10054#issue-6013694357
shitobuhttps://github.com/shitobu
on Oct 26, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/10054#event-34308885740
fix(api): use namedtuple _replace when overriding PrioritisedLayer pr…https://github.com/shitobu/IfcOpenShell/commit/b22a29f87acb09b707d51ebd3da937986ce4a4b1
b22a29fhttps://github.com/shitobu/IfcOpenShell/commit/b22a29f87acb09b707d51ebd3da937986ce4a4b1
fix(api): use namedtuple _replace when overriding PrioritisedLayer pr…https://github.com/shitobu/IfcOpenShell/commit/7c7c842dd64796f198fb4afd9d7124bfd2ae4878
7c7c842https://github.com/shitobu/IfcOpenShell/commit/7c7c842dd64796f198fb4afd9d7124bfd2ae4878
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10054
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10054
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.