如果包围点的表面可以描述为convex polyhedron(即像立方体的表面或dodecahedron,没有凹坑或jagged pointy parts),那么我将首先创建一个3-D Delaunay triangulation 的点数。这将使用一系列以点为顶点的四面体元素填充点周围的体积,然后您可以使用DelaunayTri 的convexHull 方法找到形成体积外壳的三角形面集类。
这是一个示例,它生成 200 个均匀分布在单位立方体内的随机点,为这些点创建一个四面体网格,然后找到该体积的 3-D 凸包:
interiorPoints = rand(200,3); %# Generate 200 3-D points
DT = DelaunayTri(interiorPoints); %# Create the tetrahedral mesh
hullFacets = convexHull(DT); %# Find the facets of the convex hull
%# Plot the scattered points:
subplot(2,2,1);
scatter3(interiorPoints(:,1),interiorPoints(:,2),interiorPoints(:,3),'.');
axis equal;
title('Interior points');
%# Plot the tetrahedral mesh:
subplot(2,2,2);
tetramesh(DT);
axis equal;
title('Tetrahedral mesh');
%# Plot the 3-D convex hull:
subplot(2,2,3);
trisurf(hullFacets,DT.X(:,1),DT.X(:,2),DT.X(:,3),'FaceColor','c')
axis equal;
title('Convex hull');