Title: [Discussion] Direct IFC → DXF export path (ifc_dxf) · Issue #8731 · IfcOpenShell/IfcOpenShell · GitHub
Open Graph Title: [Discussion] Direct IFC → DXF export path (ifc_dxf) · Issue #8731 · IfcOpenShell/IfcOpenShell
X Title: [Discussion] Direct IFC → DXF export path (ifc_dxf) · Issue #8731 · IfcOpenShell/IfcOpenShell
Description: Feature Description [Discussion] Direct IFC → DXF export path (ifc_dxf) Why this issue Documenting some development work we've been doing on a direct IFC → DXF export path, in case it's useful reference for anyone working on drawing gene...
Open Graph Description: Feature Description [Discussion] Direct IFC → DXF export path (ifc_dxf) Why this issue Documenting some development work we've been doing on a direct IFC → DXF export path, in case it's useful refe...
X Description: Feature Description [Discussion] Direct IFC → DXF export path (ifc_dxf) Why this issue Documenting some development work we've been doing on a direct IFC → DXF export path, in case it's use...
Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/8731
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Discussion] Direct IFC → DXF export path (ifc_dxf)","articleBody":"### Feature Description\n\n# [Discussion] Direct IFC → DXF export path (`ifc_dxf`)\n\n## Why this issue\n\nDocumenting some development work we've been doing on a direct IFC → DXF export path, in case it's useful reference for anyone working on drawing generation, and to get a read on whether the direction is of any interest upstream. Still a work in progress, not battle-tested outside our own projects — not asking for a merge, just leaving a record and a question.\n\n## What's worth to me\nI'm building 2 pipelines, eventually considering later how to merge them:\n- 1 aimed at good locking result (matching as much as possible nice svg output);\n- 2 aimed at preserving information export and editability over good looking drawing. So good if slab countour is exported entirely also if not visible, good if the wall is a clean polyline, eventually considering exporting overhead openings if present. The user will have maximum possibility to edit the file.\n\n## What's built so far\n\nThe mockup has been entirely vibe coded in Claude, checking at the moment just the output and not much the code itself.\n\nThe code actually lives in [Bonsai Salad](https://github.com/carlopav/bonsai_salad/tree/main/ifc_dxf) and can be easily tested by user installing the addon.\n\n`ifc_dxf` reads an IFC drawing definition (`IfcAnnotation` + `EPset_Drawing`, cut-plane, `RepresentationContext`/`TargetView` selection) and writes DXF entities directly, against a maintained template (real-world scale, layer naming convention, title block substitution). Two experimental extraction strategies share the same writer:\n\n- a pure IFC-native traversal (no OCC), profile-based section cuts via\n Shapely (for a cleaner result, but with many failing cases);\n- one that uses same bonsai svg generation strategy, but tailored to dxf.\n\nEvery DXF entity carries its originating IFC `GlobalId`(s) as XDATA, so\nselection in CAD round-trips back to the model. Wherever `bonsai.tool` is importable it's reused directly (element selection, frustum culling); our own code exists mainly as a headless/no-`bpy` shim.\n\nA few things worth calling out specifically:\n\n\n* DXF template: exported drawings are populated into a maintained [template file ](https://github.com/carlopav/bonsai_salad/tree/main/ifc_dxf/templates)(layers, text/dimension styles, title block, viewport/scale setup) rather than assembled from scratch — closer to what a CAD user would expect to open and keep working in.\n* IfcTypeObject as native ACAD block: each distinct IFC type gets one\nBLOCK definition, instances become INSERTs — real block/instance semantics in the DXF, not just flattened geometry per element.\n* True geometry extraction: both strategies aim at actual arcs/circles/\nellipses and real cut/silhouette geometry, not a tessellated approximation.\n* Annotations as native entities: dimensions are written as real DXF\nDIMENSION entities (not exploded lines+text), and tags/symbols as BLOCK\nINSERTs with attribute definitions — so they stay editable/associative\nonce opened in CAD, not baked static geometry.\n\n\nStill open: material-layer hatch decomposition and overhead-fill handling for the HLR path, section/elevation views (non-zenithal camera), eventual merge of the two strategies into one.\n\n\n\n## Small upstream-adjacent items, noted for later\n\nNot asking for anything now, just flagging in case already known:\n\n- `ezdxf` has no native `SCALE`/`AcDbScale` entity — currently worked around\n manually.\n- Possible Bonsai bug: door arcs seem to export as `IfcEllipse` rather than `IfcCircle`. Will file separately with a repro if confirmed.\n- No way to expose a crease/dihedral-angle threshold on the HLR serializer (present in the OCC call, no SWIG setter) — would save a Python-side second pass if ever exposed (addressed by https://github.com/IfcOpenShell/IfcOpenShell/pull/8608).\n\n## Output testing\nTesting of the output is mainly done with BricsCAD v26.\n\n## Question\n\nIs a direct-to-DXF path worth continuing to shape toward an eventual PR, or is it redundant with something already planned? No urgency — mainly don't want to keep developing in a direction nobody upstream would want.\n","author":{"url":"https://github.com/carlopav","@type":"Person","name":"carlopav"},"datePublished":"2026-07-18T14:40:28Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/8731"}
| 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:7d8e233a-1fb5-73df-0b5b-f51a750bfa84 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D87C:23D7A:A24948:DC4355:6B048341 |
| html-safe-nonce | 987506f28ad946e724b654d2cc6a40b47c766f2e2463e9d55d43a7dbafa4a3bf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODdDOjIzRDdBOkEyNDk0ODpEQzQzNTU6NkIwNDgzNDEiLCJ2aXNpdG9yX2lkIjoiMTEyNDg5MDIyNjI1MTMwMTY5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 99cd13a2041176b6f715fefef8f7b97158c4b19e17607be3d758a7fe79bce239 |
| hovercard-subject-tag | issue:4918692575 |
| 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/8731/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e7f2e3177e19655ba4a76168026770c15a397d763dbd36264cce3a1e0bff94c7/IfcOpenShell/IfcOpenShell/issues/8731 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e7f2e3177e19655ba4a76168026770c15a397d763dbd36264cce3a1e0bff94c7/IfcOpenShell/IfcOpenShell/issues/8731 |
| og:image:alt | Feature Description [Discussion] Direct IFC → DXF export path (ifc_dxf) Why this issue Documenting some development work we've been doing on a direct IFC → DXF export path, in case it's useful refe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | carlopav |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70 |
| 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 | f5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8 |
| 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