简体   繁体   中英

How to draw hexagonal shape using python dxfwrite

How to draw a hexagonal( or any polygon with more than 4 sides) shape in python using dxfwrite? Thank you in advance.

Use the POLYLINE entity:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM