Title: Bonsai: window preview is offset by the host wall's translation · Issue #9346 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: window preview is offset by the host wall's translation · Issue #9346 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: window preview is offset by the host wall's translation · Issue #9346 · IfcOpenShell/IfcOpenShell
Description: Bug Description The blue IfcWindow occurrence preview is displaced from a translated host wall even though the insertion point is snapped to that wall. Expected: the preview is drawn on the wall at the snapped insertion point. Actual: wh...
Open Graph Description: Bug Description The blue IfcWindow occurrence preview is displaced from a translated host wall even though the insertion point is snapped to that wall. Expected: the preview is drawn on the wall at...
X Description: Bug Description The blue IfcWindow occurrence preview is displaced from a translated host wall even though the insertion point is snapped to that wall. Expected: the preview is drawn on the wall at...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9346
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: window preview is offset by the host wall's translation","articleBody":"## Bug Description\n\nThe blue `IfcWindow` occurrence preview is displaced from a translated host wall even though the insertion point is snapped to that wall.\n\nExpected: the preview is drawn on the wall at the snapped insertion point.\n\nActual: when the host wall's object origin is away from the world origin, the preview is displaced by approximately the wall's world translation. In the observed case, the wall origin and snap X coordinate are `10 m`, and the preview is drawn roughly another `10 m` away. Walls whose origins are close to the world origin appear correct.\n\nSteps to reproduce:\n\n1. Create an IFC project and a wall whose object origin is away from the world origin, for example at X = `10 m`.\n2. Create or select an `IfcWindowType`.\n3. Activate the Window Tool.\n4. Hover over the translated wall so the insertion point snaps to it.\n5. Observe that the blue window preview is drawn away from the host wall.\n\nThe likely cause is in [`ProductDecorator.get_generic_preview_data()`](https://github.com/IfcOpenShell/IfcOpenShell/blob/2b429dc605303154af3680a78241c0d617271fca/src/bonsai/bonsai/bim/module/model/decorator.py#L1532-L1600). The base-axis branch assigns the full wall world matrix:\n\n```python\nrot_mat = snap_obj.matrix_world\n```\n\nThe preview then applies both the snapped mouse translation and that matrix:\n\n```python\ncombined_m = translate_mouse @ rot_mat @ translate_rl @ self.obj_matrix_i\n```\n\nBecause `snap_obj.matrix_world` includes the wall translation, the translation is applied twice. The side-axis branch already builds a rotation-only matrix with `to_quaternion().to_matrix().to_4x4()`. Using a rotation-only wall matrix in the base-axis branch should keep the preview at the snapped point.\n\nRelated to #5551, where the occurrence preview was originally implemented.\n\n## Attachments\n\nNot attached because the original screenshot includes a private floor plan. This should be reproducible with a fresh wall placed away from the world origin.\n\n## Debug and Error Output\n\n```yes\nos: Darwin\nos_version: macOS Tahoe 26.5.2 (Darwin 25.5.0)\npython_version: 3.13.13\narchitecture: arm64\nmachine: arm64\nblender_version: 5.2.0 LTS\nbonsai_version: 0.8.6-alpha260819\nbonsai_commit_hash: 2b429dc\nbonsai_commit_date: 2026-08-19T20:07:52-03:00\nbonsai_git_branch: v0.8.0\nlast_error: None\n```\n","author":{"url":"https://github.com/PaulRBerg","@type":"Person","name":"PaulRBerg"},"datePublished":"2026-08-22T14:08:06Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9346"}
| 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:c672963e-c849-8e3d-b525-9e1f8307303d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A972:32405D:2B8D05:3D0D59:6B04757E |
| html-safe-nonce | 6266817d904941e62ba2f3fee9811852930769210b236f15b9a56c9355bd3205 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTcyOjMyNDA1RDoyQjhEMDU6M0QwRDU5OjZCMDQ3NTdFIiwidmlzaXRvcl9pZCI6IjgzNTEwNzg2NTA1Nzc0NTAzNjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e9f14819af8b20d15a71afb5a1563bfad6fb237844799c073cf5f70bddfd082c |
| hovercard-subject-tag | issue:5222280241 |
| 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/9346/issue_layout |
| twitter:image | https://opengraph.githubassets.com/16c6b01234d3c769f964a426ec9370c2c5983b2e1a352af6a9e0d302b743dd94/IfcOpenShell/IfcOpenShell/issues/9346 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/16c6b01234d3c769f964a426ec9370c2c5983b2e1a352af6a9e0d302b743dd94/IfcOpenShell/IfcOpenShell/issues/9346 |
| og:image:alt | Bug Description The blue IfcWindow occurrence preview is displaced from a translated host wall even though the insertion point is snapped to that wall. Expected: the preview is drawn on the wall at... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PaulRBerg |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| 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 | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| ui-target | full |
| 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