MeshLabServer语言 - 简化:二次边崩溃抽取(带纹理)失败



>我测试了一些抽取/简化工具,以减少以编程方式表示3D模型的许多OBJ文件的三角形数量。

我对 MeshLab 中的函数"简化:二次边缘崩溃抽取(带纹理("有问题。

当我运行函数时,我收到消息: 筛选器失败消息

我找到了 IDE 的解决方法,我应用了过滤器/纹理/将 PerVertex UV 转换为 PerWedge UV 的功能,然后应用简化过滤器...... 但是在 MeshLabXML api 中,我找不到用于转换 UV 纹理坐标的过滤器......

有人遇到过这个问题吗?并解决了?

您有两种选择:

首先需要两个步骤:

  1. 使用命令将网格转换为每楔形纹理meshlabserver -i inputMesh.obj -o tmpMesh.obj -m wt
  2. 使用meshlabserver -i tmpMesh.obj -o outputMesh.obj -m wt -s myScript.mlx应用其他过滤器

第二种选择是在调用 mlx 脚本之前调用过滤器Convert PerVertex UV into PerWedge UV,只需一步即可完成所有操作Simplification: Quadric Edge ...。另外,我建议仅仅出于理智而打电话给Remove Unreferenced Vertices

尝试将此脚本保存到名为textureSimplify.mlx的文件中

<!DOCTYPE FilterScript>
<FilterScript>
<filter name="Remove Unreferenced Vertices"/>
<filter name="Convert PerVertex UV into PerWedge UV"/>
<filter name="Simplification: Quadric Edge Collapse Decimation (with texture)">
<Param value="3000" name="TargetFaceNum" description="Target number of faces" isxmlparam="0" tooltip="" type="RichInt"/>
<Param value="0" name="TargetPerc" description="Percentage reduction (0..1)" isxmlparam="0" tooltip="" type="RichFloat"/>
<Param value="0.3" name="QualityThr" description="Quality threshold" isxmlparam="0" tooltip="" type="RichFloat"/>
<Param value="1" name="Extratcoordw" description="Texture Weight" isxmlparam="0" tooltip="" type="RichFloat"/>
<Param value="false" name="PreserveBoundary" description="Preserve Boundary of the mesh" isxmlparam="0" tooltip="" type="RichBool"/>
<Param value="1" name="BoundaryWeight" description="Boundary Preserving Weight" isxmlparam="0" tooltip="" type="RichFloat"/>
<Param value="true" name="OptimalPlacement" description="Optimal position of simplified vertices" isxmlparam="0" tooltip="" type="RichBool"/>
<Param value="true" name="PreserveNormal" description="Preserve Normal" isxmlparam="0" tooltip="" type="RichBool"/>
<Param value="true" name="PlanarQuadric" description="Planar Simplification" isxmlparam="0" tooltip="" type="RichBool"/>
<Param value="false" name="Selected" description="Simplify only selected faces" isxmlparam="0" tooltip="" type="RichBool"/>
</filter>
</FilterScript>

编辑行<Param value="3000" name="TargetFaceNum",将值 3000 更改为所需的面数,然后使用以下命令执行脚本:

> meshlabserver -i inputMesh.obj -o outputMesh.obj -m wt -s textureSimplify.mlx

自 Meshlab 2020.12 以来,meshlabserver已被 PyMeshLab 取代。

二次边坍缩记录在这里。

最新更新