标签: trimesh

如何将 3D 点云 (.ply) 转换为网格(具有面和顶点)?

我有一个包含 100 万个点的 3-D 点云文件,我需要将其转换为 trimesh 中的网格文件。这里的最终目标是获取一个点云并确定该点云是凸面还是凹面(trimesh 允许我在将云转换为网格后这样做)。我愿意接受其他图书馆来解决这个问题。

我已经尝试使用 scipy 进行 Delaunay 三角剖分,但似乎无法将我的点云转换为正确的格式,以便trimesh 可以读取它。

import open3d as o3d
import numpy as np
import trimesh
from scipy.spatial import Delaunay


pointcloud = o3d.io.read_triangle_mesh("pointcloud.ply")
points = np.array(pointcloud.points)
triangle_mesh = Delaunay(points)
#  How do i include triangle_mesh from Delaunay triangulation into processing the mesh file?
mesh = trimesh.load("pointcloud.ply")
print(trimesh.convex.is_convex(mesh))
Run Code Online (Sandbox Code Playgroud)

错误

geometry::TriangleMesh appears to be a geometry::PointCloud (only contains vertices, but no triangles).
geometry::TriangleMesh with 1390073 points and 0 triangles.
expected = (faces.shape[0], faces.shape[1] * …
Run Code Online (Sandbox Code Playgroud)

python mesh delaunay point-clouds trimesh

6
推荐指数
1
解决办法
2万
查看次数

GLException: No GL context; create a Window first

I am trying to read and display a .ply file with Trimesh in Python. I have installed Trimesh using pip install trimesh as well as pyglet to display the file.

import trimesh
mesh = trimesh.load("file.ply")
mesh.show()
Run Code Online (Sandbox Code Playgroud)

However, I keep getting the following error when running this code:

GLException: No GL context; create a Window first
Run Code Online (Sandbox Code Playgroud)

Could someone please help me resolve this?

python pyglet trimesh

5
推荐指数
0
解决办法
1133
查看次数

在 Trimesh 中旋转网格

我通过 TriMesh 将网格几何加载到 Python 中。我想要一个自由浮动的相机,但我想通过旋转网格来更改(修剪网格场景的)默认视图。如何在不创建固定相机的情况下旋转网格或设置相机的默认视图?

python geometry transform rotation trimesh

5
推荐指数
0
解决办法
1103
查看次数

在 Python 中使用 pyassimp 库

那里有太多信息,我尝试了其中的大部分。但是,我无法让 assimp 在 Python 中工作。这是我得到的错误:

  File "C:\Users\X\AppData\Local\Programs\Python\Python35\lib\site-packages\pyassimp\helper.py", line 234, in search_library
    raise AssimpError("assimp library not found")
pyassimp.errors.AssimpError: assimp library not found
Run Code Online (Sandbox Code Playgroud)

我知道我必须在当前工作目录中包含 dll 文件。我在互联网上找到了一个 Assimp64.dll 文件并将其复制到我的工作目录中。但这没有用。还尝试了这个建议: https://github.com/assimp/assimp/issues/1438 不过,它不起作用..我还尝试使用 cmake 编译 assimp.dll,但我无法做到这一点。我该如何解决我的问题?有任何想法吗?

python assimp trimesh

3
推荐指数
1
解决办法
6673
查看次数

像使用 Axes3D.plot_trisurf() 一样绘制 Trimesh 对象

我有一个 Trimesh 对象,但我不知道如何绘制它。我的目标是 mplot3d 中的 Axes3D.plot_trisurf() 函数会产生类似的结果(见下文)。Trimesh 对象甚至有一个包含面的属性,但我不知道从哪里获取网格点的坐标。

感谢您的任何想法!

mplot3d 中的 trisurf 图

python 3d mplot3d trimesh

3
推荐指数
1
解决办法
3501
查看次数