在Matlab中填充三维点间的凸区域

在Matlab中填充三维点间的凸区域,matlab,Matlab,我在Matlab中收集了一些3D点 PY=0.5000 0 0.5000; 0.5000 0.1250 0.3750; 0.5000 0.2500 0.2500; 0.5000 0.3750 0.1250; 0.6250 0 0.3750; 0.6250 0.1250 0.2500; 0.6250 0.2500 0.1250; 0.6250 0.

我在Matlab中收集了一些3D点

PY=0.5000         0    0.5000;
   0.5000    0.1250    0.3750;
   0.5000    0.2500    0.2500;
   0.5000    0.3750    0.1250;
   0.6250         0    0.3750;
   0.6250    0.1250    0.2500;
   0.6250    0.2500    0.1250;
   0.6250    0.3750         0;
   0.7500         0    0.2500;
   0.7500    0.1250    0.1250;
   0.7500    0.2500         0];
这些点是单元单纯形的一部分

close all
patch([0 0 1],[0 1 0],[1 0 0],[0.8 0.8 0.8]);
axis equal 
axis([0 1 0 1 0 1])
view(120,30)
 hold on
scatter3(PY(:,1), PY(:,2), PY(:,3))
问题:我想填充通过连接这些点得到的凸区域。我不能那样做。你能帮忙吗

这就是我试过的

1)
CHPY=convhull(PY(:,1),PY(:,2),PY(:,3))

这给了我一个错误

Error computing the convex hull. The points may be coplanar or collinear.
2)

T = delaunayTriangulation(PY);
       K = convexHull(T);
这给了我一个错误

Error using delaunayTriangulation/convexHull
The triangulation is empty.

这应该是你的解决方案。在你的数据集上进行了测试,对我来说似乎是正确的。它很有效,谢谢,非常有用。