0

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

enter image description here

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.

rjpj1998
  • 297
  • 1
  • 6
  • 23

1 Answers1

1

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

Mykel Stone
  • 311
  • 1
  • 2
  • 9
  • Thanks for answering. Do I HAVE to implement it myself or can i find a pre-made module or a function somewhere? – rjpj1998 Jul 11 '17 at 17:23