Title: Bonsai: wall under a ridge is left unclipped by Extend/Regenerate Wall to Underside, but only in a session opened from the .blend · Issue #9516 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: wall under a ridge is left unclipped by Extend/Regenerate Wall to Underside, but only in a session opened from the .blend · Issue #9516 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: wall under a ridge is left unclipped by Extend/Regenerate Wall to Underside, but only in a session opened from the .blend · Issue #9516 · IfcOpenShell/IfcOpenShell
Description: Description A wall that bim.extend_walls_to_underside connects to two roof slopes (two IfcRoofs meeting at a ridge) is extended to the ridge height but never clipped. Both IfcPolygonalFaceSet clip solids are in the body's boolean chain, ...
Open Graph Description: Description A wall that bim.extend_walls_to_underside connects to two roof slopes (two IfcRoofs meeting at a ridge) is extended to the ridge height but never clipped. Both IfcPolygonalFaceSet clip ...
X Description: Description A wall that bim.extend_walls_to_underside connects to two roof slopes (two IfcRoofs meeting at a ridge) is extended to the ridge height but never clipped. Both IfcPolygonalFaceSet clip ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9516
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: wall under a ridge is left unclipped by Extend/Regenerate Wall to Underside, but only in a session opened from the .blend","articleBody":"## Description\n\nA wall that `bim.extend_walls_to_underside` connects to two roof slopes (two `IfcRoof`s meeting at a ridge) is extended to the ridge height but never clipped. Both `IfcPolygonalFaceSet` clip solids are in the body's boolean chain, yet the rendered wall is a plain rectangle up to the ridge.\n\nIt depends on the session. After opening the `.blend`, `bim.regenerate_wall_to_underside` leaves the wall unclipped. After opening the `.ifc` fresh, the same operator clips it correctly.\n\nAttached: `Crested_Owl_Ln.blend` + `Crested_Owl_Ln.ifc`.\nhttps://www.dropbox.com/scl/fi/r2z04yfcdzgg9xwjrthp9/Crested_Owl_Ln.zip?rlkey=3z38umfu7djadv2er577x2atk&dl=0\n\n- Wall: `15B7OSiyPDauG7bVPGfPuz`\n- Roofs: `1oK_SoMjnC_ORaVPVCynDV`, `06BSOqWXz7nvgcMtruGXPq`\n\n## Steps to reproduce\n\n1. Open `Crested_Owl_Ln.blend`.\n2. Select wall `15B7OSiyPDauG7bVPGfPuz` and run `bpy.ops.bim.regenerate_wall_to_underside()`.\n3. The wall is still a full rectangle up to the ridge; the gable isn't cut.\n4. Start a new session, open `Crested_Owl_Ln.ifc` directly (not the .blend), and repeat step 2.\n5. The wall is clipped to the gable.\n\nThe saved IFC fails outside Blender too: `ifcopenshell.geom.create_shape` on the wall gives the unclipped box (24 verts).\n\n## Cause\n\n`Model.clip_wall_to_slab` adds one `DIFFERENCE` per slope face, each with its own face set. The kernel passes all operands of the chain to a single OCCT `BRepAlgoAPI_Cut` as separate tools. Since #7944, each tool extends 1 unit past its face, so the two tools overlap across the ridge on purpose (to avoid the kissing-solid artifact from #7942). The wall's `Depth` is set to the ridge height, so the wall top lies exactly on the line where the overlapping tools meet.\n\nThat configuration sits on a numerical knife edge. Tested against the attached file:\n- Each face set alone cuts correctly.\n- Winding and `Closed` make no difference.\n- Moving the wall top a little away from the ridge makes it work.\n- With both tools at the ridge height, the result depends on noise of about 2e-6 ft. The tools built in the .blend session and in the fresh session differ only in tool 2's x-extent (`6.5951886` vs `6.5951867`). The first silently returns the uncut wall; the second cuts. The noise comes from the roof mesh coordinates, which differ between a session restored from the .blend and a fresh IFC load.\n- OCCT logs no error; the cut just comes back without the tool removed.\n\n## Proposed fix\n\nGive the kernel one tool per wall instead of several:\n- Collect the clip faces of all connected slabs in one call: `clip_wall_to_slabs(wall, clipping_bms)`.\n- Give each rectangle solid a flat top well above the wall top (`max_z + 3 * margin`) and recalculate its normals.\n- Fuse the solids into one `IfcBooleanResult(UNION)` and subtract that with a single `DIFFERENCE`.\n- Make `strip_underside_booleans` / `remove_wall_to_underside_booleans` recognise the UNION tree as well as a bare face set, so walls saved with the old structure convert cleanly on the next regenerate.\n\nVerified headless (Blender 5.2, Bonsai 0.8.6) on the attached files:\n\n| Session | Current code | Proposed fix |\n|---|---|---|\n| opened from .blend | not clipped | clipped |\n| fresh IFC load | clipped | clipped |\n\nAlso checked:\n- Repeated regenerates leave no orphaned entities.\n- The Shift+D strip still returns the wall to a plain extrusion and removes `BBIM_Boolean`.\n\nRelated: #7942, #7944.\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-09-16T23:45:53Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9516"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:337ec319-9951-abc3-065e-6878a37d681e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D8B2:25E63A:9D5383:D6E0F4:6B048345 |
| html-safe-nonce | 34b04174b3f06167a14f68579ae627b7539baeda7b4ed4f9d99d6b79a66d9e0c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOEIyOjI1RTYzQTo5RDUzODM6RDZFMEY0OjZCMDQ4MzQ1IiwidmlzaXRvcl9pZCI6IjgxNzU3MTEzNzUxNDcwOTE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1e1259cd1b2a6843c9430da945ed728ff6f353050d2e7be2a7d915a3791f9340 |
| hovercard-subject-tag | issue:5481094985 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/9516/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f930c97dbc6537ca04c6ce30cb161709326b0aec2ea2e54fe1c8b21ce2d4e4b8/IfcOpenShell/IfcOpenShell/issues/9516 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f930c97dbc6537ca04c6ce30cb161709326b0aec2ea2e54fe1c8b21ce2d4e4b8/IfcOpenShell/IfcOpenShell/issues/9516 |
| og:image:alt | Description A wall that bim.extend_walls_to_underside connects to two roof slopes (two IfcRoofs meeting at a ridge) is extended to the ridge height but never clipped. Both IfcPolygonalFaceSet clip ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theoryshaw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70 |
| turbo-cache-control | no-preview |
| 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 | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width