stlwrite error: Tetrahedron triangulation is not supported.

조회 수: 32 (최근 30일)
Adam Wathieu
Adam Wathieu 2019년 7월 25일
댓글: Abdel-rahman Mryyan 2022년 4월 24일
Hello,
I am attempting to convert my alphashape object into an STL file by using stlwrite. This is the code I have so far, and an image of the alphaShape object:
shp = alphaShape(app.Schunk.getVolCoordinates(), 100000);
[T, P] = alphaTriangulation(shp);
TR = triangulation(T, P)
stlwrite(TR, 'STLfileFromApp.stl');
Screen Shot 2019-07-25 at 2.13.59 PM.png
I keep getting the error
"Error using stlwrite (line 33)
Tetrahedron triangulation is not supported."
and I quite simply dont know how to fix it. Any help would be hugely appreciated. Thanks.
-Coding is love, coding is life.

채택된 답변

Guillaume
Guillaume 2019년 7월 29일
A 3D alphashape is a volume, therefore its triangulation is made of tetrahedrons not triangles. stlwrite only supports triangulations made of triangles, i.e. surfaces triangulations in 2D or 3D, not volumes triangulations. I don't know enough about the stl format to tell if it's a restriction of matlab or a restriction of the format itself. But, as it is now, it is impossible to write an alpha shape triangulation to an stl file with stlwrite. There may be some stlwiters on the FileExchange that may work (I haven't looked).
Alternatively, you may just want to write the surface of your alpha shape. You can get the triangles making that surface with boundaryFacets. Maybe that's what you're after, in which case:
shp = alphaShape(app.Schunk.getVolCoordinates(), 100000);
[bf, P] = boundaryFacets(shp);
stlwrite(triangulation(bf, P), 'STLfileFromApp.stl');
  댓글 수: 2
Adam Wathieu
Adam Wathieu 2019년 7월 29일
Thank you so much! Exactly what I needed!
Abdel-rahman Mryyan
Abdel-rahman Mryyan 2022년 4월 24일
Thank you so much , you saved my time .

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

추가 답변 (1개)

Marcelo Moraes
Marcelo Moraes 2019년 7월 27일
Same trouble here.
  댓글 수: 1
Adam Wathieu
Adam Wathieu 2019년 7월 29일
Please put this in the comment section, as it is not an answer.

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

카테고리

Help CenterFile Exchange에서 Triangulation Representation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by