-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support DXF / 2D Exports #798
Comments
Thank you for opening this issue, @Protryon! I have no experience with this use case and know very little about DXF, but this is definitely a desirable feature. The Fornjot kernel is using boundary representation, so it would definitely be possible to export curves directly, in principle. In practice, the Clarifying the use caseYou describe defining 2D shapes and exporting those directly to DXF. It sounds like you use the 3D models only for your own benefit, and don't export those to any external format. This sounds like something that could reasonably be supported in the near term, provided someone is able to put the effort in. There even is a DXF library in Rust already (dxf-rs), so assuming that works well, this would mostly be an effort of re-shuffling some things within Fornjot, which sounds doable (a million little problems will be discovered on the way, of course, but that's always the same 😂). @Protryon, I'm aware that exporting 2D drawings of a 3D model, to show it from different perspectives, is a common thing in machining. Do you know, if that is related to DXF at all? I would assume that this is a different use case and PDF is a more reasonable target for that, but as I said, I have no experience with these things, so please let me know if you know anything. Thoughts on implementationI currently assume that models will be able to expose multiple types of artifacts. I've written a bit about that, and a potential syntax, here: #220 (comment) Currently, you can only export a model as a whole, which makes sense, because all models are just a monolithic 3d thing. If models can export different artifacts, the export function (currently exposed through a command-line argument on To make this work, the interface between I'm of the opinion that it makes sense to make the switch to WebAssembly (#71) first before working on that, but I wouldn't reject a reasonable pull request that did this based on the current host/model system. Help wantedAs I said above, I think it would be reasonable to add this in the near-term, but it would require someone to drive this effort. I'm personally super-busy with boolean operations (#42, #43, #44) right now (and there's more on my list after that), and don't see myself having time for this any time soon. If someone is willing to step up, please let me know! Happy to assist with advice and feedback. I've added a task to my list, to add some more thoughts on the implementation here. Hopefully I'll get to that next week. |
My experiences with complex 3D+ CNC is fairly limited, but my understanding is that orthographic projects of a model are common to include for measurements & documentations. Similarly, they can be used for engineering design review. This is all outside my wheelhouse though. PDF sounds right, that would be a human consumption use case. My use case here is laser cutting(/2D CNC) where there is a powerful laser cutting sheets of material (i.e. aluminum, steel, carbon fiber). The paths exported end up being cut paths for the laser. 2D CNC is analogous. |
Thanks for clarifying, @Protryon! |
Okay, as promised, here are more thoughts on how to implement this.
That last step is a bit vague, owing to the fact that I haven't looked more deeply into DXF or dxf-rs. If any questions come up during the implementation, I'm happy to do my best and answer them. Footnotes
|
Labeling this issue as blocked on #804. |
#804 has been addressed. This issue is no longer blocked. |
This remains a desired feature, but I have decided to close this issue for now. I've added an entry about DXF/SVG exports to the feature wishlist instead. There are upcoming changes to the geometry representation, and while this issue is not blocked by that, I don't think it makes much sense to work on this issue before that lands. Any DXF export feature would essentially need to be rewritten as part of the transition. This, coupled with the fact that there doesn't seem to be much appetite to implement this (I remain busy with other stuff, and nobody has stepped up to work on it in over a year) makes me think that the feature wishlist is the more appropriate place for this, for now. |
I use OpenSCAD extensively in my workflows for 2D and 3D geometry. For laser cutting/2D CNC, I frequently use 2D shapes as OpenSCAD modules that I can export in DXF format for vendors (unsure what actual machines use). I would have a 3D model that shows the assembly of those 2D parts extruded with some other non-2D parts as well.
As a potential improvement over OpenSCAD -- it exports everything as line segments which CNC doesn't like at all. If the vendor accepts it (which they didn't for most models), it would be a jagged edge even with high vertex counts due to poor/overprecise CNC control code. I took inspiration from a 3D printing project to make a postprocess step to fix this: https://github.com/Protryon/dxf-welder
If Fornjot could export proper curves in DXF (either as a result of the different kernel or as a result of a optional postprocess step), that would be amazing! I'm always worried about my homerolled post-process step disturbing dimensional accuracy on my <0.1mm requirements.
The text was updated successfully, but these errors were encountered: