Pythonic IGES阅读器

pyiges的Python项目详细描述


Python IGES reader具有读取IGES文件和 将某些实体转换为pyvistavtk网格。在

此模块可以读入并执行所有实体和 可以对 以下实体:

  • 顶点列表(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

线路

https://github.com/pyvista/pyiges/raw/master/docs/images/impeller_lines.png

表面

https://github.com/pyvista/pyiges/raw/master/docs/images/impeller_surf.png

致谢

样品叶轮取自http://3dgallery.gks.com/2013/impeller/igs.php

实质性代码是从https://github.com/cfinch/IGES-File-Reader获得的或受其启发的

IGES参考定义来自Eclipse IGES Wiki

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java从guiceModule访问dropwizard捆绑包实例   java无法调用控制器方法,使用SpringMVC调用ajax   编译器错误此代码如何工作是一个基本的Java问题   java我需要从另一个控制器类(javafx和SceneBuilder)访问并清除窗格   java编写mongoDB语法   java二维矩形数组中所有元素的和   在Java中,如果类型转换双精度值足够大,则返回一个错误   java从jcombo框中获取数据并将其转换为float   读取带有空行的int文件并保存到JAVA数组中   java自填充缓存现有缓存问题(Spring 4,EhCache 2.10.3)   java有没有更快的方法来计算子矩阵的和?   背景为java指南,请设计   Camel-Spring测试中的java生产者模板显示NullPointerException   爪哇常春藤。未添加xml依赖项   JAVA While loop last else if语句不起作用   java Apache Thrift:抛出由方法中执行的代码引发的异常   多线程JAVA销毁JavaVM线程高CPU   java ArrayList<class>swap方法