rotation around an edge

3 次查看(过去 30 天)
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 个评论
DGM
DGM 2023-4-25
It's not clear to anyone which edge you're trying to rotate around, or whether the point you chose is on that edge.

请先登录,再进行评论。

采纳的回答

Amith
Amith 2023-4-25
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 个评论
Adeb Aladeeb
Adeb Aladeeb 2023-4-28
jetzt ich will eine methode zur Bestimmung des Energiepotentials zwischen den Posen finden

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by