필터 지우기
필터 지우기

What does in the stlwrite command the optional argument SolidIndex exactly do?

조회 수: 1 (최근 30일)
Can anyone explain me how the SolidIndex argument works in the stlwrite command. I don't really understand the explanation for this issue in the respective documentation and still even don't have a rudimental clue for what it's good for...

채택된 답변

Chidvi Modala
Chidvi Modala 2020년 4월 14일
stlwrite(TR, filename) writes a triangulation TR to a binary STL file 'filename' in the order left to right. For example
P = [2.5 8.0; 6.5 8.0; 2.5 5.0; 6.5 5.0; 1.0 6.5; 8.0 6.5];
T = [5 3 1; 3 2 1; 3 4 2; 4 6 2];
TR = triangulation(T,P);
triplot(TR)
stlwrite(TR,'tritext.stl','text')
You can execute the above code, and open tritext.stl file. You can see that the order in which the triangles are defined in tritext.stl is from left to right as shown below
You can use 'SolidIndex' name-value pair to include a vector of identification.
stlwrite(TR,'tritext.stl','text','SolidIndex',[1 4 3 2])
You can replace the last line of previous example code with the above piece of code, and open tritext.stl file. You can see that the order in which the triangles are defined, is based on the 'SolidIndex' as shown below

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by