Filter löschen
Filter löschen

rotation around an edge

2 Ansichten (letzte 30 Tage)
Adeb Aladeeb
Adeb Aladeeb am 17 Apr. 2023
Kommentiert: Adeb Aladeeb am 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 Kommentar
DGM
DGM am 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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Amith
Amith am 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 Kommentare
Adeb Aladeeb
Adeb Aladeeb am 28 Apr. 2023
Thanks
Adeb Aladeeb
Adeb Aladeeb am 28 Apr. 2023
jetzt ich will eine methode zur Bestimmung des Energiepotentials zwischen den Posen finden

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by