A tool for reading dxf files and parsing all primitives by layer classification
Project description
dxfgeometry
dxfgeometry is a Python library for converting graphic data from .dxf CAD files into standard geometric data structures (such as polygons, lines, circles, etc.).
It traverses all layers in a CAD file and returns the results organized by "File → Layers → Data".
Features
- Parse DXF files and extract geometric primitives
- Layer-based organization of geometric data
- Convert CAD entities to Shapely geometries
- Export all geometric elements to JSON format
- Support for various primitive types (polygons, lines, circles, arcs, etc.)
- Reload previously saved JSON files for further processing
- Designed for architectural and BIM applications
Installation
pip install dxfgeometry
Quick Start
from dxfgeometry.parser import read_dxf_to_geometry
# Read DXF file
result = read_dxf_to_geometry('your_file.dxf')
# Access data by layer
for layer_name, layer_data in result.get_layers():
print(f"Layer: {layer_name}")
print(f"Geometric set: {layer_data}")
Requirements
- Python >= 3.10
- ezdxf >= 1.2.0
- shapely >= 2.0.4
Examples
See the examples/ directory for more usage examples.
License
MIT License - see LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dxfgeometry-0.1.3.tar.gz.
File metadata
- Download URL: dxfgeometry-0.1.3.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cd00cbee081a60c25d02bf13f4947ee4a8d4cd92960fb069326b786c485c8db
|
|
| MD5 |
b76b79c44eff6a7242712767c570aaa0
|
|
| BLAKE2b-256 |
1d499cb3d3f185296fb7aa0fbe85c21257ab0e45f6fa6a59479af120e8bfa3ab
|
File details
Details for the file dxfgeometry-0.1.3-py3-none-any.whl.
File metadata
- Download URL: dxfgeometry-0.1.3-py3-none-any.whl
- Upload date:
- Size: 36.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d15cad83303d06fd91a85abec219ceb50b6963ac8cbd60fc6ef45f8e25b16e5
|
|
| MD5 |
253638e66d2a8d838ec5534eeeeafed8
|
|
| BLAKE2b-256 |
96cb9a5f2d35fc1bf8ea2d5cf00bfdcaea189e43a1ee1818bf9a573d0a5ee3ac
|