how to make wireframe from xyz

Hello.  I am having trouble, and I'm hoping for some advice.  We are working with stacks of images, and tracing objects of interest on each image, which generates a set of XYZ points (see image).  I want to convert these scatter data into a mesh (triangularized?),  so that it can be displayed nicely with 3D rendering.  I don't see an Igor routine that does this.  The ImageInterpolate Voronoi approach comes close, but if I understand right, it assumes the data are like a topo map, which this isn't.  Anyway, it is giving me a bunch of crazy triangles that connect from way up high to way down low.

Does anybody know of a good way to generate a triangular or other mesh from these data?  I can imagine constructing a triangle from two adjacent points on one trace plus the nearest point on the adjacent trace.  However, this runs into problems when you get to the top or bottom of a structure (i.e. which shouldn't connect to anything).  I would be grateful if somebody has insights into this.


XYZ scatter plot of example object

In reply to by sjr51

I would investigate the possibility of connecting neighboring x-y paths with ribbon surfaces between adjacent stacks. The problem is you would have to have matching numbers of mesh point in adjacent layers, probably requiring construction of new mesh paths, either interpolating points on the sparser path, and/or removing points on the denser path for each ribbon. The ribbons would then be separated from each other by NaN vertices.

Thanks for pointing that out, but I'm having trouble with it.  I tried Triangulate3D /out=2 on the data in that image, and it gave me a wave of zero points.  No errors, but no result.  Using /out=1 also gave nothing.  It worked fine with the example at Triangulate3D.  Perhaps it is thrown off by the large number of possible tetrahedra with volume 0 (from all the points at the same Z position).  I tried adding noise to the z points, and no difference.  I don't know how to interpret the diagnostic data from /out=4.

Triangulate3D is not an appropriate operation here because the data does not span a convex domain.  Feel free to contact us directly to discuss the details of this application.