Title: Need to understand how INCLUDE CURVES works · Issue #1290 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: Need to understand how INCLUDE CURVES works · Issue #1290 · IfcOpenShell/IfcOpenShell
X Title: Need to understand how INCLUDE CURVES works · Issue #1290 · IfcOpenShell/IfcOpenShell
Description: I'm a little confused by the behaviour of INCLUDE_CURVES and hope that maybe once I understand it I can implement in a consistent manner how 2D objects are loaded into the scene. Below are all the scenarios I can think of. A few things w...
Open Graph Description: I'm a little confused by the behaviour of INCLUDE_CURVES and hope that maybe once I understand it I can implement in a consistent manner how 2D objects are loaded into the scene. Below are all the ...
X Description: I'm a little confused by the behaviour of INCLUDE_CURVES and hope that maybe once I understand it I can implement in a consistent manner how 2D objects are loaded into the scene. Below are all ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/1290
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Need to understand how INCLUDE CURVES works","articleBody":"I'm a little confused by the behaviour of INCLUDE_CURVES and hope that maybe once I understand it I can implement in a consistent manner how 2D objects are loaded into the scene.\r\n\r\nBelow are all the scenarios I can think of. A few things which I'm confused by:\r\n\r\n 1. Isn't it extra work for the iterator to process it twice in Scenario A? Shouldn't it pick one and stick to it?\r\n 2. In Scenario B how does it decide which representation to process? What if there were more than one 2D representation?\r\n 3. I guess scenario C has a similar priority but for non 2D shapes?\r\n\r\nIn the past, I generally disabled INCLUDE_CURVES by default because I noticed some elements that had 3D bodies would be processed as 2D curves instead. But this was a long time ago and maybe I wasn't using the iterator, or maybe there is something I haven't discovered yet with the iterator (is the order in which it processes it twice consistent?). I guess what I'm saying is that I'd love to enable it by default so that annotations always appear (#1142) but I need to be a bit more confident that it won't bork 3D representations so I guess I'm asking is there something I haven't considered?\r\n\r\n```\r\nimport ifcopenshell\r\nimport ifcopenshell.geom\r\n\r\nf = ifcopenshell.open(\"/home/dion/Downloads/JudgesReception.ifc\")\r\nelement = f.by_id(653)\r\nbody_3d = f.by_id(644)\r\naxis_2d = f.by_id(633)\r\n\r\n# *****************************************************************************\r\n\r\n# INCLUDE_CURVES = True\r\n# Method: Geometry iterator\r\n# Element: Has 3D body + 2D axis\r\n# Result: First 2D axis is created, then 3D body is created\r\n\r\nprint(\"Scenario A\")\r\nsettings = ifcopenshell.geom.settings()\r\nsettings.set(settings.INCLUDE_CURVES, True)\r\niterator = ifcopenshell.geom.iterator(settings, f, include=[element])\r\niterator.initialize()\r\nwhile True:\r\n shape = iterator.get()\r\n print(shape.guid)\r\n print(shape.geometry.edges)\r\n print(shape.geometry.faces)\r\n if not iterator.next():\r\n break\r\n\r\n# *****************************************************************************\r\n\r\n# INCLUDE_CURVES = True\r\n# Method: Create shape on element\r\n# Element: Has 3D body + 2D axis\r\n# Result: Only 2D axis is created\r\n\r\nprint(\"Scenario B\")\r\nsettings = ifcopenshell.geom.settings()\r\nsettings.set(settings.INCLUDE_CURVES, True)\r\nshape = ifcopenshell.geom.create_shape(settings, element)\r\nprint(shape.guid)\r\nprint(shape.geometry.edges)\r\nprint(shape.geometry.faces)\r\n\r\n# *****************************************************************************\r\n\r\n# INCLUDE_CURVES = False\r\n# Method: Create shape on element\r\n# Element: Has 3D body + 2D axis\r\n# Result: 3D body is created\r\n\r\nprint(\"Scenario C\")\r\nsettings = ifcopenshell.geom.settings()\r\nshape = ifcopenshell.geom.create_shape(settings, element)\r\nprint(shape.guid)\r\nprint(shape.geometry.edges)\r\nprint(shape.geometry.faces)\r\n\r\n# *****************************************************************************\r\n\r\n# INCLUDE_CURVES = False\r\n# Method: Create shape on 3D body\r\n# Result: 3D body is created\r\n\r\nprint(\"Scenario D\")\r\nsettings = ifcopenshell.geom.settings()\r\nshape = ifcopenshell.geom.create_shape(settings, body_3d)\r\nprint(shape.edges)\r\nprint(shape.faces)\r\n\r\n# *****************************************************************************\r\n\r\n# INCLUDE_CURVES = False\r\n# Method: Create shape on 2D axis\r\n# Result: Fail\r\n\r\nprint(\"Scenario E\")\r\nsettings = ifcopenshell.geom.settings()\r\ntry:\r\n shape = ifcopenshell.geom.create_shape(settings, axis_2d)\r\nexcept:\r\n print(\"Fail\")\r\n\r\n# *****************************************************************************\r\n\r\n# INCLUDE_CURVES = True\r\n# Method: Create shape on 3D body\r\n# Result: 3D body is created\r\n\r\nprint(\"Scenario F\")\r\nsettings = ifcopenshell.geom.settings()\r\nsettings.set(settings.INCLUDE_CURVES, True)\r\nshape = ifcopenshell.geom.create_shape(settings, body_3d)\r\nprint(shape.edges)\r\nprint(shape.faces)\r\n\r\n\r\n# *****************************************************************************\r\n\r\n# INCLUDE_CURVES = True\r\n# Method: Create shape on 2D axis\r\n# Result: 2D axis is created\r\n\r\nprint(\"Scenario G\")\r\nsettings = ifcopenshell.geom.settings()\r\nsettings.set(settings.INCLUDE_CURVES, True)\r\nshape = ifcopenshell.geom.create_shape(settings, axis_2d)\r\nprint(shape.edges)\r\nprint(shape.faces)\r\n```","author":{"url":"https://github.com/Moult","@type":"Person","name":"Moult"},"datePublished":"2021-02-03T00:59:49Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/1290"}
| 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:090f6ccc-3d10-e49b-32ae-624a7bc94209 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D54A:237AAE:7691AF:A1AEB3:6B0479EA |
| html-safe-nonce | d8288e078518f796ef7cc2b8be2add73e301b122525bf3fd8e148982f105ff65 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTRBOjIzN0FBRTo3NjkxQUY6QTFBRUIzOjZCMDQ3OUVBIiwidmlzaXRvcl9pZCI6IjEwNTgxMTI5NDY2MTE0NTIzOTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | dae04d6d92492a2eaf2a322a8552562b1dfdd92cc6d4aab9e5d56bffac83e865 |
| hovercard-subject-tag | issue:799855318 |
| 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/1290/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8308df89a7f116217e52fe9a5575006c6d1765535e36bb60cf514882089cd976/IfcOpenShell/IfcOpenShell/issues/1290 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8308df89a7f116217e52fe9a5575006c6d1765535e36bb60cf514882089cd976/IfcOpenShell/IfcOpenShell/issues/1290 |
| og:image:alt | I'm a little confused by the behaviour of INCLUDE_CURVES and hope that maybe once I understand it I can implement in a consistent manner how 2D objects are loaded into the scene. Below are all the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Moult |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| 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 | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| 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