meshlab - MeshLabServer - 简化:Quadric Edge Collapse Decimation (WITH TEXTURE) 失败
问题描述
我测试了一些抽取/简化工具,以减少许多以编程方式表示 3D 模型的 OBJ 文件的三角形数量。
我对 MeshLab 中的“简化:二次边折叠抽取(带纹理)”功能有疑问。
当我运行该功能时,我收到消息: 过滤失败消息
我找到了一个使用 IDE 的解决方法,我应用功能 Filters / Texture / Converts PerVertex UV into PerWedge UV,然后应用简化过滤器......但是在 MeshLabXML api 中我找不到过滤器来转换 UV 纹理坐标.. .
有人遇到过问题吗?并解决了吗?
解决方案
您有两种选择:
首先需要两个步骤:
- 使用命令将网格转换为每个楔形纹理
meshlabserver -i inputMesh.obj -o tmpMesh.obj -m wt
- 应用您的其他过滤器使用
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
推荐阅读
- vbscript - 有没有办法告诉这个脚本不要在下一个行项目中包含标题?
- docker - 如何在 docker-compose 中使用正则表达式停止容器组
- react-native - React Native:应用程序卡在使用时刻计算简单的日期循环
- node.js - docker-run 中的 49160 端口是什么?
- python - 将复杂的 Json 转换为 CSV
- azure - Azure 数据工厂中的该错误是什么意思?
- javascript - 如何检查两个对象在 JavaScript 中是否有很少的匹配数据
- javascript - Javascript 检查 unicode 字符串中的整个单词
- jpa - JPA 标准属性:JPA 提供者如何在不知道数据库系统密码的情况下创建模式?
- javascript - 可以指定溢出内容的显示位置吗?