How to get coordinates values X, Y, Z from the Meshed file in matlab?
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
I have a meshed bone model(stl file). I have to extract data points (X,Y, Z coordinates) from the model which has 4000 nodes.
Can anyone suggest some idea to proceed?
Accepted Answer
Ameer Hamza
on 18 Jun 2020
Edited: Ameer Hamza
on 19 Jun 2020
Something like this
TR = stlread('tristltext.stl');
x = TR.Points(:,1);
y = TR.Points(:,2);
z = TR.Points(:,3);
7 Comments
SASIREKHA DURAISAMY
on 18 Jun 2020
Hi, Thanks for your response.
I am getting an error like "Reference to non-existent field 'Points'".
we should define the term "points" before. Do you have any suggestions for this.
Ameer Hamza
on 18 Jun 2020
Points is a field in the struct returned by stlread() and it should automatically exist inside TR.
Which MATLAB release are you using?
SASIREKHA DURAISAMY
on 18 Jun 2020
R2019a
Ameer Hamza
on 18 Jun 2020
Can you show the output from the command window after running these lines
TR = stlread('tristltext.stl');
disp(TR)
SASIREKHA DURAISAMY
on 18 Jun 2020
Hi, It gives
faces: [10114×3 double]
vertices: [30342×3 double]
Ameer Hamza
on 19 Jun 2020
In this can, you can write
TR = stlread('tristltext.stl');
x = TR.vertices(:,1);
y = TR.vertices(:,2);
z = TR.vertices(:,3);
DGM
on 28 Jul 2025
OP was using FEX #22409 or a related third-party decoder. It has limitations and is not necessary in R2019a.
Since R2018b, MATLAB has built-in STL tools as described in the initial answer.
For legacy versions needing third-party tools, I'd recommend these tools over #22409. This explains why.
More Answers (0)
Categories
Find more on Polymers in Help Center and File Exchange
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)