Python绑定为AdMeET、STL映射库

admesh的Python项目详细描述


https://img.shields.io/pypi/v/admesh.svghttps://img.shields.io/travis/admesh/python-admesh/master.svghttps://img.shields.io/github/license/admesh/python-admesh.svg?style=flathttps://img.shields.io/pypi/pyversions/admesh.svghttps://img.shields.io/pypi/implementation/admesh.svg

此模块为ADMesh库提供绑定。它允许您以二进制或ascii stl格式操作三维模型,并在必要时部分修复它们。

安装

有适用于Linux和MacOS X的控制盘。您只需执行以下操作:

pip install admesh

如果你有一个不受上述支持的平台, 您需要安装cADMesh库。

此版本是为admesh 0.98.x设计的。请按照其中的说明进行操作。然后您可以像往常一样用one安装它,如下所示:

./setup.py install
python3 setup.py install # for Python 3
pip install admesh # install directly from PyPI

如果admesh库位于非标准位置,则必须告诉编译器和链接器查找位置:

LDFLAGS='-L/path/to/library'CFLAGS='-I/path/to/header' ./setup.py install

用法

使用提供的Stl类。

importadmesh# load an STL filestl=admesh.Stl('file.stl')# observe the available methodshelp(stl)# read the statsstl.stats# see how many facets are therelen(stl)# walk the facetsforfacetinstl:# get the normalfacet['normal']# walk the verticesforvertexinfacet['vertex']:# read the coordinatesvertex['x']vertex['y']vertex['z']# add another set of facets# every facet is a tuple (vertices, normal) or a dictstl.add_facets([(((0,0,0),(0,1,0),(0,0,1)),(1,0,0)),{'vertex':[{'x':0,'y':0,'z':0},{'x':1,'y':0,'z':0},{'x':0,'y':0,'z':1}],'normal':{'x':0,'y':1,'z':0}},])

请注意,所有c admesh函数都以stl_前缀开头,而此模块的python方法不以前缀开头。还要注意,并不是所有的c admesh函数都提供了,因为有些函数需要更复杂的方法,因此不值得考虑。如果缺少某些函数,请创建new issue

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

推荐PyPI第三方库


热门话题
java线程执行器服务   aspose如何通过java获得单词bookmark之前的所有文本内容?   一对一映射的java Hibernate合并问题   java SOAP XSD根元素问题   java如何保护我的Spring启动API   java使用GeoJson向google地图添加标记   java安卓:在SQLite中没有这样的列   java STS 2.8.0 StartExplorer/Legacy插件安装问题   java如何以编程方式获取AppBar高度?   在Java中将BigDecimal添加到BigDecimal   java不支持ntdll。dll是windows xp和windows vista的标准配置吗?   内容类型为application/xwwwformurlencoded的java Http Put请求在Spring中不起作用   java在数组中计算工资并返回答案   java数字/货币格式   elasticsearch java api中的弹性搜索查询