Azzera filtri
Azzera filtri

rotation around an edge

2 visualizzazioni (ultimi 30 giorni)
Adeb Aladeeb
Adeb Aladeeb il 17 Apr 2023
Commentato: Adeb Aladeeb il 28 Apr 2023
i want to determine the orientation sequences of the stl file. does anyone have an idea. i have written the code but it revolves around a specific point not the edge..you can see the image when i rotate 90 gard around y axis
figure
gm = importGeometry("Teil1.stl");
pdegplot(gm)
vertices = gm.Vertices;
%xs3 = s3.Vertices(:,1);
%ys3 = s3.Vertices(:,2);
%zs3 = s3.Vertices(:,3);
% Define the point around which to rotate the figure
point = vertices(1,:) ; % change the values according to your desired rotation point
% Rotate the figure around the specified point
gm2 = rotate(gm,90, [1 0 0], point)
figure
pdegplot(gm2)
% Rotate the figure around the specified point
gm3 = rotate(gm2,90, [0 0 1], point)
figure
pdegplot(gm3)
gm4 = rotate(gm3,90, [0 0 1], point)
figure
pdegplot(gm4)
vertices = gm.Vertices;
gm5 = rotate(gm4,90, [1 0 0], point)
figure
pdegplot(gm5)
  1 Commento
DGM
DGM il 25 Apr 2023
It's not clear to anyone which edge you're trying to rotate around, or whether the point you chose is on that edge.

Accedi per commentare.

Risposta accettata

Amith
Amith il 25 Apr 2023
Hi,
From your question I understand that you wanted the image to be rotated along a particular edge instead of a point . You can use a function called
imrotate()
to do the same.
Refer the code below to apply the same according to your needs.
% Read the image
im = imread('your_image.jpg');
% Find the edge pixels along the top edge <this you can find using your
% image>
edgePixels = [1: size(im,2); ones(1,size(im,2))];
% Rotate the image by 90 degrees along the edge
rotatedIm = imrotate(im, 90, <method> , edgePixels(:,1));
% Display the rotated image
imshow(rotatedIm);
You can use this link to read more about imshow()
  3 Commenti
Adeb Aladeeb
Adeb Aladeeb il 28 Apr 2023
Thanks
Adeb Aladeeb
Adeb Aladeeb il 28 Apr 2023
jetzt ich will eine methode zur Bestimmung des Energiepotentials zwischen den Posen finden

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by