简体   繁体   English

从点云绘制3D三角形网格

[英]Plotting a 3d triangular mesh from point cloud

I have this object/point cloud,rendered with pyopengl and pygame. 我有这个用pyopengl和pygame渲染的对象/点云。

在此处输入图片说明

My object is a numpy array of the co-ordinates of the point. 我的对象是该点的坐标的numpy数组。 I wish to generate a 3d triangular mesh of this object, also it would be nice if you could decrease the number of triangles. 我希望生成此对象的3d三角形网格,如果您可以减少三角形的数量,那也很好。

I have tried scipy.spatial.Delaunay and it doesnt generate triangles for 3d objects. 我尝试了scipy.spatial.Delaunay,它不会为3d对象生成三角形。

Dual Contouring would probably work well here, it's an algorithm that takes voxelized data and turns it into a mesh. Dual Contouring在这里可能会很好地工作,这是一种将体素化数据转换为网格的算法。 I don't understand it trivially enough to outline it here, but basically you'd take your array of points and place them into a 3D grid array where if that grid cell contains a point it's set to equal 1 (full), and if it doesn't it is set to 0 (empty), you would then run the DC algorithm on this grid and it would output a mesh. 我不太了解它,在这里概述它,但基本上,您需要将点数组放入3D网格数组中,如果该网格单元格包含一个点,则将其设置为等于1(满),如果如果不是,则将其设置为0(空),然后在该网格上运行DC算法,然后将输出网格。 The nice thing about this algorithm is it supports internal cavities and concave shapes. 这个算法的优点是它支持内部空腔和凹形。

Here's some links I found that may help you if you decide to use DC: 如果您决定使用DC,以下是我发现的一些链接可能会对您有所帮助:

Basic Dual Contouring Theory http://ngildea.blogspot.com/2014/11/implementing-dual-contouring.html 基本双重轮廓理论 http://ngildea.blogspot.com/2014/11/implementing-dual-contouring.html

This is the github repo to the source I used when I implemented this algorithm in Unity3D: https://github.com/nickgildea/DualContouringSample 这是我在Unity3D中实现此算法时使用的源的github存储库: https : //github.com/nickgildea/DualContouringSample

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM