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第三方库


热门话题
JavaGWT:何时使用Lazydemelement?   Java中跟踪消失线程的多线程处理   java Springboot未能配置数据源:“url”,但我没有使用数据库   java为按钮生成随机位置   math Java:包含二项式系数计算的表达式   java通过AsyncTask传递参数   从路径错误创建java文件   高流量网站的性能播放框架、Java、Apache、PostgreSQL、JPA和Hibernate   java将4D矢量转换为长矢量   arraylist Java循环在没有任何错误的情况下终止   java正在制作一个计算器应用程序,希望在第二个片段中更新历史,但无法完成   java将信息从IntentService发送到Activity   java如何在游戏中插入大量实体!工作   javascript如何在ScriptEngineforJava中从数学中获得准确的结果?