How to Import vertexes and facet from a STL "ASCII" file ?

조회 수: 14 (최근 30일)
Pierrick Bersier
Pierrick Bersier 2014년 9월 6일
편집: DGM 2025년 9월 27일
I'm searching for a script witch I can import the vertexes coordinate and the facet form an STL ASCII file. The only one I find for ASCCI and not for binary import only the vertexes and thus It's difficult to draw the surface after it.
Can somebody help ?
  댓글 수: 3
Pierrick Bersier
Pierrick Bersier 2014년 10월 1일
Yes I seen it. But I did not get it to run properly. I had an error every time I tried.
DGM
DGM 2025년 7월 12일
편집: DGM 2025년 9월 27일
The problem with FEX #30923 is that it can only read ASCII encoded files -- and only ones with windows-style line breaks. While those are its limitations, it doesn't actually test anything, so a binary encoded file, or an ASCII encoded file with unix line breaks will result in an unhelpful error message. It also has some other minor bugs which may silently cause problems depending on header content.
Internally, read_stl() from the IFIT toolbox (the accepted answer) uses the Trautmann decoder, but if it fails, it falls back to a different ASCII decoder. If the second decoder fails, it falls back to a binary decoder. It's kind of ridiculous that nowhere along the way is the encoding checked.

댓글을 달려면 로그인하십시오.

채택된 답변

Pierrick Bersier
Pierrick Bersier 2014년 10월 1일
Meanwhile I fine here a script that works directly for me:
It gives out the vertexes, the faces and the normals.
  댓글 수: 1
DGM
DGM 2025년 7월 12일
편집: DGM 2025년 7월 12일
Link is dead, but this is a different version. It's since moved again.
Since R2018b, MATLAB has built-in STL tools
For legacy versions needing third-party tools, I'd recommend these tools. This explains why.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 STL (STereoLithography)에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by