Showing results for 
Search instead for 
Did you mean: 

Problem to import stl model: white shape!

Regarding calculation of normal from the cross product of edge vectors, there's usually a convention to the 'winding' or order in which the edge vectors are specified, so that if you use the same two consecutively ordered edge vectors for each tri, your cross products (i.e. calculated normals) will all point in the same sense- all in or all out of the model surface.

Message 11 of 15

Ok, but what I have to do if LV accept only three model format ( stl, vrml or ase ) and I can found head models only in stl format on internet? vrml and ase are very rare!
At this point my question is: how I can import correctly a 3D model in Labview?

0 Kudos
Message 12 of 15

Thanks for your vi posted, but it's looks a very complex solution. It's possible that LV can't import in simplest way a 3D model? In says that LV can load only STL, VRML or ASE (the last two are very rare!). If STL format is a blank mesh, how can I apply material to it? I can't find any examples about it.


At this point I change my original question: if you wanted to import a 3D model, how would you do (in the easiest way, of course)?

0 Kudos
Message 13 of 15



LabVIEW has developed the VRML 2.0 (or 95, but notice that the 1.0 version is not supported) the preferred format to import into the 3D Picture control. If you have this option, please use VRML (.wrl) format. Unfortunately, the export process depends a lot of the options available on your CAD system and it takes a while to understand its options. I personally used SolidWorks and I noticed that the export (and size) depends of the zoom number to when you are tying to export. Also, there are additional 'option' that you have to set to make it easy to open in LabVIEW (like removing the 'fidelity' number to reduce the amount of polygons). 


So, in short, it depends of your CAD system and what is the objective of your animation.


Here is an example of some code where we import a VRML file and an ASE and place them together on the same scene with some movement:


C:\Program Files (x86)\National Instruments\LabVIEW 2014\examples\Graphics and Sound\3D Picture Control\Importing Model and Setting


Those example were introduced in 2013 (If I am not mistaken)....



Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 14 of 15

A lot of STL models out there don't have normals (it is not a requirement for STL models). Without the normals, you will not get the shading that makes the features come out of a single-color model. Below, I downlaoded a .stl model from the internet and all the normals were 0,0,0. I plotted the model using the equivalent VI's to yours (the "set geometry" method appear to be obsolete). The code and resulting 3D picture are shown below.


The problem is the missing normals. That can be easily fixed by calculating the normals using the vertices of the triangles. Below is the code:

test stl load.png


Marc Dubois
Message 15 of 15