Metadata-Version: 2.4
Name: fastdxf
Version: 0.1.0rc1
Requires-Dist: ezdxf>=1.4.5,<2
Requires-Dist: numpy>=1.23.5
Summary: An ezdxf-compatible Python interface with Rust-accelerated geometry extraction
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# fastdxf

Use ezdxf's document API and extract modelspace line segments into NumPy arrays from the same Python package.

```python
import fastdxf as dxf
from ezdxf.math import Vec3

doc = dxf.readfile("drawing.dxf")
doc.modelspace().add_line(Vec3(0, 0), Vec3(3, 4))
doc.saveas("edited.dxf")

segments = dxf.read_lines("edited.dxf")
starts, ends = segments[:, 0], segments[:, 1]
```

`readfile`, `read`, `new`, and the other public top-level ezdxf names come from the installed ezdxf package. These functions retain ezdxf's signatures, document and entity classes, and exceptions. Use the usual `ezdxf.*` imports for submodules.

`read_lines(path)` returns a read-only, C-contiguous `float64` array with shape `(N, 2, 3)`. Each row holds the WCS start and end of a LINE directly in modelspace, in layout order. An empty selection has shape `(0, 2, 3)`. The native reader targets ASCII R12, R2007, R2010, R2013 and R2018. Binary DXF, other versions, and layouts the native reader cannot resolve use ezdxf's reader. Use `readfile` for editing or inspecting the complete document.

## Install the release candidate

The 0.1.0rc1 wheels target CPython 3.12 on Linux x86-64 (glibc 2.28+), Windows x86-64 and macOS on Apple silicon. Download the artifact for your platform from a successful candidate workflow run, extract the wheel and pass its path to pip. [Candidate builds](https://github.com/monozukuri-ai/fastdxf/actions/workflows/release.yml)

```bash
python -m pip install /path/to/fastdxf-0.1.0rc1-cp312-cp312-win_amd64.whl
```

With a Rust toolchain and Python 3.11+ installed, you can also build from the source archive with `python -m pip install fastdxf-0.1.0rc1.tar.gz`, or run `python -m pip install .` from a checkout.

Maintainers can rehearse a release or publish a tagged build. [Release instructions](https://github.com/monozukuri-ai/fastdxf/blob/main/docs/releasing.md)

## LINE extraction performance

| Mixed drawing | Direct modelspace LINEs | fastdxf | Faster of the two iterdxf readers | Speedup |
|---|---:|---:|---:|---:|
| R2010, 7.54 MB | 11,556 | 45.31 ms | 888.59 ms | 19.61× |
| R2018, 2.17 MB | 2,039 | 8.68 ms | 189.17 ms | 21.80× |

These are the PR3 release-wheel measurements on Linux x86-64, Core i9-13900H, CPython 3.12.3 and ezdxf 1.4.5 with C extensions. Times cover opening the file through returning the NumPy array, using one warm-up and the median of five rotated trials. The indexed iterdxf measurement includes building the index. All methods matched the ordered endpoint bits from ezdxf. [Benchmark details and reproduction](https://github.com/monozukuri-ai/fastdxf/blob/a8898803f6f4635f45ca94247818170bd764fffa/docs/wheel-benchmark.ja.md)

