在python中使用meshlab函数

在python中使用meshlab函数,python,meshlab,trimesh,Python,Meshlab,Trimesh,我是3D新手,我有一个点云,我想使用python库形成一个网格。但我可以使用meshlab函数,这些函数是“过滤器-->点集-->计算点集法线”和“过滤器-->重划分、简化和重建-->曲面重建::泊松” 是否有任何方法可以使用python实现上述meshlab函数,从而使其自动化 谢谢您可以对Meshlab附带的Meshlab服务器进行系统调用(它位于Meshlab安装目录中) 如果在没有参数的情况下运行meshlabserver.exe,它将显示以下手册页 用法:meshlab服务器[loga

我是3D新手,我有一个点云,我想使用python库形成一个网格。但我可以使用meshlab函数,这些函数是“过滤器-->点集-->计算点集法线”和“过滤器-->重划分、简化和重建-->曲面重建::泊松”

是否有任何方法可以使用python实现上述meshlab函数,从而使其自动化


谢谢

您可以对Meshlab附带的Meshlab服务器进行系统调用(它位于Meshlab安装目录中)

如果在没有参数的情况下运行meshlabserver.exe,它将显示以下手册页

用法:meshlab服务器[logargs][args]

其中logargs可以是:

-d filename             dump on a text file a list of all the
                        filtering functions

-l filename             log of the filters is ouput on a file
-p filename             meshlab project (.mlp) to be loaded
-w filename [-v]        output meshlab project (.mlp) to be saved.
                        If -v flag is specified a 3D model meshfile.ext
                        contained in the input project will be overwritten,
                        otherwise it will be saved in the same directory of
                        input mesh as a new file called meshfile_out.ext.
                        All the mesh attributes will be exported in the
                        saved files

-i filename             mesh that has to be loaded

-o filename [-m <opt>]  the name of the file where to write the current mesh
                        of the MeshLab document.
                        If -m is specified  the specified mesh attributes will
                        be saved in the output file. the param <opt> can be a
                        space separated list of the following attributes:
                            vc -> vertex colors,  vf -> vertex flags,
                            vq -> vertex quality, vn-> vertex normals,
                            vt -> vertex texture coords,
                            fc -> face colors,  ff -> face flags,
                            fq -> face quality, fn-> face normals,
                            wc -> wedge colors, wn-> wedge normals,
                            wt -> wedge texture coords

-s filename                 the script to be applied
其中args可以是:

-d filename             dump on a text file a list of all the
                        filtering functions

-l filename             log of the filters is ouput on a file
-p filename             meshlab project (.mlp) to be loaded
-w filename [-v]        output meshlab project (.mlp) to be saved.
                        If -v flag is specified a 3D model meshfile.ext
                        contained in the input project will be overwritten,
                        otherwise it will be saved in the same directory of
                        input mesh as a new file called meshfile_out.ext.
                        All the mesh attributes will be exported in the
                        saved files

-i filename             mesh that has to be loaded

-o filename [-m <opt>]  the name of the file where to write the current mesh
                        of the MeshLab document.
                        If -m is specified  the specified mesh attributes will
                        be saved in the output file. the param <opt> can be a
                        space separated list of the following attributes:
                            vc -> vertex colors,  vf -> vertex flags,
                            vq -> vertex quality, vn-> vertex normals,
                            vt -> vertex texture coords,
                            fc -> face colors,  ff -> face flags,
                            fq -> face quality, fn-> face normals,
                            wc -> wedge colors, wn-> wedge normals,
                            wt -> wedge texture coords

-s filename                 the script to be applied
注: 可以加载多个网格并按其列出的顺序排列 重要是因为 使用网格作为参数的过滤器将根据参数选择网格 秩序。 输出网格的格式由使用的扩展猜测。 脚本是可选的,必须采用MeshLab保存的xml格式

首先,使用Meshlab加载网格,运行要运行的过滤器,然后转到
过滤器>>显示当前过滤器脚本
并将脚本保存在某个位置,以便使用Meshlab服务器调用它

一个专业提示:如果要加载.stl文件,必须添加以下内容作为第一个过滤器:

<filter name="Merge Close Vertices">
  <Param type="RichAbsPerc" name="Threshold" description="Merging distance" value="0" tooltip="All the vertices that closer than this threshold are merged together. Use very small values, default values is 1/10000 of bounding box diagonal. " min="0" max="0"/>
</filter>