2

I need to convert arbitrary triangulated 3D mesh to cloud of particles that are uniformly spaced. First thought was to try find a way to fill one 3D triangle. And then fill each triangle of mesh, removing duplicated particles on edges, but that's just hard and too much work. I was hoping for some more-math way.

Can anyone point me to an algorithm which can help me do my task correctly... well, at least approximatively?

Thanks

J.B.
  • 317
  • 4
  • 9
  • If you would be satisfied with particles that are uniformly distributed (as opposed to uniformly spaced) you could build on triangle sampling algorithms such as http://mathworld.wolfram.com/TrianglePointPicking.html. But it looks from your self-answer that you want uniformly spaced. – brainjam Mar 20 '11 at 18:26

2 Answers2

1

There are two main options:

J.B.
  • 317
  • 4
  • 9
0

You could convert the TIN to raster using a GIS package or software such as R, then retrieve one point at the center of each pixel representing the value. (Example in ArcGIS)

EDIT: If the irregular 3D mesh has multiple heights per {x, y} a similar approach would be to sample the mesh using a voxel "grid" and keep one value per voxel. GRASS GIS has the functionality to take the vertices of the TIN (3d mesh) and convert them to voxels, then back to a regular 3d cloud.

Benjamin
  • 11,560
  • 13
  • 70
  • 119
  • @J.B.: I'm suggesting that you then convert that "heightmap" back to a regular 3d mesh by extracting the value of each pixel and using it as a z value. – Benjamin Mar 14 '11 at 14:45
  • But for regular 3D mesh - one pair {x,y} can have multiple z values, thus this is not for complex 3D shapes to 3D point cloud conversion I need. Or am I missing something? – J.B. Mar 14 '11 at 14:51
  • @J.B.: I might have misinterpreted your question. I was thinking in terms of terrain surface, but it seems you are dealing with some sort of 3D object with multiple heights at the same {x,y}? If so, there might be a similar solution using voxels to sample the mesh and return a point per voxel. – Benjamin Mar 14 '11 at 15:00
  • Correct, I was thinking of arbitrary 3D mesh (concave, convex, whatever). Voxels you say... that's a nice idea, I'll check it out. – J.B. Mar 14 '11 at 15:04
  • I have just analyzed the solution. Voxelization will yield errors - particles wont be uniformly spaced. This is because distance between cube centers in the same plane is 'a', and between two diagonal neighbor cubes 'a*sqrt(3)=a*1.73', which yields great local errors (for example imagine voxelizing simple slope). – J.B. Mar 14 '11 at 20:02
  • Won't all regular 3D meshes do that? In any case, you can always reduce the voxel size to a point where this "error" is acceptable. This is no different then the 2D case. – Benjamin Mar 14 '11 at 20:08
  • Yeah I was hoping there could be other algos, not grid-based, that would be more correct. But I guess I will have to stick with voxels i.e. uniform grid. – J.B. Mar 14 '11 at 22:14