同步操作将从 yanbin-ha/ezdxf 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
A Python package to create and modify DXF drawings, independent of the DXF version. You can open/save every DXF file without losing any content (except comments), Unknown tags in the DXF file will be ignored but preserved for saving. With this behavior it is possible to open also DXF drawings that contains data from 3rd party applications.
drawing
add-on is a translation layer to send DXF data to a render backend, interfaces to
matplotlib, which can export images as png, pdf or svg,
and PyQt5 are implemented.geo
add-on to support the __geo_interface__
r12writer
add-on to write basic DXF entities direct and fast into a DXF R12 file or streamiterdxf
add-on to iterate over DXF entities of the modelspace of really big (> 5GB) DXF files which
do not fit into memoryImporter
add-on to import entities, blocks and table entries from another DXF documentdxf2code
add-on to generate Python code for DXF structures loaded from DXF
documents as starting point for parametric DXF entity creationA simple example:
import ezdxf
# Create a new DXF document.
doc = ezdxf.new(dxfversion='R2010')
# Create new table entries (layers, linetypes, text styles, ...).
doc.layers.new('TEXTLAYER', dxfattribs={'color': 2})
# DXF entities (LINE, TEXT, ...) reside in a layout (modelspace,
# paperspace layout or block definition).
msp = doc.modelspace()
# Add entities to a layout by factory methods: layout.add_...()
msp.add_line((0, 0), (10, 0), dxfattribs={'color': 7})
msp.add_text(
'Test',
dxfattribs={
'layer': 'TEXTLAYER'
}).set_pos((0, 0.2), align='CENTER')
# Save DXF document.
doc.saveas('test.dxf')
Example for the r12writer, which writes a simple DXF R12 file without in-memory structures:
from random import random
from ezdxf.addons import r12writer
MAX_X_COORD = 1000
MAX_Y_COORD = 1000
with r12writer("many_circles.dxf") as doc:
for _ in range(100000):
doc.add_circle((MAX_X_COORD*random(), MAX_Y_COORD*random()), radius=2)
The r12writer supports only the ENTITIES section of a DXF R12 drawing, no HEADER, TABLES or BLOCKS section is present, except FIXED-TABLES are written, than some additional predefined text styles and line types are available.
Basic installation by pip including the optional C-extensions from PyPI as binary wheels:
pip install ezdxf
Full installation with all dependencies (matplotlib, PyQt5) to use the drawing add-on:
pip install ezdxf[draw]
For more information about the setup & dependencies visit the documentation.
Documentation of development version at https://ezdxf.mozman.at/docs
Documentation of the latest release at https://ezdxf.readthedocs.io/
The source code of ezdxf can be found at GitHub, target your pull requests
to the master
branch:
https://github.com/mozman/ezdxf.git
Questions and feedback at GitHub Discussions:
https://github.com/mozman/ezdxf/discussions
Questions at Stack Overflow:
Post questions at stack overflow and use the tag dxf
or ezdxf
.
Issue tracker at GitHub:
http://github.com/mozman/ezdxf/issues
Please always post questions at the forum or stack overflow to make answers available to other users as well.
Feedback is greatly appreciated.
Manfred
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。