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

3 views (last 30 days)
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

Accepted Answer

Mike Garrity
Mike Garrity on 21 Jan 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 Comments
Mike Garrity
Mike Garrity on 21 Jan 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)

Sign in to comment.

More Answers (0)

Categories

Find more on Bounding Regions in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!