如何用pythondxfwri绘制六边形

2024-04-28 12:47:25 发布

您现在位置:Python中文网/ 问答频道 /正文

如何在python中使用dxfwrite绘制六边形(或任何四边以上的多边形)形状?提前谢谢你。在


Tags: 绘制多边形形状六边形dxfwrite
1条回答
网友
1楼 · 发布于 2024-04-28 12:47:25

使用折线图元:

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()

相关问题 更多 >