Title: append_asset doesn't convert plane angles between library and project units · Issue #10183 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: append_asset doesn't convert plane angles between library and project units · Issue #10183 · IfcOpenShell/IfcOpenShell
X Title: append_asset doesn't convert plane angles between library and project units · Issue #10183 · IfcOpenShell/IfcOpenShell
Description: ifcopenshell.api.project.append_asset converts lengths when the library and the project use different length units, but copies plane angles unchanged. An asset whose geometry has an angle, such as an IfcRevolvedAreaSolid, comes out wrong...
Open Graph Description: ifcopenshell.api.project.append_asset converts lengths when the library and the project use different length units, but copies plane angles unchanged. An asset whose geometry has an angle, such as ...
X Description: ifcopenshell.api.project.append_asset converts lengths when the library and the project use different length units, but copies plane angles unchanged. An asset whose geometry has an angle, such as ...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/10183
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"append_asset doesn't convert plane angles between library and project units","articleBody":"`ifcopenshell.api.project.append_asset` converts lengths when the library and the project use different length units, but copies plane angles unchanged. An asset whose geometry has an angle, such as an `IfcRevolvedAreaSolid`, comes out wrong when the library and the project use different angle units.\n\n**Example.** A library in radians (or with no plane angle unit, so radians by default) has a revolved solid with `Angle = 2π`, a full turn. Appended into a project in degrees, `Angle` stays `6.283…`, which the project reads as 6.28°. The shade appears as a thin sliver, with every geometry library. Going the other way, a 360° library angle becomes 360 radians in a radian project.\n\n```python\nimport math\nimport ifcopenshell, ifcopenshell.api.project, ifcopenshell.api.root, ifcopenshell.api.unit\nimport ifcopenshell.api.context, ifcopenshell.api.geometry\nfrom ifcopenshell.util.shape_builder import ShapeBuilder\n\nlibrary = ifcopenshell.api.project.create_file()\nifcopenshell.api.root.create_entity(library, ifc_class=\"IfcProject\") # no angle unit: radians\nwall = ifcopenshell.api.root.create_entity(library, ifc_class=\"IfcWall\")\nbuilder = ShapeBuilder(library)\ncontext = ifcopenshell.api.context.add_context(library, context_type=\"Model\")\nprofile = builder.profile(builder.rectangle((1, 1), position=(1, 0)))\nsolid = library.createIfcRevolvedAreaSolid(\n profile, library.createIfcAxis2Placement3D(library.createIfcCartesianPoint((0.0, 0.0, 0.0))),\n library.createIfcAxis1Placement(library.createIfcCartesianPoint((0.0, 0.0, 0.0))), 2 * math.pi)\nifcopenshell.api.geometry.assign_representation(library, wall, builder.get_representation(context, solid))\n\nproject = ifcopenshell.api.project.create_file()\nifcopenshell.api.root.create_entity(project, ifc_class=\"IfcProject\")\nifcopenshell.api.unit.assign_unit(project, units=[ifcopenshell.api.unit.add_conversion_based_unit(project, name=\"degree\")])\nifcopenshell.api.project.append_asset(project, library=library, element=wall)\nprint(project.by_type(\"IfcRevolvedAreaSolid\")[0].Angle) # 6.283..., expected 360.0\n```\n\n**Expected:** angles are converted by the ratio of the two files' plane angle unit scales (`calculate_unit_scale(f, \"PLANEANGLEUNIT\")`), in the same way lengths are converted.\n\n**Notes:**\n- Only attributes *declared* as plane angles should be converted, such as `IfcRevolvedAreaSolid.Angle` or a profile's flange slope. An `IfcPlaneAngleMeasure` used as a property value can carry its own `Unit` (for example a beam angle in degrees), so converting it would be wrong.\n- Not covered here: trimming parameters of conics (`IfcTrimmedCurve` with an `IfcParameterValue`, which are angles in the project's units), and the `assume_asset_uniqueness_by_name=False` path, which goes through `file.add`.\n- I came across this appending a revolved light fixture from an asset library in radians into a project in feet and degrees.\n\nI have a fix with tests and can open a PR.\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-11-09T17:48:56Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/10183"}
| 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:8feab1b8-7399-286d-350a-e22840c34145 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B96:B89B3:BCF27:10D028:6B046382 |
| html-safe-nonce | b72f77b9462c2abfaaf62f8f261b2bd31d880225b26c21258972487092446985 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Qjk2OkI4OUIzOkJDRjI3OjEwRDAyODo2QjA0NjM4MiIsInZpc2l0b3JfaWQiOiI2OTU3MTg5MDA1NTM1MDc3MTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e91e9987b34d8d1885b98a2da21a3b5fa0c225a8d1ddb685373d0bf805258946 |
| hovercard-subject-tag | issue:6291534069 |
| 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/10183/issue_layout |
| twitter:image | https://opengraph.githubassets.com/761ce7734b29b47f09c966ae86ba25662b9b78eaee070944d70ee4f41b329fda/IfcOpenShell/IfcOpenShell/issues/10183 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/761ce7734b29b47f09c966ae86ba25662b9b78eaee070944d70ee4f41b329fda/IfcOpenShell/IfcOpenShell/issues/10183 |
| og:image:alt | ifcopenshell.api.project.append_asset converts lengths when the library and the project use different length units, but copies plane angles unchanged. An asset whose geometry has an angle, such as ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | theoryshaw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| 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 | 03e114520787ad27289207f153520ef97461127c |
| 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