Title: geom: tree.select and select_box accept int coords by petruconduraru · Pull Request #9183 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: geom: tree.select and select_box accept int coords by petruconduraru · Pull Request #9183 · IfcOpenShell/IfcOpenShell
X Title: geom: tree.select and select_box accept int coords by petruconduraru · Pull Request #9183 · IfcOpenShell/IfcOpenShell
Description: tree.select((0, 0, 0)) fails. The point-coordinate dispatch required every element to be exactly a float: elif isinstance(value, (list, tuple)) and len(value) == 3 and set(map(type, value)) == {float}: So a tuple containing an integer fell through every branch and was forwarded unchanged to the C++ overload set, which has no int-tuple overload for gp_Pnt: TypeError: Wrong number or type of arguments for overloaded function 'tree_select' select_box() had the same defect for the (min, max) corner-pair form, where integers fail to resolve the Bnd_Box typemap. Writing (0, 0, 0) rather than (0.0, 0.0, 0.0) is entirely natural, and the resulting error names a C++ symbol and gives no hint that the fix is to add decimal points. Both entry points now coerce integer coordinates to float. bool is excluded from the point form, since bool is a subclass of int and a boolean triple is far more likely a mistake than a coordinate. Verification Reproduced live against src/bonsai/test/files/snap.ifc. Two regression tests added to test/test_create_shape.py, verified red before the fix and green after. The suite passes 9, with one pre-existing unrelated failure (TestGeomSettings::test_settings, a stale local C++ wrapper against current SETTING literals). Reported, not fixed tree.select_box(box, extend=...) fails for any box argument, including all-floats, because the C++ binding has no three-argument Bnd_Box overload, unlike the entity and point overloads which do. That needs a change to the binding rather than to this wrapper, so it is out of scope here. Audit context Found while auditing ifcopenshell/geom/ and ifcopenshell/express/. All bimvoice branches were diffed against these directories to separate real conflicts (open PRs #8519, #8528, #8588, plus #9179 which was already excluded) from stale branches whose apparent diffs were pure reformatting noise. Around 28 further candidates were examined and declined as unreachable from user data, being guarded either by the fixed EXPRESS grammar or by static checked-in CSV rather than by anything an IFC file can influence. Generated with the assistance of an AI coding tool.
Open Graph Description: tree.select((0, 0, 0)) fails. The point-coordinate dispatch required every element to be exactly a float: elif isinstance(value, (list, tuple)) and len(value) == 3 and set(map(type, value)) == {flo...
X Description: tree.select((0, 0, 0)) fails. The point-coordinate dispatch required every element to be exactly a float: elif isinstance(value, (list, tuple)) and len(value) == 3 and set(map(type, value)) == {flo...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/9183
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
| 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:1b51c58f-534d-8584-eee7-fcc05f070b14 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EDCA:26AE17:18661AC:1FF7588:6B055059 |
| html-safe-nonce | 9a633e302b995633d64400a49ebd6c96155af6efd67b39ba16dd8d5b1d9667f8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRENBOjI2QUUxNzoxODY2MUFDOjFGRjc1ODg6NkIwNTUwNTkiLCJ2aXNpdG9yX2lkIjoiMTkwMjE1NDUxNjU1MjU2ODkyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 71102acc346f58d59f67e5c72467dfa7884dbaf710ed3becc7859b7a24d20e3f |
| hovercard-subject-tag | pull_request:4175407913 |
| 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/9183/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 | tree.select((0, 0, 0)) fails. The point-coordinate dispatch required every element to be exactly a float: elif isinstance(value, (list, tuple)) and len(value) == 3 and set(map(type, value)) == {flo... |
| 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