gpt4 book ai didi

python - 如何使用python dxfwrite绘制六边形形状

转载 作者:太空宇宙 更新时间:2023-11-03 15:14:19 25 4
gpt4 key购买 nike

如何使用 dxfwrite 在 python 中绘制六边形(或任何具有 4 条以上边的多边形)形状?预先感谢您。

最佳答案

使用 POLYLINE 实体:

http://pythonhosted.org/dxfwrite/entities/polyline.html

from dxfwrite import DXFEngine as dxf

dwg = dxf.drawing('polyline.dxf')

points = [(0, 3), (2, 0), (5, 0), (7, 3), (5, 6), (2, 6)]
polyline = dxf.polyline(points)
polyline.close()
dwg.add(polyline)

dwg.save()

关于python - 如何使用python dxfwrite绘制六边形形状,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43996573/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com