10-08-2017 10:51 AM
hello
i know that LabVIEW allows to import 3D file formats such as VRML, STL and ASE, but no .obj file format , so how can I extract the vertices from these file format like stl for example. I need to use an array that contain cloud of vertices (x, y,z) in my vi . Is there any method or vi to import vertices of an object to LabVIEW as arrays ???
I do not want to use Haro3D library because it is a trial version
please help.
Solved! Go to Solution.
10-08-2017 11:24 AM
If you know the file structure, you can read any data into an array.
How does the file look like? (delimited text file? Binary? etc.). Do you have documentation?
10-08-2017 11:46 AM
The .obj file format is open, and text based:
https://en.m.wikipedia.org/wiki/Wavefront_.obj_file
So in LabVIEW, you can open the file, and simply read text from it. To get all vertices coordinates, parse all lines that start with v.
10-08-2017 02:37 PM - edited 10-08-2017 02:56 PM
I know that the obj file is text file, but the question is how to import these vertices ?? a 3D object has thousand of vertices and i need to used this vertices as array in my project.
i found here the same wondering https://forums.ni.com/t5/LabVIEW/VRML-Vertices-from-LabVIEW-3D-SceneObject/td-p/887733
i could extract the vertices by structure with property node, but this vi is not work properly , error 1 occurred on execution !
any help??
10-08-2017 03:00 PM
@ssara wrote:
I know that the obj file is text file, but the question is how to import this vertices ?? a 3D object has thousand of vertices and i need to used this vertices as array in my project.
From the text file read each line. If it starts with "v ", read the numbers. Do that thousand times, and out have an array of thousand vertices... Of course, this will only give you the coordinates. The file has another section that stores the polygons, using indices to those vertices. But since you're asking explicitly for reading the vertices...
ssara wrote:i found here the same wondering https://forums.ni.com/t5/LabVIEW/VRML-Vertices-from-LabVIEW-3D-SceneObject/td-p/887733
The link is not working for me...
i could extract the vertices by structure with property node, but this vi is not work property , error 1 occurred on execution !
any help??
That doesn't make any sense to me. Extract vertices by structure with property node? From a text file?
Could you post a typical obj file? I know from the past good examples are hard to find.
10-09-2017 08:33 AM
LabVIEW allows to import 3D file formats such as VRML, STL and ASE, not obj file.
i solved this problem partly, in the vi attached file.
the result is a cluster of 1 D array of 3 D point , the question now how can i convert the cluster to array?? i used (u n bundle) and (cluster to array) tools but the terminals are with different types. can you help me please
10-09-2017 08:40 AM
sorry i forgot to attach the airplane.ASE file. it must be in the same directory of untitled 3.
10-09-2017 08:49 AM
Still no ASE file?
Not sure what this has to do with .obj files. Did you change your mind?
The array of cluster can be converted to an array in several ways. It obviously depends on how the array should be organised. Probably:
1) in a for loop,
2) unbundle and,
3) build an array,
4) set the auto indexing to concatenate.
You should then have an array with X0,Y0,Z0,X1,Y1,Z1,...
Or,
1) in a for loop,
2) unbundle and,
3) build 3 arrays X, Y, Z
4) use interleave array to interleave the X, Y, Z values OR build array if you want a 2D arrays, or concatenate if you want all X's then Y's then Z's.
10-09-2017 12:14 PM
thank you wiebe@CARYA I did it
02-20-2021 11:05 AM
Hi ssara,
How to read file obj?
I could do with some help,please