Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Project: Improve DXF import and export
Currently OpenSCAD uses it's own limited parser to read DXF files (2D-only) which does not support things like curves/splines. Using an external library should provide better support for both import and export of DXF files.
The main focus for the change is the import of DXF files as the import currently fails to read various categories of DXF files exported by other tools. Right now a complex preparation is needed to ensure drawings created in programs like Inkscape can be imported correctly in OpenSCAD. Using an existing external library with complete DXF support should make the process much easier.
Importing more complex drawings will need some integration with OpenSCAD features, e.g. the handling of $fn/$fa/$fs variables that define how curves are converted into the internal polygon/mesh data structures.
As the libraries normally support both reading and writing of DXF files, the export could be changed to use the selected library too. This is not highly critical as the export is based on a known set of internal data structures but would help to unify the code base. In case the library supports 3D DXF files, it would be nice to add support for that.
Topics that need to be solved
- Research options of usable libraries
- Investigate support for 2D and 3D import/export
- Select library and integrate into OpenSCAD
- Add test cases to verify the new export/import functionality
- Update build system to include the new library into installers
- OpenSCAD supports reading of 2D DXF files exported by other programs (e.g. Inkscape) without special preparation before the export (e.g. convert curves to straight lines)
- Optional: Support for reading and writing 3D DXF
- Programming language is C++
- Understand and use APIs from external libraries
- Integrate new libraries into the build system for the 3 supported platforms
- Add test cases with files using the new features to allow regression testing
- libdxfrw - http://sourceforge.net/projects/libdxfrw/
- DxfLib - http://www.ribbonsoft.com/de/what-is-dxflib
- Dime - https://bitbucket.org/Coin3D/dime
- BRL-CAD - see http://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/trunk/src/conv/dxf/ also there's currently a project going on to provide file-formats/converters as separate library