#cad #dxb #auto-cad

dxf

A rust crate for reading and writing DXF and DXB CAD files

8 releases (5 breaking)

0.6.0 Nov 9, 2024
0.5.0 Sep 28, 2021
0.4.0 Nov 16, 2019
0.3.0 Oct 18, 2017
0.1.1 Sep 19, 2016

#287 in Parser implementations

Download history 2871/week @ 2024-07-29 1154/week @ 2024-08-05 1417/week @ 2024-08-12 1607/week @ 2024-08-19 2830/week @ 2024-08-26 1896/week @ 2024-09-02 978/week @ 2024-09-09 265/week @ 2024-09-16 185/week @ 2024-09-23 155/week @ 2024-09-30 154/week @ 2024-10-07 181/week @ 2024-10-14 104/week @ 2024-10-21 125/week @ 2024-10-28 238/week @ 2024-11-04 163/week @ 2024-11-11

654 downloads per month
Used in 4 crates

MIT license

715KB
18K SLoC

dxf-rs

A rust crate for reading and writing DXF CAD files.

Usage

Put this in your Cargo.toml:

[dependencies]
dxf = "0.5.0"

Or if you want serde support, enable the serialize feature:

[dependencies]
dxf = { version = "0.5.0", features = ["serialize"] }

Note that serde support is intended to aid in debugging and since the serialized format is heavily dependent on the layout of the structures, it may change at any time.

And finally add:

extern crate dxf;

Documentation

See the documentation here on docs.rs.

Integration tests

There are some integration/interop tests under src/misc_tests/integration.rs. They currently only run on Windows when the ODA File Converter tool has been installed from the Open Design Alliance. The tool can be found here.

DXF Reference

Since I don't want to fall afoul of Autodesk's lawyers, this repo can't include the actual DXF documentation. It can, however contain links to the official documents that I've been able to scrape together. For most scenarios the 2014 documentation should suffice, but all other versions are included here for backwards compatibility and reference between versions.

R10 (non-Autodesk source)

R11 (differences between R10 and R11)

R12 (non-Autodesk source)

R13 (self-extracting 16-bit executable)

R14

2000

2002

2004

2005

2006

2007 (Autodesk's link erroneously points to the R2008 documentation)

2008

2009

2010

2011

2012

2013

2014

2018

Many of these links were compiled from the archive.org May 9, 2013 snapshot of http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=12272454&linkID=10809853

The R2018 spec can be downloaded for offline use via the command:

wget -r -k -L -e robots=off http://help.autodesk.com/cloudhelp/2018/ENU/AutoCAD-DXF/files/GUID-235B22E0-A567-4CF6-92D3-38A2306D73F3.htm

and a simple launch page can be added via:

echo "<html><meta http-equiv='refresh' content='0; url=files/GUID-235B22E0-A567-4CF6-92D3-38A2306D73F3.htm' /></html>" > help.autodesk.com/cloudhelp/2018/ENU/AutoCAD-DXF/index.html

Dependencies

~8.5MB
~216K SLoC