Change scale in stl text mesh file
fid=fopen('originalfiletxt.stl');
fid2=fopen('modfile.stl','w');
factor=1000;
while ~feof(fid)
tline = fgetl(fid);
disp(tline);
if(strfind(tline,'vertex')==1)
A=sscanf(tline,'%s %f %f %f');
fprintf(fid2,'%s %.14f %.14f %.14f\n','vertex',A(7)*factor,A(8)*factor,A(9)*factor);
else
fprintf(fid2,'%s\n',tline);
end
end
fclose(fid);
fclose(fid2);
Cite As
JCBod Bodoque (2024). Change scale in stl text mesh file (https://www.mathworks.com/matlabcentral/fileexchange/69082-change-scale-in-stl-text-mesh-file), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Data Import and Analysis > Data Import and Export > Standard File Formats > STL (STereoLithography) >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |