Pythonic IGES阅读器
pyiges的Python项目详细描述
Python IGES reader具有读取IGES文件和 将某些实体转换为pyvista或vtk网格。在
此模块可以读入并执行所有实体和 可以对 以下实体:
- 顶点列表(502型表单1)
- 边缘列表
- 循环(用于指定BREP几何图形的有界面
- 脸
- 圆弧
- 有理B样条曲面
- 有理B样条曲线
- 圆锥弧(104型)
- 线路
- 点
安装
使用pip安装,使用:
pip install pyiges
否则,如果您想要最新版本,请随意克隆 此回购和安装:
^{pr2}$使用
pyiges模块可以将许多实体作为原始文本读取,但只能 NURBS曲面和BSPLINE可以转换为pyvista网格。在
importpyigesfrompyigesimportexamples# load an example impelleriges=pyiges.read(examples.impeller)# print an invidiual entity (boring)print(iges[0])# convert all lines to a vtk mesh and plot itlines=iges.to_vtk(bsplines=True,surfaces=False,merge=True)lines.plot(color='w',line_width=2)# convert all surfaces to a vtk mesh and plot itmesh=iges.to_vtk(bsplines=False,surfaces=True,merge=True,delta=0.05)mesh.plot(color='w',smooth_shading=True)# control resolution of the mesh by changing "delta"# save this surface to filemesh.save('mesh.ply')# as plymesh.save('mesh.stl')# as stlmesh.save('mesh.vtk')# as vtk
线路
表面
致谢
样品叶轮取自http://3dgallery.gks.com/2013/impeller/igs.php
实质性代码是从https://github.com/cfinch/IGES-File-Reader获得的或受其启发的
IGES参考定义来自Eclipse IGES Wiki
- 项目
标签: