loading *.stl or *.ply 3D files

Has anyone know how to load either *.stl or *.ply data files into Igor Pro?

I have a colleague who has captured some image 3D profile data, but he doesn't have a great way to analyze that data. With all of AGs imaging capabilities, I can't imagine that I wouldn't be able to automate the image analysis to rapidly get at the information they are looking for.

Unfortunately, I don't have much experience in dealing with binary files.

Thanks,

Forrest

Thanks, Andy,

Yeah, I've been looking into that. I loaded the data as general text and have figured out the number of bytes to skip, seemingly. Turns out it was 206 after I took into account the bytes used to autoname my column and then for CRs or LFs. Using the binary file load with low byte, dropping out the first 206 bytes and finally separating the data into 6 columns by 24474 rows (using the element vertex of 14683 + 1), I'm loading in values that look like real world numbers. So that's some progress.

The arrays still don't look right. Based on the header information, I thought I should be getting 6 columns with 2 sets of values, vertices and maybe some sort of delta value. However, the 6 columns look like all the data is "mixed".

 

My header information.

format binary_little_endian 1.0
comment created by revopoint 3D
element vertex 146843
property float x
property float y
property float z
property float nx
property float ny
property float nz
end_header
 

I was expecting the columns to look like this:

x y z nx ny nz

 

What I think I see is:

 x    y   z   x   y  z

nx ny nz nx ny nz

 

Thanks for your help.

Forrest

 

I don't think so. I think that's another set of data (PLY - Polygon File Format (paulbourke.net)). I was expecting 6 columns with ~147k rows, but instead, the data looks more "consistent" at ~147k columns and 6 rows. In that situation, I can easily separate out 2 sets of data, based on the magnitudes. But I have no idea if this is even correct. At some point, this data should be a 3D image.

Hello Forrest,

I confess that I have no experience reading either *.stl or *.ply in Igor.  Both file formats can contain data that will not be easy to interpret as image data for Igor, but if you have prior knowledge that they contain only one set of vertices of some image, it may be possible to extract from the *.stl file using python (e.g., https://pypi.org/project/numpy-stl/). 

AG