DXF to SVG, SVG to DXF
DXF and SVG are commonly used file formats to describe vector data for machine production (like laser cutters or waterjet machines). An also commonly occuring problem to solve is a conversion between DXF to SVG or vice versa because a lot of programs use only the one or the other format to perform steps like nesting or line optimization. That makes it harder to work without data loss or errors like offsets, wrong scaling, etc.
DXF to SVG
Tested and working
- Use Inkscape with default DXF importer (works with AutoCAD DXF R13) - fails on polylines sometimes
- AutodeskInventorLaserExporter (works but is very limited to only basic entities)
- DXF/DWG Importer - includes tools like ...
- https://github.com/bjnortier/dxf → works but polylines are a bit rough. missing parameter for granularity
- ezdxf (documentation)
- conversion from DXF to SVG works basically very good but creates large "stupid" files.
- Not good for CNC working
- contains an addon to import DWG files https://ezdxf.readthedocs.io/en/stable/addons/dwg.html)
- dxf2svg/pycore.py → "At the moment not all dxf entitles type are supported during converting. It convert LINE, CIRCE, TEXT and all those entities go to one linetype, color and weight." → output looks really strange
- UniConverter → https://github.com/sk1project/uniconvertor/blob/5ecfd71ec612c4c2dcf7ec2f45686a928668d542/uniconvertor/src/uniconvertor/filters/import/dxfloader.py - this gives the ultimate best quality
- https://github.com/voyager-gold/javascript-dxf-to-svg → works but seems to ignore units/sizes/scalefactors
-
https://github.com/abey79/vpype + https://github.com/tatarize/vpype-dxf
-
http://www.calvina.de/pstoedit
-
We can use winder/svgToDxf or Zigazou/svg2dxf to utilize pstoedit to convert the SVG first into an EPS, and from EPS to DXF finally. This toolchain could be integrated into Export Layers extension of InkScape for Example. We can also re-write Export Layers to integrate the inhouse DXF export extension from inkscape
-
Tested and failed
- https://github.com/mduggan/dxf2svg → did not compile using MSYS2 with GCC and make
- https://github.com/mondalaci/dxf2svg2kicad
- https://github.com/aegis1980/cad_to_shapely → QCAD has to be used manually because community edition has no command line
SVG to DXF
Possible ways to convert are ...
- inkscape-lasercut-dxf
- winder/svgToDxf
- Zigazou/svg2dxf
- Feuermurmel/inkscape-shape-cli → "Command line tool to export shapes from an Inkscape SVG document to DXF"
- https://awesome.tech/installing-the-inkscape-plugins (Gerbil) → totally outdated and not that useful (compared with actual DXF Export from InkScape using WinMerge)
- default InkScape exporters (included in regular installation)
Keine Kommentare