Skip to main content

A tool for reading dxf files and parsing all primitives by layer classification

Project description

dxfgeometry

PyPI - Version PyPI - Python Version

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

dxfgeometry-0.1.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dxfgeometry-0.1.1-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file dxfgeometry-0.1.1.tar.gz.

File metadata

  • Download URL: dxfgeometry-0.1.1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.17

File hashes

Hashes for dxfgeometry-0.1.1.tar.gz
Algorithm Hash digest
SHA256 948d690fe80facc24d7d105c504d7b53b24a3255f8ad6cf13723a3d6ba82f903
MD5 1acdfe5bd259c7aca45cc214bb378c18
BLAKE2b-256 056840773978a93cc131683a60bd55b97918bbc9676ca10810f0a413b6bdaf2d

See more details on using hashes here.

File details

Details for the file dxfgeometry-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dxfgeometry-0.1.1-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

Hashes for dxfgeometry-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 095a49c3ab70b0908a988dcf970263418c271ee7d70b2682a08e2368d9c33531
MD5 c75ea36e90d257e8df603fca35708dd5
BLAKE2b-256 c865ed96656be661af17485a50c553e7565cba24968b4dc02fc0400096ca90ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page