Title: v0.8.0 - missing representation item styles · Issue #4844 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: v0.8.0 - missing representation item styles · Issue #4844 · IfcOpenShell/IfcOpenShell
X Title: v0.8.0 - missing representation item styles · Issue #4844 · IfcOpenShell/IfcOpenShell
Description: import ifcopenshell import ifcopenshell.geom ifc_str = """ ISO-10303-21; HEADER; FILE_DESCRIPTION(('ViewDefinition[DesignTransferView]'),'2;1'); FILE_NAME('base.ifc','2024-06-11T15:45:02+05:00',(),(),'IfcOpenShell 0.0.0','BlenderBIM 0.0....
Open Graph Description: import ifcopenshell import ifcopenshell.geom ifc_str = """ ISO-10303-21; HEADER; FILE_DESCRIPTION(('ViewDefinition[DesignTransferView]'),'2;1'); FILE_NAME('base.ifc','2024-06-11T15:45:02+05:00',(),...
X Description: import ifcopenshell import ifcopenshell.geom ifc_str = """ ISO-10303-21; HEADER; FILE_DESCRIPTION(('ViewDefinition[DesignTransferView]'),'2;1'); FILE_NAME('base.i...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/4844
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"v0.8.0 - missing representation item styles","articleBody":"```python\r\nimport ifcopenshell\r\nimport ifcopenshell.geom\r\n\r\nifc_str = \"\"\"\r\nISO-10303-21;\r\nHEADER;\r\nFILE_DESCRIPTION(('ViewDefinition[DesignTransferView]'),'2;1');\r\nFILE_NAME('base.ifc','2024-06-11T15:45:02+05:00',(),(),'IfcOpenShell 0.0.0','BlenderBIM 0.0.999999-1f98150','Nobody');\r\nFILE_SCHEMA(('IFC4'));\r\nENDSEC;\r\nDATA;\r\n#1=IFCPROJECT('29O04cjgj4jhEhvMRLSc2H',$,'My Project',$,$,$,$,(#14,#26),#9);\r\n#2=IFCSIUNIT(*,.LENGTHUNIT.,.MILLI.,.METRE.);\r\n#3=IFCSIUNIT(*,.AREAUNIT.,$,.SQUARE_METRE.);\r\n#4=IFCSIUNIT(*,.VOLUMEUNIT.,$,.CUBIC_METRE.);\r\n#5=IFCDIMENSIONALEXPONENTS(0,0,0,0,0,0,0);\r\n#6=IFCSIUNIT(*,.PLANEANGLEUNIT.,$,.RADIAN.);\r\n#7=IFCMEASUREWITHUNIT(IFCREAL(0.0174532925199433),#6);\r\n#8=IFCCONVERSIONBASEDUNIT(#5,.PLANEANGLEUNIT.,'degree',#7);\r\n#9=IFCUNITASSIGNMENT((#3,#4,#2,#8));\r\n#10=IFCCARTESIANPOINT((0.,0.,0.));\r\n#11=IFCDIRECTION((0.,0.,1.));\r\n#12=IFCDIRECTION((1.,0.,0.));\r\n#13=IFCAXIS2PLACEMENT3D(#10,#11,#12);\r\n#14=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Model',3,1.E-05,#13,$);\r\n#15=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Model',*,*,*,*,#14,$,.MODEL_VIEW.,$);\r\n#16=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Axis','Model',*,*,*,*,#14,$,.GRAPH_VIEW.,$);\r\n#17=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Box','Model',*,*,*,*,#14,$,.MODEL_VIEW.,$);\r\n#18=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Annotation','Model',*,*,*,*,#14,$,.SECTION_VIEW.,$);\r\n#19=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Annotation','Model',*,*,*,*,#14,$,.ELEVATION_VIEW.,$);\r\n#20=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Annotation','Model',*,*,*,*,#14,$,.MODEL_VIEW.,$);\r\n#21=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Annotation','Model',*,*,*,*,#14,$,.PLAN_VIEW.,$);\r\n#22=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Profile','Model',*,*,*,*,#14,$,.ELEVATION_VIEW.,$);\r\n#23=IFCCARTESIANPOINT((0.,0.));\r\n#24=IFCDIRECTION((1.,0.));\r\n#25=IFCAXIS2PLACEMENT2D(#23,#24);\r\n#26=IFCGEOMETRICREPRESENTATIONCONTEXT($,'Plan',2,1.E-05,#25,$);\r\n#27=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Axis','Plan',*,*,*,*,#26,$,.GRAPH_VIEW.,$);\r\n#28=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Body','Plan',*,*,*,*,#26,$,.PLAN_VIEW.,$);\r\n#29=IFCGEOMETRICREPRESENTATIONSUBCONTEXT('Annotation','Plan',*,*,*,*,#26,$,.PLAN_VIEW.,$);\r\n#30=IFCSITE('20bDsX3I973fFUR6tkNN_6',$,'My Site',$,$,#53,$,$,$,$,$,$,$,$);\r\n#36=IFCBUILDING('2zv2FNZi51lfL4$gtGKliq',$,'My Building',$,$,#59,$,$,$,$,$,$);\r\n#42=IFCBUILDINGSTOREY('1maih8WQP0OxqEZIBKh2Qn',$,'My Storey',$,$,#65,$,$,$,$);\r\n#48=IFCRELAGGREGATES('3mO02jzR97TPWHvYMRrfPs',$,$,$,#1,(#30));\r\n#49=IFCCARTESIANPOINT((0.,0.,0.));\r\n#50=IFCDIRECTION((0.,0.,1.));\r\n#51=IFCDIRECTION((1.,0.,0.));\r\n#52=IFCAXIS2PLACEMENT3D(#49,#50,#51);\r\n#53=IFCLOCALPLACEMENT($,#52);\r\n#54=IFCRELAGGREGATES('03yh9WjMXByeNFtrrOdjqh',$,$,$,#30,(#36));\r\n#55=IFCCARTESIANPOINT((0.,0.,0.));\r\n#56=IFCDIRECTION((0.,0.,1.));\r\n#57=IFCDIRECTION((1.,0.,0.));\r\n#58=IFCAXIS2PLACEMENT3D(#55,#56,#57);\r\n#59=IFCLOCALPLACEMENT(#53,#58);\r\n#60=IFCRELAGGREGATES('0IPRDxoK9EBAyK1rb684AE',$,$,$,#36,(#42));\r\n#61=IFCCARTESIANPOINT((0.,0.,0.));\r\n#62=IFCDIRECTION((0.,0.,1.));\r\n#63=IFCDIRECTION((1.,0.,0.));\r\n#64=IFCAXIS2PLACEMENT3D(#61,#62,#63);\r\n#65=IFCLOCALPLACEMENT(#59,#64);\r\n#66=IFCACTUATOR('1fDIPqSH53PPvA3DUTU3J5',$,'Cube',$,$,#90,#84,$,.ELECTRICACTUATOR.);\r\n#84=IFCPRODUCTDEFINITIONSHAPE($,$,(#183,#186));\r\n#85=IFCRELCONTAINEDINSPATIALSTRUCTURE('34dGKF1414nO8nKvvbYLjt',$,$,$,(#66),#42);\r\n#86=IFCCARTESIANPOINT((0.,0.,0.));\r\n#87=IFCDIRECTION((0.,0.,1.));\r\n#88=IFCDIRECTION((1.,0.,0.));\r\n#89=IFCAXIS2PLACEMENT3D(#86,#87,#88);\r\n#90=IFCLOCALPLACEMENT(#65,#89);\r\n#91=IFCMATERIAL('Default',$,$);\r\n#116=IFCSURFACESTYLE('red',.BOTH.,(#117));\r\n#117=IFCSURFACESTYLESHADING(#118,0.);\r\n#118=IFCCOLOURRGB($,1.,0.00318965944461524,0.);\r\n#176=IFCRECTANGLEPROFILEDEF(.AREA.,$,$,1999.99988079071,1999.99988079071);\r\n#177=IFCCARTESIANPOINT((0.,0.,-999.999940395355));\r\n#178=IFCDIRECTION((0.,-0.,-1.));\r\n#179=IFCDIRECTION((-1.,0.,0.));\r\n#180=IFCAXIS2PLACEMENT3D(#177,#178,#179);\r\n#181=IFCDIRECTION((0.,0.,-1.));\r\n#182=IFCEXTRUDEDAREASOLID(#176,#180,#181,1999.99988079071);\r\n#183=IFCSHAPEREPRESENTATION(#15,'Body','SweptSolid',(#182,#199));\r\n#184=IFCCARTESIANPOINT((-999.999940395355,-999.999940395355,-999.999940395355));\r\n#185=IFCBOUNDINGBOX(#184,1999.99988079071,1999.99988079071,1999.99988079071);\r\n#186=IFCSHAPEREPRESENTATION(#17,'Box','BoundingBox',(#185));\r\n#187=IFCSTYLEDITEM(#182,(#116),'red');\r\n#199=IFCEXTRUDEDAREASOLID(#200,#209,#205,1999.99988079071);\r\n#200=IFCRECTANGLEPROFILEDEF(.AREA.,$,$,1999.99988079071,1999.99988079071);\r\n#201=IFCAXIS2PLACEMENT3D(#202,#203,#204);\r\n#202=IFCCARTESIANPOINT((0.,0.,-999.999940395355));\r\n#203=IFCDIRECTION((0.,-0.,-1.));\r\n#204=IFCDIRECTION((-1.,0.,0.));\r\n#205=IFCDIRECTION((0.,0.,-1.));\r\n#206=IFCCARTESIANPOINT((0.,4522.9606628418,-999.999940395355));\r\n#207=IFCDIRECTION((0.,0.,-1.));\r\n#208=IFCDIRECTION((-1.,0.,0.));\r\n#209=IFCAXIS2PLACEMENT3D(#206,#207,#208);\r\nENDSEC;\r\nEND-ISO-10303-21;\r\n\"\"\"\r\nifc_file = ifcopenshell.file.from_string(ifc_str)\r\n\r\nsettings = ifcopenshell.geom.settings()\r\nprint(settings.set(settings.APPLY_DEFAULT_MATERIALS, False))\r\nelement = ifc_file.by_type(\"IfcActuator\")[0]\r\n\r\nimport ifcopenshell.ifcopenshell_wrapper\r\nifcopenshell.ifcopenshell_wrapper.turn_on_detailed_logging()\r\n\r\n\r\nshape = ifcopenshell.geom.create_shape(settings, ifc_file.by_id(66)) # element\r\n\r\nprint(shape)\r\nprint([m.name or m.instance_id for m in shape.geometry.materials])\r\nprint(shape.geometry.material_ids)\r\n\r\ngeometry = ifcopenshell.geom.create_shape(settings, ifc_file.by_id(183)) # representation\r\nprint([m.name or m.instance_id for m in geometry.materials])\r\nprint(geometry.material_ids)\r\n```\r\n\r\nSomething is missing about representation item styles. Example above has a representation that consists of 2 extruded areas - one has a style and other doesn't.\r\nResult in 0.7.0:\r\n\r\n```\r\nNone\r\n\u003cifcopenshell.ifcopenshell_wrapper.TriangulationElement; proxy of \u003cSwig Object of type 'IfcGeom::TriangulationElement *' at 0x7892c50c40c0> >\r\n['surface-style-116-red']\r\n(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)\r\n['surface-style-116-red']\r\n(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)\r\n```\r\nResult in 0.8.0 (representation items styles are missing):\r\n```\r\nNone\r\n[Warning] [2024-06-11 17:27:30] Precision lower than 0.0000001 meter not enforced\r\n[Error] [2024-06-11 17:27:30] Failed to convert:\r\n#187=IfcStyledItem(#182,(#116),'red')\r\n[Error] [2024-06-11 17:27:30] No operation defined for:\r\n#187=IfcStyledItem(#182,(#116),'red')\r\n[Warning] [2024-06-11 17:27:30] No material and surface styles for:\r\n#66=IfcActuator('1fDIPqSH53PPvA3DUTU3J5',$,'Cube',$,$,#90,#84,$,.ELECTRICACTUATOR.)\r\n\u003cifcopenshell.ifcopenshell_wrapper.TriangulationElement; proxy of \u003cSwig Object of type 'IfcGeom::TriangulationElement *' at 0x000001C7E5E45E00> >\r\n[]\r\n(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)\r\n[Warning] [2024-06-11 17:27:30] Precision lower than 0.0000001 meter not enforced\r\n[Error] [2024-06-11 17:27:30] Failed to convert:\r\n#187=IfcStyledItem(#182,(#116),'red')\r\n[Error] [2024-06-11 17:27:30] No operation defined for:\r\n#187=IfcStyledItem(#182,(#116),'red')\r\n[]\r\n(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1)\r\n```\r\n\r\nRepresentation items styles seems to be previously handled by this code:\r\nhttps://github.com/IfcOpenShell/IfcOpenShell/blob/e3cb811225d232cd85b83af9e4da08bb9b770f5a/src/ifcgeom/mapping.cpp#L31-L43\r\n\r\n_Originally posted by @Andrej730 in https://github.com/IfcOpenShell/IfcOpenShell/issues/4832#issuecomment-2160579131_\r\n ","author":{"url":"https://github.com/Andrej730","@type":"Person","name":"Andrej730"},"datePublished":"2024-06-11T12:09:20Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/4844"}
| 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:6d9313ee-482c-f2ab-812a-7a838d1e8800 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD1A:344084:5F3B2D:8602B9:6B04774B |
| html-safe-nonce | bdc7ed7eb5845a2a7a03509cabdbd9ee06031c9a1bf7328dbdb8bcd3c7c79a09 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDFBOjM0NDA4NDo1RjNCMkQ6ODYwMkI5OjZCMDQ3NzRCIiwidmlzaXRvcl9pZCI6IjIyNzk4NTAyNjQwNzA3NDc5NzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 498738a8014d9e1dc1e661c1a8c5cdd12429c6aa99982bd8e4f40a5c080f572b |
| hovercard-subject-tag | issue:2346256649 |
| 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/4844/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c628e92b99a9eeb72483a4940afd28230008b690befce23016de029c595d8b8b/IfcOpenShell/IfcOpenShell/issues/4844 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c628e92b99a9eeb72483a4940afd28230008b690befce23016de029c595d8b8b/IfcOpenShell/IfcOpenShell/issues/4844 |
| og:image:alt | import ifcopenshell import ifcopenshell.geom ifc_str = """ ISO-10303-21; HEADER; FILE_DESCRIPTION(('ViewDefinition[DesignTransferView]'),'2;1'); FILE_NAME('base.ifc','2024-06-11T15:45:02+05:00',(),... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Andrej730 |
| 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