Re: [Inkscape-devel] DXF import

Are there any plans for a DXF import ? Right now I have to open a DXF in Open Office Draw, save as SVG, then import into Inkscape. Too bad OO is not GPL otherwise could just take that code module and stick into Inkscape, but maybe there are others.

On Fri, 2005-04-08 at 15:30 -0600, John Taber wrote:
Are there any plans for a DXF import ? Right now I have to open a DXF in Open Office Draw, save as SVG, then import into Inkscape. Too bad OO is not GPL otherwise could just take that code module and stick into Inkscape, but maybe there are others.
Actually it's dual licensed GPL/SISSL so it's perfectly OK to reuse OOo code in a GPL project. If the functionality is good it might be a perfectly reasonable starting point at least.
/Per

John Taber wrote:
Are there any plans for a DXF import ? Right now I have to open a DXF in Open Office Draw, save as SVG, then import into Inkscape. Too bad OO is not GPL otherwise could just take that code module and stick into Inkscape, but maybe there are others.
Well, if we had more autocad guys here, we could just do it ourselves. ;-) I know that .dxf is a very simple format. But if you could write up a few paragraphs how to map DXF entries to SVG elements, we could just do it in-house.
Bob

Bob Jamison wrote:
John Taber wrote:
Are there any plans for a DXF import ? Right now I have to open a DXF in Open Office Draw, save as SVG, then import into Inkscape. Too bad OO is not GPL otherwise could just take that code module and stick into Inkscape, but maybe there are others.
Well, if we had more autocad guys here, we could just do it ourselves. ;-) I know that .dxf is a very simple format. But if you could write up a few paragraphs how to map DXF entries to SVG elements, we could just do it in-house.
I'm not an autocad guy, and I can't afford to be ($), but I do have a very small bit of experience with both SVG to DXF. I wrote a simple script to convert path segments (MLCZz) into DXF SPLINEs and LINEs. http://www.ekips.org/comp/prog/paths/patheditor.php My application was simply to convert guitar bodies and other shapes drawn in SVG into an outline and in DXF format. This was pretty easy because cubic beziers can be represented by NURB curves. (I would expect going the other way to be slightly more challenging mathematically.)
I don't know what all of the full capabilities of DXF are or how well they map to SVG, but I would be happy to help look.
What do people expect to do with SVG to DXF conversion? What would a converter need to support and how would it fit into a persons workflow?
Aaron Spike

On Fri, Apr 08, 2005 at 05:32:57PM -0500, aaron@...749... wrote:
I don't know what all of the full capabilities of DXF are or how well they map to SVG, but I would be happy to help look.
From what I know of DXF, it's not a totally one-to-one mapping. I.e., a
documented converted from DXF to SVG and back to DXF would probably end up a LOT different. However, they're both vector formats so in principle at least the basics (lines, shapes, etc.) should be convertable.
What do people expect to do with SVG to DXF conversion? What would a converter need to support and how would it fit into a persons workflow?
Maybe a good starting point could be to take an example file from QCAD and write a script that creates a "visually identical" SVG from it. Or else pick your top ten list of object types from QCAD and write a script that converts those to the corresponding SVG entities. In either case, that'd move the ball forward nicely. :-)
Of course, the trick will be sticking with it and pushing the dxf2svg tool to be as feature-complete as possible. With CAD tools, nothing is more frustrating than running a conversion tool and ending up with a result that takes as much work to clean up as it'd have taken to redraw the drawing from scratch. (Well, being forbidden from fixing the conversion tool in question due to internal corporate politics is more frustrating, but I've excised that from my memory... la la la).
Bryce

On Friday 08 April 2005 15:50, Bob Jamison wrote:
Well, if we had more autocad guys here, we could just do it ourselves. ;-)
Be glad you are talented programmers instead of one of us poor civil engineers:) Besides, Inkscape is so much easier to use!
You're right, the original DXF is not real difficult but they keep breaking the specs with each new release and they do not export to SVG - but they do export to the older R12 dxf so we could base on that. I think that is what OO is based on. QCAD also uses dxf but I'm not sure what version. I'll try to work up something this week. John

John Taber wrote:
On Friday 08 April 2005 15:50, Bob Jamison wrote:
Well, if we had more autocad guys here, we could just do it ourselves. ;-)
Be glad you are talented programmers instead of one of us poor civil engineers:) Besides, Inkscape is so much easier to use!
You're right, the original DXF is not real difficult but they keep breaking the specs with each new release and they do not export to SVG - but they do export to the older R12 dxf so we could base on that. I think that is what OO is based on. QCAD also uses dxf but I'm not sure what version. I'll try to work up something this week.
I used to do mucking about with dxf conversion. Even took courses including Autocad. I'd do a lot to munge things in and of of different 3D formats. Of course, this was more in the '90-'95 timeframe. However, I had been going through the specs, and keept a little abreast of things over the years.
One thing I was thinking, when I saw the first messages on this thread, was that even if there are some other DXF converters we might want to do our own anyway, since there might be higher-level semantics we could preserve differently, or might map into Inkscape-specific extensions. Thinking of some of the things wanted like diagramming, connectors, etc.

Jon A. Cruz wrote:
One thing I was thinking, when I saw the first messages on this thread, was that even if there are some other DXF converters we might want to do our own anyway, since there might be higher-level semantics we could preserve differently, or might map into Inkscape-specific extensions. Thinking of some of the things wanted like diagramming, connectors, etc.
Two links that I saw a while back that might be of interest: http://www.ribbonsoft.com/dxflib.html http://www.opendesign.com/
Aaron Spike
participants (6)
-
unknown@example.com
-
Bob Jamison
-
Bryce Harrington
-
John Taber
-
Jon A. Cruz
-
Per Bjornsson