LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

import vertices to LabVIEW

Solved!
Go to solution

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.

0 Kudos
Message 1 of 10
(3,725 Views)

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?

0 Kudos
Message 2 of 10
(3,705 Views)

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.

0 Kudos
Message 3 of 10
(3,698 Views)

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??    

0 Kudos
Message 4 of 10
(3,683 Views)

@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.

0 Kudos
Message 5 of 10
(3,674 Views)

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

Download All
0 Kudos
Message 6 of 10
(3,632 Views)

sorry i forgot to attach the airplane.ASE file. it must be in the same directory of untitled 3. 

0 Kudos
Message 7 of 10
(3,630 Views)
Solution
Accepted by topic author ssara

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.

0 Kudos
Message 8 of 10
(3,624 Views)

thank you  wiebe@CARYA  I did itSmiley Happy

0 Kudos
Message 9 of 10
(3,612 Views)

Hi ssara,

How to read file obj?

I could do with some help,please

0 Kudos
Message 10 of 10
(2,323 Views)