Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 716 Bytes

README.md

File metadata and controls

25 lines (16 loc) · 716 Bytes

EZDXF to Shapely Converter

Convert geometric entities loaded vom DXF files using ezdxf to shapely geometry objects.

First use ezdxf to load the DXF entities from file and filter them using query or similar.

import ezdxf

dxf_doc = ezdxf.readfile("your_file.dxf")
entities = dxf_doc.modelspace().query("*[layer==0]")

Then use ezdxf-shapely to convert the entities and refine the results.

import ezdxf_shapely

geoms = ezdxf_shapely.convert_all(entities)
polygons = ezdxf_shapely.polygonize(geoms) # optionally merge lines to polygons

License

Licensed under the terms of the MIT License