简体   繁体   中英

Plotting a 3d triangular mesh from point cloud

I have this object/point cloud,rendered with pyopengl and pygame.

在此处输入图片说明

My object is a numpy array of the co-ordinates of the point. I wish to generate a 3d triangular mesh of this object, also it would be nice if you could decrease the number of triangles.

I have tried scipy.spatial.Delaunay and it doesnt generate triangles for 3d objects.

Dual Contouring would probably work well here, it's an algorithm that takes voxelized data and turns it into a mesh. 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. 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:

Basic Dual Contouring Theory 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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