Title: Drawing: OffsetFromReferenceLine is applied to the wrong axis for AXIS1 layer sets · Issue #9001 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Drawing: OffsetFromReferenceLine is applied to the wrong axis for AXIS1 layer sets · Issue #9001 · IfcOpenShell/IfcOpenShell
X Title: Drawing: OffsetFromReferenceLine is applied to the wrong axis for AXIS1 layer sets · Issue #9001 · IfcOpenShell/IfcOpenShell
Description: Bug Description Summary In generate_material_layers, the per-layer bisect applies IfcMaterialLayerSetUsage.OffsetFromReferenceLine to the Z component when LayerSetDirection == "AXIS1", while walking the layers along X. The offset therefo...
Open Graph Description: Bug Description Summary In generate_material_layers, the per-layer bisect applies IfcMaterialLayerSetUsage.OffsetFromReferenceLine to the Z component when LayerSetDirection == "AXIS1", while walkin...
X Description: Bug Description Summary In generate_material_layers, the per-layer bisect applies IfcMaterialLayerSetUsage.OffsetFromReferenceLine to the Z component when LayerSetDirection == "AXIS1", wh...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/9001
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Drawing: OffsetFromReferenceLine is applied to the wrong axis for AXIS1 layer sets","articleBody":"### Bug Description\n\n### Summary\n\nIn `generate_material_layers`, the per-layer bisect applies\n`IfcMaterialLayerSetUsage.OffsetFromReferenceLine` to the **Z** component when\n`LayerSetDirection == \"AXIS1\"`, while walking the layers along **X**. The offset\ntherefore never reaches the axis it is meant to shift, and every layer boundary\non an AXIS1 element is drawn as though the offset were `0.0`.\n\n`AXIS2` and `AXIS3` are consistent; only `AXIS1` mismatches.\n\n### Location\n\n`src/bonsai/bonsai/bim/module/drawing/operator.py` (in the installed 5.2 addon,\n`bonsai/bim/module/drawing/operator.py:815-826`):\n\n```python\nelif usage.LayerSetDirection == \"AXIS2\":\n co = Vector((0.0, offset, 0.0)) # offset on Y\n no = tool.Drawing.get_extrusion_vector(element).normalized()\n no = no.cross(Vector([1.0, 0.0, 0.0])) # walk along +/-Y -> consistent\nelif usage.LayerSetDirection == \"AXIS3\":\n co = Vector((0.0, 0.0, offset)) # offset on Z\n no = tool.Drawing.get_extrusion_vector(element).normalized()\n no = Vector([0.0, 0.0, 1.0]) # walk along Z -> consistent\nelif usage.LayerSetDirection == \"AXIS1\":\n co = Vector((0.0, 0.0, offset)) # offset on Z \u003c-- should be X\n no = tool.Drawing.get_extrusion_vector(element).normalized()\n no = Vector([1.0, 0.0, 0.0]) # walk along X\n```\n\n`offset` and `sense_factor` are read correctly a few lines above\n(`operator.py:777-778`), so the value reaching this branch is right; only its\nplacement is wrong.\n\n### Suggested fix\n\n```python\nelif usage.LayerSetDirection == \"AXIS1\":\n co = Vector((offset, 0.0, 0.0))\n no = tool.Drawing.get_extrusion_vector(element).normalized()\n no = Vector([1.0, 0.0, 0.0])\n```\n\nThe `no = get_extrusion_vector(...)` line immediately before the literal\nreassignment is dead in both the AXIS1 and AXIS3 branches — possibly worth\nremoving at the same time, though it is harmless.\n\n### Reproduction\n\nThe attached file has four layered walls in a mitered ring, all with an\nidentical `108 / 43 / 190 mm` buildup (brick / ventilated cavity / mineral\nwool), all carrying a correct `OffsetFromReferenceLine`:\n\n| wall | LayerSetDirection | DirectionSense | OffsetFromReferenceLine |\n| --- | --- | --- | --- |\n| facade_south | AXIS2 | POSITIVE | −0.1705 |\n| facade_north | AXIS2 | NEGATIVE | +0.1705 |\n| facade_west | AXIS1 | POSITIVE | −0.1705 |\n| facade_east | AXIS1 | NEGATIVE | +0.1705 |\n\nEach wall's `ObjectPlacement` is an identity rotation at the body's AABB\ncentre, so `±0.1705` (half the 341 mm total) puts the datum exactly on the\nfirst layer's outer face. Walking the chain reproduces the emitted solid faces\nexactly, to 0 — the file is self-consistent.\n\n1. Open the file in Bonsai.\n2. Create a plan drawing for the single storey and activate it.\n3. Compare the two AXIS2 walls with the two AXIS1 walls.\n\n**Expected:** on all four walls the layer boundaries coincide with the material\nboundaries — brick 108 mm, then a 43 mm gap, then wool 190 mm.\n\n**Actual:** the AXIS2 pair is correct. On the AXIS1 pair the boundaries are\ndisplaced by the offset, landing inside the insulation. On this geometry the\ncut planes fall at local `x = 0`, `−0.108` and `−0.151` instead of `+0.1705`,\n`+0.0625` and `+0.0195`, producing a spurious band whose width is the middle\nlayer's thickness (43 mm here — change the cavity to 30 mm and the band becomes\n30 mm).\n\n### Notes\n\n* AXIS1 on a wall is unusual but legal. It arises when a wall's local X does not\n run along the wall — here the exporter emits identity-rotation placements, so\n a north–south wall stacks its layers along world/local X. IFC's own intent for\n `IfcWallStandardCase` is local X along the wall (hence AXIS2), which is\n probably why this path is under-exercised.\n* Several other Bonsai paths gate explicitly on `AXIS2` for walls\n (`tool/wall.py:173`, `bim/module/model/wall.py:1441,1461,1694`), so AXIS1\n walls may be a partially-supported shape more broadly. Flagging in case the\n maintainers would rather reject AXIS1 walls loudly than half-support them.\n* Version tested: Bonsai bundled with Blender 5.2 (as shipped in the\n `ifc-floorplan-renderer` image). **Verified still present on upstream\n `v0.8.0`**, same file, same lines 815-826 — fetched and diffed 2026-07-26,\n byte-identical to the bundled copy.\n\n---\n\n## Prior-art search (2026-07-26) — nothing found, safe to file\n\nSearched `IfcOpenShell/IfcOpenShell`, issues and PRs, all states:\n\n| query | matches on this defect |\n| --- | --- |\n| `AXIS1` | none — hits are wall join/butt tools and a rebar example |\n| `OffsetFromReferenceLine` | none — hits are slab thickness/custom-offset UI |\n| `LayerSetDirection` | none — hits are type thumbnails, wall merge, horizontal layers |\n| `generate_material_layers` | no results |\n| symptom phrasings (layer hatch misaligned / wrong in plan / offset in drawing) | no results |\n\nOpen PRs mentioning `drawing` (20 reviewed): all sheets, cameras, underlays,\nfonts, linework, crash guards. **None touches the per-layer bisect.**\n\nClosest neighbours, both different bugs — worth a \"possibly related\" line if\nthe maintainers want one:\n\n* **#7794** (closed) *Layer orientation in a wall changes if occurrence\n overridden* — layer orientation, but the model side, not the drawing bisect.\n* **#5326** (open) *Choose wall reference line (exterior, interior, center) for\n polyline tool* — about authoring the reference line, i.e. the same attribute\n this bug mis-reads, but a feature request.\n* **#7098** (open) *AXIS 3 layers not updating in the .blend/.ifc sync* — AXIS3,\n sync path, not the drawing.\n\n### Attachments\n\n[bonsai-axis1-repro.ifc.txt](https://github.com/user-attachments/files/30390429/bonsai-axis1-repro.ifc.txt)\n\n### Debug and Error Output\n\n```true\n\n```","author":{"url":"https://github.com/arbirk","@type":"Person","name":"arbirk"},"datePublished":"2026-07-26T16:31:15Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/9001"}
| 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:7a555358-4830-68b1-c7bc-da67d79b7793 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9548:16ED35:51752A:6C7BC7:6B04C01E |
| html-safe-nonce | 94edc0a889d055fff695deaefdfb9d91eda9e89a4e593ecf11f0b788af2b4159 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTQ4OjE2RUQzNTo1MTc1MkE6NkM3QkM3OjZCMDRDMDFFIiwidmlzaXRvcl9pZCI6IjI1MjQyNjA1ODM1NTAwMDkzNzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cf50c4e628aa8828ebdc9f7d92d238c899cc512acb4e4741fc149f65f3cb2666 |
| hovercard-subject-tag | issue:4981486914 |
| 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/9001/issue_layout |
| twitter:image | https://opengraph.githubassets.com/51bed423a9004ae951584805d36a3ecf807345b62eb6a605dbe0ae603cf40f69/IfcOpenShell/IfcOpenShell/issues/9001 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/51bed423a9004ae951584805d36a3ecf807345b62eb6a605dbe0ae603cf40f69/IfcOpenShell/IfcOpenShell/issues/9001 |
| og:image:alt | Bug Description Summary In generate_material_layers, the per-layer bisect applies IfcMaterialLayerSetUsage.OffsetFromReferenceLine to the Z component when LayerSetDirection == "AXIS1", while walkin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | arbirk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 85dd75377eb77313206b8fc108bcee6a3a029286d94bf32bf9b4426e4d92e0c4 |
| 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 | 0d64fa748a2bab9a5b587a967ac4da1cfa8da6dd |
| 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