Title: svg: guard HLR stages so one failing element or projection does not abort the drawing (#3971) by petruconduraru · Pull Request #8376 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: svg: guard HLR stages so one failing element or projection does not abort the drawing (#3971) by petruconduraru · Pull Request #8376 · IfcOpenShell/IfcOpenShell
X Title: svg: guard HLR stages so one failing element or projection does not abort the drawing (#3971) by petruconduraru · Pull Request #8376 · IfcOpenShell/IfcOpenShell
Description: Summary The SVG serializer ran the OpenCASCADE hidden-line-removal routines in prefiltered_hlr with no exception handling, so a single failing element or a failing projection aborted the whole drawing. finalize() propagated a bare Standard_Failure that the Python wrapper reported as the opaque RuntimeError: An unknown error occurred. On the issue's Monica_Residence model, 17 drawings failed this way. Root cause Characterized on that model: OCCT throws Standard_OutOfRange (NCollection_Array1::ChangeValue) in the poly HLR projection pass (HLRBRep_PolyAlgo / PolyHLRToShape), reached from finalize() via build(), even though the input mesh is topologically clean. It is an internal out-of-range in the projector, not a repairable mesh defect. The projection runs over the whole accumulated compound at once, so it has no per-element granularity. Change Per @aothms's guidance (skip in C++, let Python conditionally raise): guard each HLR stage (manifold test, prefilter face analysis, obscuration cache, per-element accumulation, projection) and on failure skip that unit while emitting a message through the non-static logger with a distinct SER error code (36 to 40) and the offending product where known. The projection failure is logged at ERROR (SER40) so a Python consumer can key on the code and raise. The catch sites handle Standard_Failure explicitly and report its DynamicType and GetMessageString, because on this OCCT build Standard_Failure does not derive from std::exception; a plain catch (std::exception&) would never see it and the log would stay generic. Verification On Monica_Residence: drawings that threw now finalize (SOUTH ELEVATION, SECTION - EAST, SECTION - NORTH complete; each logs SER40 with the OCCT detail), a clean drawing (NORTH ELEVATION) is byte-identical to the unguarded output, and no exception leaves finalize(). Fixes #3971 Generated with the assistance of an AI coding tool.
Open Graph Description: Summary The SVG serializer ran the OpenCASCADE hidden-line-removal routines in prefiltered_hlr with no exception handling, so a single failing element or a failing projection aborted the whole draw...
X Description: Summary The SVG serializer ran the OpenCASCADE hidden-line-removal routines in prefiltered_hlr with no exception handling, so a single failing element or a failing projection aborted the whole draw...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/pull/8376
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:c9f294f5-88d4-7e21-72db-40edf20eb270 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BD2A:C8426:2B67AB:3A3763:6B05168D |
| html-safe-nonce | 7ec1733d3b3a8ebff528b53d3dcfbcbd6c1c5ccbd603b4575c6b61930e341f24 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDJBOkM4NDI2OjJCNjdBQjozQTM3NjM6NkIwNTE2OEQiLCJ2aXNpdG9yX2lkIjoiODUxNTc3Mjk2ODI5MzcwMTI2MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f6b17d103a7fe1b5ed7e6f7860cd8010f7f08dcab9ad60decdd980f22481476c |
| hovercard-subject-tag | pull_request:4011531599 |
| 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/8376/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 | Summary The SVG serializer ran the OpenCASCADE hidden-line-removal routines in prefiltered_hlr with no exception handling, so a single failing element or a failing projection aborted the whole draw... |
| 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 |
| 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