Title: serializers: section-height-from-storeys should use global placement Z (#2638) by petruconduraru · Pull Request #8475 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: serializers: section-height-from-storeys should use global placement Z (#2638) by petruconduraru · Pull Request #8475 · IfcOpenShell/IfcOpenShell
X Title: serializers: section-height-from-storeys should use global placement Z (#2638) by petruconduraru · Pull Request #8475 · IfcOpenShell/IfcOpenShell
Description: Fixes #2638. Problem With --section-height-from-storeys, whole floors go missing from the SVG floorplan (every element emits "Element not written to SVG due to section heights"). setSectionHeightsFromStoreys builds the per-storey cut planes from the IfcBuildingStorey.Elevation attribute (elev * lengthunit). That attribute is relative to the storey's own local placement origin and ignores any Z contributed by ancestor placements (a site or building elevation, typical of Revit exports). The element geometry, however, is fully globally placed, so when an ancestor adds a Z offset the cut planes land far from the geometry, the straddle test zmin > cut_z || zmax < cut_z skips every subshape, and the whole storey is culled. Fix Take each storey elevation from its globally resolved placement matrix translation Z, produced by the same mapping that positions the geometry, applied to both the pushed elevation and the previous storey's range bound. This mirrors the pattern already used elsewhere in this file (setSectionHeight around line 2349). Models with no ancestor Z offset are unchanged, and the Elevation attribute is kept as a fallback. Relationship to #1231 This is the same class of bug as #1231 (PR #8471), but a distinct code path: #8471 fixed storey_elevation_from_element (the per-element fallback used with no section flag), and did not touch setSectionHeightsFromStoreys, which is the path the --section-height-from-storeys flag drives. So this is a separate, non-overlapping fix. Verification Reasoned at file level and confirmed the code path and that it reuses the existing construct + translation_part()(2) pattern in this file. Not runtime-tested (no local kernel build, no sample attached); CI's build-ifcopenshell compile-checks it. Generated with the assistance of an AI coding tool. Rebased onto v0.9.0 as one commit: settings_ and logger() replace geometry_settings_ and logger_, express::entity replaces the IfcUtil::IfcBaseEntity casts, and the ifcopenshell::geom::impl and taxonomy namespaces replace geometry::. Test added (2026-10-02): test/geom/test_svg_storey_section_height.py draws a plan with section-height-from-storeys where the building is placed 10 m up, the storey Elevation is 0 and the wall spans 10 to 13 m globally, and requires the wall in the SVG; a ground-level building is the control. On the 0.9.1 wheel, without this change, the raised case produces an SVG with no storey group or wall and the control passes. Green with the change (cut at 11.2 m) is not verified locally; CI builds it.
Open Graph Description: Fixes #2638. Problem With --section-height-from-storeys, whole floors go missing from the SVG floorplan (every element emits "Element not written to SVG due to section heights"). setSecti...
X Description: Fixes #2638. Problem With --section-height-from-storeys, whole floors go missing from the SVG floorplan (every element emits "Element not written to SVG due to section heights"). ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/8475
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
| 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 | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:bb45c09f-6869-5337-3336-004506e44448 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8BEE:1204FD:15CD8DB:1C54627:6B0508DE |
| html-safe-nonce | 46257f030797c6a99f20de44a19f9845dff92e15c2383e43c59006a305ac4829 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QkVFOjEyMDRGRDoxNUNEOERCOjFDNTQ2Mjc6NkIwNTA4REUiLCJ2aXNpdG9yX2lkIjoiODMyNjQ3NDMwNzY1MjA5NDE3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e20c48010512cd6e4634108519ec4993f317f1a5cad1e1f87f3f98e3700ea7a6 |
| hovercard-subject-tag | pull_request:4029827125 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/IfcOpenShell/IfcOpenShell/pull/8475/files |
| twitter:image | https://avatars.githubusercontent.com/u/139251053?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/139251053?s=400&v=4 |
| og:image:alt | Fixes #2638. Problem With --section-height-from-storeys, whole floors go missing from the SVG floorplan (every element emits "Element not written to SVG due to section heights"). setSecti... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 220e980097d94ce616d5d11fbd5316d208e3fc93 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width