How to rotate an Alpha Shape, or points that defines the edge of a 3D shape?

3 visualizaciones (últimos 30 días)
Hello,
I am trying to rotate a 3-D surface which composed of 1000 points defined in space. I turned these points to a surface by using alphashape function.
I tried to rotate with "rotate" function but, I got type error;
Error in rotate (line 59)
t = get(h(i),'type');
Can you suggest me a solution?
For additional information, please ask it.
Thanks in advance, Mücahit

Respuesta aceptada

Mike Garrity
Mike Garrity el 21 de En. de 2016
Could you post your code?
Here's a modified version of one of the examples:
[x1, y1, z1] = sphere(24);
x1 = x1(:);
y1 = y1(:);
z1 = z1(:);
x2 = x1+5;
P = [x1 y1 z1; x2 y1 z1];
P = unique(P,'rows');
shp = alphaShape(P,1)
h = plot(shp);
axis vis3d
for i=1:12
rotate(h,[1 1 1],30)
pause(.25)
end
  3 comentarios
Mike Garrity
Mike Garrity el 21 de En. de 2016
Ah, the rotate function wants the handle of the graphics object, not the alphaShape. The graphics object is created by the plot function. So you need something like:
h = plot(as_rock,'FaceColor', ...
...
rotate(h,direction,25,origin)
Mücahit Gürbüz
Mücahit Gürbüz el 21 de En. de 2016
Thank you my friend :) it worked as I wanted.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Bounding Regions en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by