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.2.tar.gz (22.2 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.2-py3-none-any.whl (36.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dxfgeometry-0.1.2.tar.gz
  • Upload date:
  • Size: 22.2 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.2.tar.gz
Algorithm Hash digest
SHA256 59c59529a0b07e63e35dd90562d4cf3183e5f1b0551148943056d0a4d4b3914d
MD5 e47e4928678b2d8134bcb6de8a086f11
BLAKE2b-256 25326d331898e5e1f2c77fd9fe8612bd97b51fe8bdc7c96af0417b865d5ee8e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dxfgeometry-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 36.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 db1403d5d6330f3e60bb7177c230b68a07a4b1bb4a9764549850c53a332b4a39
MD5 b8af02dfda29bdab61b3f3d31485fa9c
BLAKE2b-256 c452234be3a84b6351bf89ec87fdefc4603a53945577b8c782f728e2a4b53af8

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