LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to import stl model: white shape!

Hi everyone Smiley Happy,
I have to to insert a head 3D model in stl format in the scene but when I do it, the result is a white shape without shadows. Like this

 

testa.jpg

 

Follows the block diagram that I use

 

block.jpg

 

I have downloaded many stl model from various sites but the result is ever the same. Only once seems to work: a dragon head model

 

dragon.jpg

 

I read somewhere that stl files don't support materials or textures, but why the dragon is visible and all the others models aren't visible? Are there methods to put material on clear 3D mesh? If so, can anyone show me some examples?

0 Kudos
Message 1 of 15
(5,014 Views)
This isn't specifically a LV answer, but a place where I worked a couple years ago had a 3D printer that used stl files as their input. We found that files created with some programs worked fine, but some programs created stl files that were unusable.

Long story short, the stl file standard might not be very "standard".

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 15
(4,986 Views)

Then, if the "stl file standard might not be very standard" how can I to import correctly a 3D model in labview? Maybe there is some strange option to export the model from 3D software? The stl files that I downloaded seems to be a clear meshes, without material property. If I want to add it how I have to do? 

0 Kudos
Message 3 of 15
(4,960 Views)

Looks like it got the mesh but not skin on that STL model which looks white...  Native LabVIEW 3D controls don't work well with all STL, depending on how the model was created (STL also comes in binary vs ASCII formats which is another limitation in LabVIEW).

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 4 of 15
(4,953 Views)

Yes, it seems to be a "blank" mesh without skin or material. So, how I can add or modify material of any 3D object? I tried to search in the web, but nothing: I have LV 2013 and the examples on the NI site uses blocks that aren't in my version (for example in http://www.ni.com/white-paper/7664/en/ in figure 20 use an "Add Material.vi" that has different input than my "Set Material.vi"). Can anyone explain me how to do it, starting from my block scheme above? Or link me a tutorial?

0 Kudos
Message 5 of 15
(4,939 Views)

Hi Thoraz,

Would it be possible to post the problem STL file, or a link to it?

It looks like the shape factes may be correctly imported, but not rendered/lighted adequately - possibly a problem with the "Normal" array wired to "Set Mesh Parameters".  If the "Normal" vectors are wrong or missing, maybe they can be reconstructed from the facet info ...

 

By the way, there's a PLY file format which also stores surfaces as sets of facets, though the PLY structure has a more efficient structure (non-redundant verticies) and is more flexible than STL.  The free "Meshlab" tool can be helpful when playing with these files. 

 

Cheers.

0 Kudos
Message 6 of 15
(4,924 Views)

@550nm wrote:

Hi Thoraz,

Would it be possible to post the problem STL file, or a link to it?

It looks like the shape factes may be correctly imported, but not rendered/lighted adequately - possibly a problem with the "Normal" array wired to "Set Mesh Parameters".  If the "Normal" vectors are wrong or missing, maybe they can be reconstructed from the facet info ...

 

By the way, there's a PLY file format which also stores surfaces as sets of facets, though the PLY structure has a more efficient structure (non-redundant verticies) and is more flexible than STL.  The free "Meshlab" tool can be helpful when playing with these files. 

 

Cheers.


Ah yes, lighting/shape facets could very well be the problem too - like what 550nm said.  You could also use Meshlab (highly recommended, it's a free opensource tool on sourceforge site) to fix those things and even orientation/etc if needed before importing the model in LabVIEW. Other alternative is tools from 3DStudio but that's far from free.  If the file is large then you could reduce complexity before importing since that will speed up rendering. Although Meshlab will involve some learning curve, it's definitely worth learning if you work with 3D models.

 

-BTC

(I'll have to check about PLY format, last I checked LabVIEW couldn't work with it)

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 7 of 15
(4,914 Views)

According to Wikipedia,  'STL files describe only the surface geometry of a three-dimensional object without any representation of color, texture or other common CAD model attributes.'

 

I would choose another format.

0 Kudos
Message 8 of 15
(4,887 Views)

Note "Load PLY File", attached.

It won't help the OP because this PLY reader can't read Normal-vector info

Spoiler
Smiley Embarassed

(Couldn't find an example PLY file that included the Normal Element...), however...

The normal vector info. in the STL format - when present/correct - does allow the 3D control to render the mesh with lighting/shading, as shown in the original post.

I'm sure it's possible to generate normals - if I recall correctly, it's the cross-product of any two facet edge-vectors - I'm just not sure how to get normal pointed "outward" instead of "inward".

 

Cheers! 

0 Kudos
Message 9 of 15
(4,850 Views)

Here's an example of two mesh plots - one using Normal vectors, one not.

This Bunny model comes from the Stanford 3D Scanning Repository.

(They had some other cool models, including a couple of dragons...)

All Models supplied are supplied in PLY format (without the Normal vectors).

 

The point is, Normal-vectors may explain " why the dragon is visible and all the others models aren't visible"

... and the Normal-vectors can be derived, if needed.

 

Cheers!

BunnyWithWithoutNormals.png

0 Kudos
Message 10 of 15
(4,831 Views)