%% 3-D Delaunay Triangulation
% Create a 3-D delaunayTriangulation object for 30 random points.

x = gallery('uniformdata',[30 1],0);
y = gallery('uniformdata',[30 1],1);
z = gallery('uniformdata',[30 1],2);
DT = delaunayTriangulation(x,y,z)

%
% Plot the triangulation.

tetramesh(DT,'FaceAlpha',0.3);

%
% Compute and plot the convex hull of the triangulation.

[K,v] = convexHull(DT);
trisurf(K,DT.Points(:,1),DT.Points(:,2),DT.Points(:,3))

% Copyright 2012 The MathWorks, Inc.