Title: Bonsai: roof path editing fails on off-level footprint vertices, loses its preview, and isn't reachable via direct_profile_edit · Issue #9514 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Bonsai: roof path editing fails on off-level footprint vertices, loses its preview, and isn't reachable via direct_profile_edit · Issue #9514 · IfcOpenShell/IfcOpenShell
X Title: Bonsai: roof path editing fails on off-level footprint vertices, loses its preview, and isn't reachable via direct_profile_edit · Issue #9514 · IfcOpenShell/IfcOpenShell
Description: Bug Description Editing a parametric roof's footprint path has three rough edges: Finishing fails if any vertex is off-level. If a footprint vertex ends up even slightly off the others' Z (for example after snapping), Finish Editing Roof...
Open Graph Description: Bug Description Editing a parametric roof's footprint path has three rough edges: Finishing fails if any vertex is off-level. If a footprint vertex ends up even slightly off the others' Z (for exam...
X Description: Bug Description Editing a parametric roof's footprint path has three rough edges: Finishing fails if any vertex is off-level. If a footprint vertex ends up even slightly off the others' Z (...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9514
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: roof path editing fails on off-level footprint vertices, loses its preview, and isn't reachable via direct_profile_edit","articleBody":"### Bug Description\n\nEditing a parametric roof's footprint path has three rough edges:\n\n1. **Finishing fails if any vertex is off-level.** If a footprint vertex ends up even slightly off the others' Z (for example after snapping), **Finish Editing Roof Path** refuses with:\n\n ```\n RuntimeError: Error:\n All roof footprint vertices should have same Z-level.\n Currently Z-level doesn't completely match\n ```\n\n You then have to find the stray vertex by hand. Profile editing never has this problem, because profiles are exported as 2D curves and any Z is simply dropped.\n\n2. **The ghosted roof preview disappears** while a vertex is off-level. The preview callback (`get_custom_bmesh` in `EnableEditingRoofPath`) runs the same check and returns only the footprint when it fails, so the preview vanishes as soon as you drag a vertex vertically.\n\n3. **`bim.direct_profile_edit` (Space) doesn't enter roof path editing.** On a roof it falls through to representation-item editing (`import_representation_items`). On exit it reaches `finish_editing_roof_path` only through the generic `override_mode_set_object` fallback.\n\n### Proposed fix\n\n- Replace `is_valid_roof_footprint` with `flatten_roof_footprint(bm)`, which snaps every footprint vertex to the first vertex's Z. That is the level `generate_hipped_roof_bmesh` already treats as the footprint.\n- **Finish Editing Roof Path** flattens, writes the result back to the mesh (object or edit mode), and shows a warning instead of cancelling. **Generate Hipped Roof** flattens the same way.\n- The path-editing preview builds the roof from a flattened *copy*, so it stays visible. The vertex you're dragging still shows at its real height, and the preview matches what Finish will produce.\n- `DirectProfileEdit` calls `enable_editing_roof_path` when entering on a roof. If the roof's parameters are being edited, it reports that and does nothing. On exit, if the roof's path is being edited, it calls `finish_editing_roof_path` directly.\n\n### Testing\n\nHeadless (Blender 5.2), with one footprint vertex raised 0.3:\n- The flattened copy builds a roof (11 faces) and leaves the edited mesh untouched.\n- That roof is identical to one built from a level footprint, including a gable edge.\n- Finishing writes level Z values back to the mesh in both object and edit mode.\n- A level footprint reports nothing moved, and an empty mesh doesn't crash.\n\nIn Blender, confirmed by hand: Space enters and exits roof path editing, the preview stays visible while a vertex is dragged off-level, and finishing flattens the footprint and shows the warning.\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-09-16T22:32:32Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9514"}
| 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:50402cce-9b30-b45c-b8ad-aa14644fab44 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B5BE:32A711:4A8377:669853:6B049EF6 |
| html-safe-nonce | 1ae05cce9e3a230abe80e46b97cff8aa148cccfcde23a76bff12a5ecb949a0a5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNUJFOjMyQTcxMTo0QTgzNzc6NjY5ODUzOjZCMDQ5RUY2IiwidmlzaXRvcl9pZCI6Ijg5ODkzNTQ0OTIwNTUyOTc3ODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4c4ec330fe5cb0c3fc55e815c602373e4195c5b3e5d7dfefadf843bc5460f0ee |
| hovercard-subject-tag | issue:5480620343 |
| 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/9514/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7413e11525b4e09a8265cb4584287a5d733a72e64cc2d44c88a35bf700d54aa5/IfcOpenShell/IfcOpenShell/issues/9514 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7413e11525b4e09a8265cb4584287a5d733a72e64cc2d44c88a35bf700d54aa5/IfcOpenShell/IfcOpenShell/issues/9514 |
| og:image:alt | Bug Description Editing a parametric roof's footprint path has three rough edges: Finishing fails if any vertex is off-level. If a footprint vertex ends up even slightly off the others' Z (for exam... |
| 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 | 9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d |
| 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 | 3fd14143b75b2af7b76bbd23b069867d091adfcc |
| 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