What does in the stlwrite command the optional argument SolidIndex exactly do?
4 views (last 30 days)
Show older comments
Hikmet Eren
on 20 Feb 2020
Commented: Hikmet Eren
on 20 Apr 2020
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...
0 Comments
Accepted Answer
Chidvi Modala
on 14 Apr 2020
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
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!