dimension of imported STL file
5 views (last 30 days)
Show older comments
I have imported a STL file of a CAD model which is designed with dimensions in mm. will the model imported in pdetoolbox will have dimensions in mm or m? if it have dimension in m then how to convert it into mm?
2 Comments
dpb
on 3 Aug 2019
Well, one would presume the dimensions would come with the file...why don't you pdegplot it and see what you get? I (also presume) the axis scaling would match the model dimensions.
The answer to what is actually imported will, I expect, make the second question moot...
Answers (1)
DGM
on 2 Apr 2025
Edited: DGM
on 3 Oct 2025 at 7:25
STL files contain no scale information. It's just a dimensionless shape. It's up to you to interpret what its units are supposed to be and scale it according to your expectations and needs. A 100x100 surface might be 100x100 mm, or it might be 100x100 km. Depends if it's a topological scan of a machined part or geographical data.
That said, there are sometimes nonstandard things crammed into STL files, so never say never. Some files may have units specified in the header text, but there is no standard regarding if or how they will be presented. That said, the built-in decoder does not return the header text, so you'd have to use something else if you want to find that information (if it exists). Automating its retrieval would take some foreknowledge of how it would be presented. I doubt any of the PDE toolbox tools attempt to look for such inconsistent, nonstandard information.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!