Hot to rotate pdegplot about Z, X, or Y axis?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, i imported stl model by using pdegplot comand, and want to ask is it possible to rotate it about z, x, or y axises? https://www.mathworks.com/help/pde/ug/stl-file-import.html here is example of stl file importing
0 commentaires
Réponses (1)
Shantanu Dixit
le 27 Mar 2025
Modifié(e) : Shantanu Dixit
le 27 Mar 2025
Hi Baisseyev,
If I understood your query correctly, you want to rotate the visualization of your STL model. You can achieve this using the 'view': https://in.mathworks.com/help/matlab/ref/view.html function in MATLAB, which allows to change the azimuth (horizontal rotation) and elevation (vertical rotation) angles without altering the actual model. Below is an example that displays a particular model from three different perspectives:
model = createpde();
importGeometry(model, 'MotherboardFragment1.stl');
figure;
% First subplot: Default top-down view
subplot(1,3,1);
pdegplot(model);
title('Top-Down View');
axis equal;
view([0, 90]); % Top-down view
% Second subplot: Rotated view (45° Azimuth, 30° Elevation)
subplot(1,3,2);
pdegplot(model);
title('Angled View (Az=45, El=30)');
axis equal;
view([45, 30]); % Custom rotation
% Third subplot: Side view (90° Azimuth, 0° Elevation)
subplot(1,3,3);
pdegplot(model);
title('Side View');
axis equal;
view([90, 0]); % Side view
If the actual geometry needs to be rotated rather than just changing the viewpoint, you can apply a rotation matrix to transform the model’s coordinates and use the rotated nodes to plot the figure using functions like 'trisurf': https://in.mathworks.com/help/matlab/ref/trisurf.html
Hope this helps!
0 commentaires
Voir également
Catégories
En savoir plus sur Geometry and Mesh dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!