# how to make wireframe from xyz

Thu, 06/18/2020 - 07:49 am

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.

-Matthew

Hi - take a look at A.G.'s example in this thread:

https://www.wavemetrics.com/forum/general/3d-volume-calculation

June 18, 2020 at 09:56 am - Permalink

In reply to Hi - take a look at A.G.'s… 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.

June 18, 2020 at 11:51 am - Permalink

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.

June 18, 2020 at 12:41 pm - Permalink

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.

A.G.

June 18, 2020 at 03:35 pm - Permalink