Title: Bonsai: pick the true sweep edge in detect_extrusion_edge (#5898) by petruconduraru · Pull Request #8501 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: pick the true sweep edge in detect_extrusion_edge (#5898) by petruconduraru · Pull Request #8501 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: pick the true sweep edge in detect_extrusion_edge (#5898) by petruconduraru · Pull Request #8501 · IfcOpenShell/IfcOpenShell
Description: Fixes #5898. Problem Converting slabs to IfcArbitraryProfileDefWithVoids renders incorrect geometry: 12 of the 69 slabs in the reported sample collapse from ~2500 volume to ~0. Root cause Not the C++ WithVoids path. That path is correct: a hand-built square-with-square-hole extrusion renders volume 168.0 = (100-16)x2 exactly, closed and manifold. The defect is in Bonsai's Helper.detect_extrusion_edge (geometry/helper.py): it returned the first mesh edge that leaves the profile plane by more than 1e-6. For the bad slabs the first such edge (in arbitrary bmesh order) is a nearly lateral diagonal that only marginally clears the threshold, so the resulting IfcExtrudedAreaSolid.ExtrudedDirection lies in the profile plane (local Z = 0) with a bogus large depth. Extruding a planar profile along an in-plane direction is a legitimately degenerate, zero-volume sliver, which the C++ renders faithfully. Fix Scan all candidate edges and return the one whose direction is most aligned with the profile-face normal, i.e. the genuine through-thickness sweep edge, keeping the same [in_profile_vertex, off_plane_vertex] return orientation. This benefits all four auto-detect callers. Verification (headless Blender 5.1 / Bonsai 0.8.6, local IfcConvert OCC 7.9.2) Re-derived all 69 slabs, saved, rendered, and compared per-slab signed-tetra volume against the original Brep ground truth: before: 12 slabs degenerate (e.g. 2570.70 -> 0.0055) after: all 69 match Brep to 5 to 6 significant figures (worst 0.01%); the degenerate 12 are restored (0.0055 -> 2570.70) and the 57 already-correct slabs are volume-identical. Verified with the actual staged file installed into Bonsai, not a monkeypatch. 🤖 Generated with Claude Code
Open Graph Description: Fixes #5898. Problem Converting slabs to IfcArbitraryProfileDefWithVoids renders incorrect geometry: 12 of the 69 slabs in the reported sample collapse from ~2500 volume to ~0. Root cause Not the C...
X Description: Fixes #5898. Problem Converting slabs to IfcArbitraryProfileDefWithVoids renders incorrect geometry: 12 of the 69 slabs in the reported sample collapse from ~2500 volume to ~0. Root cause Not the C...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/8501
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:182c545f-890e-5e43-871a-fdad5ffe2127 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C5F8:3E863D:239120:30AE3E:6B04B631 |
| html-safe-nonce | ad753ced52d64c149ad8c81a165520fa5668b4d2878e757168c03b54b3703f61 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUY4OjNFODYzRDoyMzkxMjA6MzBBRTNFOjZCMDRCNjMxIiwidmlzaXRvcl9pZCI6Ijg3NTYyNzYxNjQ2MTM2ODI3MzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1a6038cc9b0fe07f1177fce34e1bca04d024d27a3a18367f743a233256ffa24f |
| hovercard-subject-tag | pull_request:4034093523 |
| 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/8501/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 #5898. Problem Converting slabs to IfcArbitraryProfileDefWithVoids renders incorrect geometry: 12 of the 69 slabs in the reported sample collapse from ~2500 volume to ~0. Root cause Not the C... |
| 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