René's URL Explorer Experiment


Title: Polyline insertion near heavy linked IFC models: ray_cast_by_proximity_2d crash on None verts + severe slowdown from snapping against linked geometry · Issue #8187 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: Polyline insertion near heavy linked IFC models: ray_cast_by_proximity_2d crash on None verts + severe slowdown from snapping against linked geometry · Issue #8187 · IfcOpenShell/IfcOpenShell

X Title: Polyline insertion near heavy linked IFC models: ray_cast_by_proximity_2d crash on None verts + severe slowdown from snapping against linked geometry · Issue #8187 · IfcOpenShell/IfcOpenShell

Description: Bug Description Summary Inserting an IFC element via the polyline tool (Shift+A) in a scene containing a heavy linked IFC model has two distinct problems, both in the snap raycast path. Both have a confirmed fix below (tested on my proje...

Open Graph Description: Bug Description Summary Inserting an IFC element via the polyline tool (Shift+A) in a scene containing a heavy linked IFC model has two distinct problems, both in the snap raycast path. Both have a...

X Description: Bug Description Summary Inserting an IFC element via the polyline tool (Shift+A) in a scene containing a heavy linked IFC model has two distinct problems, both in the snap raycast path. Both have a...

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

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":"Polyline insertion near heavy linked IFC models: ray_cast_by_proximity_2d crash on None verts + severe slowdown from snapping against linked geometry","articleBody":"### Bug Description\n\n**Summary**\nInserting an IFC element via the polyline tool (Shift+A) in a scene containing a heavy linked IFC model has two distinct problems, both in the snap raycast path. Both have a confirmed fix below (tested on my project — crash gone, insertion went from ~30s to instant).\n\nProblem 1 — Crash: TypeError: cannot unpack non-iterable NoneType\n\nIn Raycast.ray_cast_by_proximity_2d (bonsai/tool/raycast.py), edge vertices are projected to 2D via view3d_utils.location_3d_to_region_2d, which returns None for vertices behind the camera / outside the projection. The block that builds edge_verts only handles the case where exactly one vertex is None (the ^ XOR at ~line 396). When both vertices project to None — an entire edge behind the camera, common when the viewport is close to or inside dense linked geometry — it stores (None, None), and the following loop does p0x, p0y = p0 (line 424), unpacking None and raising the TypeError. The crash fires on every handle_mouse_move, making placement impossible.\n\nFix (guard the loop):\n###################################\npython        \n\nfor e in edges:\n            p0, p1 = edge_verts[e]\n            if p0 is None or p1 is None:\n                continue\n            p0x, p0y = p0\n            p1x, p1y = p1\n###################################\nThese edges aren't on screen, so no usable snap is lost. Also covers the case where intersect_edge_region_border returns None.\n\n\n\n**Problem 2 — Severe slowdown: snap evaluates heavy linked models**\n\nSnap.detect_snapping_points calls Raycast.filter_objects_to_raycast, which adds every bounding-box-hit object to the raycast list, including heavy linked reference models. On a federated project this makes each insertion take ~30s before the modal even responds. Excluding the linked collection from the View Layer avoids it, but also hides the model.\n\nSuggested fix — let filter_objects_to_raycast skip linked reference objects, ideally behind a user-facing toggle:\n###################################\npython    \n\n@classmethod\n    def _is_linked_reference(cls, obj):\n        if getattr(obj, \"library\", None) is not None:\n            return True\n        if getattr(obj, \"override_library\", None) is not None:\n            return True\n        inst = getattr(obj, \"instance_collection\", None)\n        if inst is not None and getattr(inst, \"library\", None) is not None:\n            return True\n        return False\n###################################\n\nand, inside the loop in filter_objects_to_raycast, before processing each object:\n###################################\npython        \n\nfor obj, bbox_2d in objs_2d_bbox:\n            if cls.SKIP_LINKED_OBJECTS_IN_SNAP and cls._is_linked_reference(obj):\n                continue\n            ...\n###################################\nThis keeps linked models visible while excluding them from snap evaluation, addressing both the performance cost and the crash source at once. A toggle (UI/keymap) lets users still snap onto linked geometry when needed.\n\n\n**To Reproduce**\nLoad a heavy linked IFC model (mine: ~3,863 objects, ~1.42M vertices, ~2.57M faces).\nShift+A to insert a new IFC element near the linked geometry.\nMove the mouse while the polyline modal is active → crash (Problem 1) and/or ~30s freeze before the modal responds (Problem 2).\n\n**Traceback (Problem 1)**\n###################################\nFile \"...\\bonsai\\bim\\module\\model\\polyline.py\", line 411, in handle_mouse_move\n    detected_snaps = tool.Snap.detect_snapping_points(context, event, self.objs_2d_bbox, self.tool_state)\nFile \"...\\bonsai\\tool\\snap.py\", line 416, in detect_snapping_points\n    snap_points = tool.Raycast.ray_cast_by_proximity_2d(context, event, snap_obj)\nFile \"...\\bonsai\\tool\\raycast.py\", line 424, in ray_cast_by_proximity_2d\n    p0x, p0y = p0\n    ^^^^^^^^\nTypeError: cannot unpack non-iterable NoneType object\n###################################\n\n**Validation**\nBoth fixes applied locally and tested: the crash no longer occurs, and with linked objects skipped in the snap filter, insertion near the linked model is instant (was ~30s) while the model stays visible.\n\n\n\n**Environment**\n\nOS: Windows\nBlender: 5.1.2 (portable)\nPython: 3.13\nBonsai: v0.8.5\n\n### Attachments\n\n_No response_\n\n### Debug and Error Output\n\n```true\n\n```","author":{"url":"https://github.com/valentenet","@type":"Person","name":"valentenet"},"datePublished":"2026-06-19T13:01:15Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/8187"}

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:a6849fcc-79f8-5a9c-151d-a9a2d3005de4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA01C:72378:36F7DE:493582:6B04B9FC
html-safe-nonce1f0c9e633431fa8532038591891bb3f015b1b9e12ae4622f641ae9796084e2ce
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDFDOjcyMzc4OjM2RjdERTo0OTM1ODI6NkIwNEI5RkMiLCJ2aXNpdG9yX2lkIjoiNTAwMDUwODM3NzcxNjk2NjM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac5e9b09affd571690ac5e37fa141f709f815ccee1fdc43253b3c54308ce530fa4
hovercard-subject-tagissue:4700896062
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/8187/issue_layout
twitter:imagehttps://opengraph.githubassets.com/af7e64d60899cd2d34afb6578cd783a3a526adf4c2154bc51171395185cab20b/IfcOpenShell/IfcOpenShell/issues/8187
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/af7e64d60899cd2d34afb6578cd783a3a526adf4c2154bc51171395185cab20b/IfcOpenShell/IfcOpenShell/issues/8187
og:image:altBug Description Summary Inserting an IFC element via the polyline tool (Shift+A) in a scene containing a heavy linked IFC model has two distinct problems, both in the snap raycast path. Both have a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevalentenet
hostnamegithub.com
expected-hostnamegithub.com
None378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7
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
releaseb032e77f1ea437ede6c115446a0a467709b468e7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/issues/8187#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F8187
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%2F8187
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/8187
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8187
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8187
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 requests939 (939)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/8187
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8187
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
Polyline insertion near heavy linked IFC models: ray_cast_by_proximity_2d crash on None verts + severe slowdown from snapping against linked geometryhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8187#top
https://github.com/brunoperdigao
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
PR Proposedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
https://github.com/valentenet
valentenethttps://github.com/valentenet
on Jun 19, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8187#issue-4700896062
@classmethodhttps://github.com/classmethod
valentenethttps://github.com/valentenet
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
on Jun 19, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8187#event-26958232353
Gorgious56https://github.com/Gorgious56
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
on Jun 22, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8187#event-27034937940
brunoperdigaohttps://github.com/brunoperdigao
on Jun 22, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8187#event-27041481687
https://github.com/petruconduraru
petruconduraruhttps://github.com/petruconduraru
on Jul 5, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8187#issuecomment-4885882428
petruconduraruhttps://github.com/petruconduraru
PR Proposedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
on Jul 7, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8187#event-27671351506
petruconduraruhttps://github.com/petruconduraru
on Jul 9, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8187#event-27759996630
Bonsai: skip fully off-screen edges in 2D proximity snap IfcOpenShell…https://github.com/BIMvoice/IfcOpenShell/commit/c1d3523a63214bf28b97621ae9a6194b064d4f2a
IfcOpenShell…https://github.com/IfcOpenShell/IfcOpenShell/issues/8187
c1d3523https://github.com/BIMvoice/IfcOpenShell/commit/c1d3523a63214bf28b97621ae9a6194b064d4f2a
https://github.com/valentenet
valentenethttps://github.com/valentenet
on Jul 10, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8187#issuecomment-4932455615
https://github.com/brunoperdigao
brunoperdigaohttps://github.com/brunoperdigao
on Aug 23, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8187#issuecomment-5386439659
@valentenethttps://github.com/valentenet
#9337https://github.com/IfcOpenShell/IfcOpenShell/pull/9337
brunoperdigaohttps://github.com/brunoperdigao
completedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 23, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8187#event-29873159891
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8187
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8187
brunoperdigaohttps://github.com/brunoperdigao
Bonsaihttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22Bonsai%22
PR Proposedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%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.