在下面我得到了给定dxf中的圆圈和线条。我想要点数。我尝试了一些我从dxfGrabber模块的文档中无法理解的东西。任何人都可以帮忙。
import dxfgrabber
import matplotlib.pyplot as p
dxf=dxfgrabber.readfile("3.dxf")
#version=dxf.header["$ACADVER"]
output=[entity for entity in dxf.entities if entity.layer =='0']
q=[]
for line in output:
q.append(line)
w=[]
i=0
l=[]
c=[]
lines = [entity for entity in output if entity.dxftype == 'LWPOLYLINE']
circles= [entity for entity in output if entity.dxftype == 'CIRCLE']
for line in lines:
l.append(line)
for part in circles:
c.append(part)
references = [entity for entity in dxf.entities if entity.dxftype == '
test= dxf.blocks
points=[]
points=
答案 0 :(得分:0)
收集所有圈子的所有中心点:
center_points = [如果entity.dxftype ==' CIRCLE']
结果:center_points是(x,y,z)元组的列表。
收集所有LWPOLYLINES的顶点:
list_of_vertices = [如果entity.dxftype ==' LWPOLYLINE']
结果:list_of_vertices是顶点列表的列表,每个顶点是(x,y)元组。