Hi Alice,
I understand that you would like to scale down the STL surface.
The following steps outline an approach that can be taken:
- Retrieve vertices from the triangulation object:
- Determine the scale factor for each dimension (adjust as needed):
scaledVertices = vertices * scaleFactor;
trisurf(fv.ConnectivityList, scaledVertices(:, 1), scaledVertices(:, 2), scaledVertices(:, 3), 'FaceColor', [0.8 0.8 1.0], 'EdgeColor', 'none', 'FaceLighting', 'gouraud', 'AmbientStrength', 0.15);
The below code snippet demonstrates the scaling of the STL surface using "Torus.stl":
fv = stlread('Torus.stl');
scaledVertices = vertices * scaleFactor;
trisurf(fv.ConnectivityList, scaledVertices(:, 1), scaledVertices(:, 2), scaledVertices(:, 3), ...
'FaceColor', [0.8 0.8 1.0], 'EdgeColor', 'none', 'FaceLighting', 'gouraud', 'AmbientStrength', 0.15);
xlabel('X'); ylabel('Y'); zlabel('Z');
title('Scaled STL Surface');
Refer the below MathWorks documentations to know more about "stlread" and “trisurf”:
Hope this helps!