Title: Bonsai: import representations that mix polygons and curves (#4606) by petruconduraru · Pull Request #8340 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: import representations that mix polygons and curves (#4606) by petruconduraru · Pull Request #8340 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: import representations that mix polygons and curves (#4606) by petruconduraru · Pull Request #8340 · IfcOpenShell/IfcOpenShell
Description: Fixes #4606. Problem A single representation can hold both faces/polygons and loose curves (e.g. an Annotation2D with an IfcAnnotationFillArea plus an IfcGeometricCurveSet). Activating such a representation crashed: RuntimeError: internal error setting the array (fill_attribute, FACE) -> create_mesh returns None AttributeError: 'NoneType' object has no attribute 'BIMMeshProperties' Root cause IfcOpenShell returns mixed geometry as faces + loose edges and packs material_ids as [face materials, loose-edge materials]. convert_geometry_to_mesh assumed a representation was either all faces or all edges, so it fed the full material-id array (2 face + 36 loose = 38) into the per-face ios_material_ids attribute of a 2-face mesh, raising internal error setting the array. create_mesh swallowed it and returned None, hence the NoneType ... BIMMeshProperties crash. The curves were also dropped. Fix Slice material_ids to the face count for the FACE attribute, and when there are loose edges, add them to the mesh via bmesh. Normal geometry (all-face or all-edge) is unaffected: num_loose_edges is 0 and the slice is a no-op. Verification (headless Blender 5.1.2) Ground truth (ifcopenshell.geom): the representation is 2 faces + 40 edges. Before: RuntimeError → AttributeError crash. After: imports as 2 faces + 36 loose curve edges (the 32-segment circle + 4-segment square), no crash. Regression: a normal tessellated cube imports unchanged (12 faces, 8 verts). Scope Delivers what the issue asks: no crash, and both the fill area and the curves import into the one object. Per-item (item-mode) editing of the individual curve items inside a mixed representation is a separate enhancement, not wired up here; that path degrades gracefully (guarded downstream). Generated with the assistance of an AI coding tool.
Open Graph Description: Fixes #4606. Problem A single representation can hold both faces/polygons and loose curves (e.g. an Annotation2D with an IfcAnnotationFillArea plus an IfcGeometricCurveSet). Activating such a repre...
X Description: Fixes #4606. Problem A single representation can hold both faces/polygons and loose curves (e.g. an Annotation2D with an IfcAnnotationFillArea plus an IfcGeometricCurveSet). Activating such a repre...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/8340
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
| 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:846e8220-84a0-b572-5c28-5106844b3460 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D378:2EA7B6:205D2FA:2A83073:6B054015 |
| html-safe-nonce | ec8f4df3ebcf373f5bbffcb1e4abd32c71ef38747277380f51da4e4083c23292 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzc4OjJFQTdCNjoyMDVEMkZBOjJBODMwNzM6NkIwNTQwMTUiLCJ2aXNpdG9yX2lkIjoiMzgwNjkxMjM5OTk2NjI4OTk0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 88c79324d972c0ff7638b18411f084941301bfbd3c6d0dd7a6d8cd16f7fa56f2 |
| hovercard-subject-tag | pull_request:4005573950 |
| 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/8340/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 | Fixes #4606. Problem A single representation can hold both faces/polygons and loose curves (e.g. an Annotation2D with an IfcAnnotationFillArea plus an IfcGeometricCurveSet). Activating such a repre... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 220e980097d94ce616d5d11fbd5316d208e3fc93 |
| 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