Asked by Ano
on 4 Dec 2018

Hello!

I have an STL file which contains the facets and vertices. My concern is about the way the facets are saved because I have noticed that the facets don't seem to have any common nodes with each other which is not obvious for me, so it would be very much appreciated if anyone can tell if this is normal or I am having some problem in my file!

Note: I have attached a screenshot of the STL file

Thank you and best regards!

Answer by Cris LaPierre
on 5 Dec 2018

Edited by Cris LaPierre
on 5 Dec 2018

Accepted Answer

How are you reading the file into MATLAB? If I follow the example on the stlread documentation, I can import and plot the mesh.

data = stlread('femur.stl');

trimesh(data,'FaceColor','none','EdgeColor','k')

The interesting thing is the numbers from the various files are different.

- stlread imports 33332x3 points and 66670x3 ConnectivityList
- Your screenshot shows the values similar to what I see in ConnectivityList, but 178726x3 of them.
- fv contains 66674x3 faces and 200022x3 vertices. How were faces and vertices created?

Ano
on 5 Dec 2018

thank you for your reply!

here what I get when executing the same line with the same version of Matlab that you are using!

Cris LaPierre
on 5 Dec 2018

What stl file are you loading? Please share your code as well.

Cris LaPierre
on 5 Dec 2018

Also, I suspect you are using a file exchange function, while I am using the function that comes with MATLAB. Please run the command

which stlread

I get 'C:\Program Files\MATLAB\R2018b\toolbox\matlab\polyfun\stlread.m'

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 2 Comments

## KSSV (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/433726-question-about-stl-file#comment_646049

## Ano (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/433726-question-about-stl-file#comment_646142

Sign in to comment.