Plotting "interior" and "exterior" convex hull of 3d shape

Viewed 161

I want to estimate the shape of convex 3d object. First let me give an example on 2d:

enter image description here

Lets say there is convex shape given by black color in the figure. We don't know its shape, but we are given points A,B,C,D. Using convexhull and trisurf commands on Matlab, we can plot "interior" convex hull given by blue color. Now, if we are given not only points A,B,C,D but also tangent lines to the black colored object through these points, we can plot "outer" convex hull through the points A1,B1,C1,D1. The "outer" convex hull is more difficult to plot, because there are many points where tangent lines intersect, so we need to find some way to obtain specifically A1,B1,C1,D1.

In 3d, we are given the points and tangent planes to these points in terms of plane equations ax+by+cz=d. Here is Matlab program that generates next two figures:

load("planedata.mat");
load("planedata_d.mat");
load("points.mat");

a=planedata(1:100,1);
b=planedata(1:100,2);
c=planedata(1:100,3);
d=planedata_d;

figure(1)
x = points(1,:); y = points(2,:); z = points(3,:);
[k1,av1] = convhull(x,y,z);
trisurf(k1,x,y,z);                    %plot interior convex hull
xlabel('$X$','Interpreter','latex');
ylabel('$Y$','Interpreter','latex');
zlabel('$Z$','Interpreter','latex');

figure(2)
[X,Y] = meshgrid(x,y);
for i=1:100
    Z=real(-(a(i)*X+b(i)*Y+d(i))/c(i));
    hold on
    surf(X,Y,Z);                      %plot exterior convex hull
end
xlim([-1 2])
ylim([-1 2])
zlim([0 4])
xlabel('$X$','Interpreter','latex');
ylabel('$Y$','Interpreter','latex');
zlabel('$Z$','Interpreter','latex');

You can download the data file from here. First, we just plot "interior" convex hull for given points:

enter image description here

Then the tangent planes:

enter image description here

And also I can see the shape of the "exterior" convex hull only by cutting all planes at specific height like this:

enter image description here

Is there any way to remove all the planes and plot only the "exterior" convex hull, so the figure looks like "interior" convex hull, but of course a little larger in size?

0 Answers
Related