首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >导出网格无法构建可读的ply文件

导出网格无法构建可读的ply文件
EN

Stack Overflow用户
提问于 2021-01-22 21:57:03
回答 1查看 168关注 0票数 0

我写了一个小脚本,它的任务是加载一个网格( ply ),然后应用一些过滤器,最后将整个东西导出为ply。

到目前为止一切顺利。但是生成的ply文件是不可读的。如果我尝试在MeshLab中打开它,它会显示:"Face with more 3 vertices“

以下是与pymeshlab相关的代码部分(已清理):

代码语言:javascript
复制
import pymeshlab as ml
ms = ml.MeshSet()
ms.load_new_mesh(path + mesh_name)
ms.apply_filter('convert_pervertex_uv_into_perwedge_uv')
ms.apply_filter('transfer_color_texture_to_vertex')
ms.save_current_mesh(path + 'AutomatedGeneration3.ply')

我错过了什么吗?在执行此脚本时,实际上没有错误消息。我还尝试为保存过滤器使用一些参数,但这并没有改变任何东西。

我怎么才能让它变得正确呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-01-25 19:51:53

这似乎是该方法内部使用的.ply导出器中的错误ms.save_current_mesh()..。

该方法试图保存存储在网格中的所有信息,在这一点上是纹理_每

_顶点,纹理_每_楔形和颜色_每_顶点,那里出了点问题。

我已经通过禁用保存纹理实现了一种变通方法_每_楔形(仅在以下情况下才需要transfer_color_texture_to_vertex过滤器。

代码语言:javascript
复制
import pymeshlab as ml
ms = ml.MeshSet()
#Load a mesh with texture per wedge
ms.load_new_mesh('input_pervertex_uv.ply')
m = ms.current_mesh()

print("Input mesh has", m.vertex_number(), 'vertex and', m.face_number(), 'faces' )

ms.apply_filter('convert_pervertex_uv_into_perwedge_uv')
ms.apply_filter('transfer_color_texture_to_vertex')

#Export mesh with color_per_vertex but without texture
ms.save_current_mesh('output.ply',save_wedge_texcoord=False,save_vertex_coord=False )

的有效参数列表save_current_mesh可以在这里阅读https://pymeshlab.readthedocs.io/en/latest/filter\_list.html#save-parameters

请注意save_vertex_coord指的是每顶点纹理坐标!!!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65846551

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档