Title: Bonsai: guard MEP Add Bend against parallel segments (#6393) by petruconduraru · Pull Request #8533 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: guard MEP Add Bend against parallel segments (#6393) by petruconduraru · Pull Request #8533 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: guard MEP Add Bend against parallel segments (#6393) by petruconduraru · Pull Request #8533 · IfcOpenShell/IfcOpenShell
Description: Closes #6393. Problem Adding a bend to two MEP segments crashes when the segments are parallel: TypeError: 'NoneType' object is not subscriptable .../bonsai/bim/module/model/mep.py MEPAddBend._execute tool.Cad.intersect_edges returns None when the two segment axes have no unique intersection (parallel, collinear, or zero-length), and MEPAddBend._execute immediately did intersect_edges(...)[0]. The auto-dispatch "Add Fitting" path already guards is_parallel before calling, but the direct bim.mep_add_bend operator (the "Add Bend" toolbar button and the edit-preview flow) had no such guard. Fix (src/bonsai/bonsai/bim/module/model/mep.py) Capture the intersect_edges result; when it is None, self.report({"ERROR"}, ...) with a clear message and return {"CANCELLED"} instead of subscripting None. Mirrors the existing parallel guard on the dispatch path. Verification (live, headless Blender) Before: two parallel duct segments + bim.mep_add_bend → TypeError: 'NoneType' object is not subscriptable (exact issue traceback); intersect_edges returned None. After: same input → clean "The two segments are parallel, so a bend cannot be computed. Select two non-parallel segments." and CANCELLED, no internal traceback. No regression: a perpendicular pair still creates the bend ({'FINISHED'}, IfcDuctFitting + IfcDuctFittingType/BEND). Generated with the assistance of an AI coding tool. 🤖 Generated with Claude Code
Open Graph Description: Closes #6393. Problem Adding a bend to two MEP segments crashes when the segments are parallel: TypeError: 'NoneType' object is not subscriptable .../bonsai/bim/module/model/mep.py MEPAd...
X Description: Closes #6393. Problem Adding a bend to two MEP segments crashes when the segments are parallel: TypeError: 'NoneType' object is not subscriptable .../bonsai/bim/module/model/mep.p...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/8533
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:10e3d83b-99e2-9f65-2d87-c7ccc14a843a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9360:2C0F2B:268CAF:335EAB:6B04B60A |
| html-safe-nonce | 141b0d98c47ff396adf59176dae2269775a76ae32bc778ed00afc8c5fde88100 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzYwOjJDMEYyQjoyNjhDQUY6MzM1RUFCOjZCMDRCNjBBIiwidmlzaXRvcl9pZCI6IjU1NTI3NTA1Mjc3MTg0MDU2NDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | dfb983c46146717fd179ddcd9acb31221803fddd4f5c045e8d75a486ff899af2 |
| hovercard-subject-tag | pull_request:4038056066 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/IfcOpenShell/IfcOpenShell/pull/8533/files |
| twitter:image | https://avatars.githubusercontent.com/u/139251053?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/139251053?s=400&v=4 |
| og:image:alt | Closes #6393. Problem Adding a bend to two MEP segments crashes when the segments are parallel: TypeError: 'NoneType' object is not subscriptable .../bonsai/bim/module/model/mep.py MEPAd... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 378bd702ac792b3550e484ad39d9a898fcd25bb52ba6962b0c9cc457c1ea71c7 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git |
| octolytics-dimension-user_id | 13692563 |
| octolytics-dimension-user_login | IfcOpenShell |
| octolytics-dimension-repository_id | 40473201 |
| octolytics-dimension-repository_nwo | IfcOpenShell/IfcOpenShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 40473201 |
| octolytics-dimension-repository_network_root_nwo | IfcOpenShell/IfcOpenShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b032e77f1ea437ede6c115446a0a467709b468e7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width