Title: Bonsai: auto storey level marks lose their side when the storey height changes, and keep their width when the drawing is resized · Issue #10114 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: auto storey level marks lose their side when the storey height changes, and keep their width when the drawing is resized · Issue #10114 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: auto storey level marks lose their side when the storey height changes, and keep their width when the drawing is resized · Issue #10114 · IfcOpenShell/IfcOpenShell
Description: Bug Description On activation, sync_references updates the automatic storey level marks of a section through Drawing.regenerate_storey_annotation (src/bonsai/bonsai/tool/drawing.py, lines 1757–1802). If the camera matrix is unchanged it ...
Open Graph Description: Bug Description On activation, sync_references updates the automatic storey level marks of a section through Drawing.regenerate_storey_annotation (src/bonsai/bonsai/tool/drawing.py, lines 1757–1802...
X Description: Bug Description On activation, sync_references updates the automatic storey level marks of a section through Drawing.regenerate_storey_annotation (src/bonsai/bonsai/tool/drawing.py, lines 1757–1802...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/10114
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: auto storey level marks lose their side when the storey height changes, and keep their width when the drawing is resized","articleBody":"### Bug Description\n\nOn activation, `sync_references` updates the automatic storey level marks of a section through `Drawing.regenerate_storey_annotation` (`src/bonsai/bonsai/tool/drawing.py`, lines 1757–1802). If the camera matrix is unchanged it only looks at the height:\n\n```python\nexisting_verts = sorted(existing_verts, key=lambda v: v.x)\nxmin, xmax = [v.x for v in existing_verts]\ny = points[0].y\nif not tool.Cad.is_x(y, existing_verts[0].y) or not tool.Cad.is_x(y, existing_verts[1].y):\n new_points = (Vector((xmax, y, 0.0)), Vector((xmin, y, 0.0)))\n```\n\nThis has two effects:\n\n1. **A mark placed on the other side loses its side when the storey height changes.** The existing points are sorted by x and always written back as `(xmax, xmin)`. As long as the height is unchanged, a mark the user put on the other side (points reversed) stays there; after the storey is moved it jumps back.\n2. **The width never follows the drawing.** With an unchanged height nothing is rewritten, and with a changed height the old `xmin`/`xmax` are kept. So when the drawing is made narrower or wider, the marks keep their old length.\n\n### Reproduction (Bonsai 0.9.1, new project with four storeys)\n\nSection looking north, camera coordinates in metres:\n\n| Step | OG level mark |\n|---|---|\n| Activate drawing (3 × 12 m) | `(6.0, 1.75)`, `(−6.0, 1.75)` |\n| Reverse its two points, activate again | `(−6.0, 1.75)`, `(6.0, 1.75)`, kept |\n| Raise the OG storey by 0.25 m, activate again | `(6.0, 2.0)`, `(−6.0, 2.0)`, **side lost** |\n| Resize drawing to 20 × 12 m (frame x ±10), activate | all marks stay at x ±6 |\n| Resize drawing to 16 × 12 m (frame x ±8), activate | all marks stay at x ±6 |\n\n(The ±6 instead of ±1.5 for the 3 m wide drawing is a separate problem in `ortho_view_frame`, see #10110.)\n\n### Expected\n\n- When only the height changes, keep the direction of the existing mark (which end carries the symbol).\n- Possibly: when the drawing's width changes, fit the mark to the new frame. I am not sure this is wanted, since a user may have shortened a mark on purpose, so I'd like to hear what you prefer.\n\n### Possible fix for the first point (not tested)\n\nKeep the stored order instead of sorting:\n\n```python\nfirst, second = existing_verts # in stored order\ny = points[0].y\nif not tool.Cad.is_x(y, first.y) or not tool.Cad.is_x(y, second.y):\n new_points = (Vector((first.x, y, 0.0)), Vector((second.x, y, 0.0)))\n```\n\nHappy to test a fix on our sections.\n\n*Prepared with the help of an AI assistant and checked by me.*\n\n### Attachments\n\n_No response_\n\n### Debug and Error Output\n\n```true\nBonsai 0.9.1-alpha261027 (IfcOpenShell 0.9.1a261027), Blender 5.2.0 LTS, Windows\nCode checked on v0.9.0 at 28bae19 (2026-10-30)\n```","author":{"url":"https://github.com/SautaRoc","@type":"Person","name":"SautaRoc"},"datePublished":"2026-11-02T06:34:59Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/10114"}
| 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:4c855951-84d9-e816-1d04-3cf46001310a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8270:367411:16ADB5:1F518B:6B0465A8 |
| html-safe-nonce | 96b8765eb7b3c082d31c3f92af155ec92f3e4dfdcc8eeed696d2398a557ce46a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjcwOjM2NzQxMToxNkFEQjU6MUY1MThCOjZCMDQ2NUE4IiwidmlzaXRvcl9pZCI6IjcxOTEwMzUyNDMwNjQ0NTczNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b55bbd8bbd56e60c0fcd21c2e68ccf62e7f472faca385fde33d7c0050eddeb3e |
| hovercard-subject-tag | issue:6157544981 |
| 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/10114/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5970d658620911240ed150afa97e0a1362c3b5476027473e5e6e0ba4f06e31cf/IfcOpenShell/IfcOpenShell/issues/10114 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5970d658620911240ed150afa97e0a1362c3b5476027473e5e6e0ba4f06e31cf/IfcOpenShell/IfcOpenShell/issues/10114 |
| og:image:alt | Bug Description On activation, sync_references updates the automatic storey level marks of a section through Drawing.regenerate_storey_annotation (src/bonsai/bonsai/tool/drawing.py, lines 1757–1802... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SautaRoc |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| 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 | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| 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