首页 > 解决方案 > MeshLabServer - 简化:Quadric Edge Collapse Decimation (WITH TEXTURE) 失败

问题描述

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

我对 MeshLab 中的“简化:二次边折叠抽取(带纹理)”功能有疑问。

当我运行该功能时,我收到消息: 过滤失败消息

我找到了一个使用 IDE 的解决方法,我应用功能 Filters / Texture / Converts PerVertex UV into PerWedge UV,然后应用简化过滤器......但是在 MeshLabXML api 中我找不到过滤器来转换 UV 纹理坐标.. .

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

标签: meshlabuv-mappingdecimation

解决方案


您有两种选择:

首先需要两个步骤:

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

Convert PerVertex UV into PerWedge UV第二种选择是通过在调用之前在 mlx 脚本中调用过滤器,一步完成所有操作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

推荐阅读