Borrar filtros
Borrar filtros

rotation around an edge

2 visualizaciones (últimos 30 días)
Adeb Aladeeb
Adeb Aladeeb el 17 de Abr. de 2023
Comentada: Adeb Aladeeb el 28 de Abr. de 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 comentario
DGM
DGM el 25 de Abr. de 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.

Iniciar sesión para comentar.

Respuesta aceptada

Amith
Amith el 25 de Abr. de 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 comentarios
Adeb Aladeeb
Adeb Aladeeb el 28 de Abr. de 2023
Thanks
Adeb Aladeeb
Adeb Aladeeb el 28 de Abr. de 2023
jetzt ich will eine methode zur Bestimmung des Energiepotentials zwischen den Posen finden

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by