Drawing 3D voronoi polyhedrons over human body points

2 views (last 30 days)
I am trying to draw voronoi polyhedrons in 3D around a set of points(which are coordinates of the position of sensors) placed on a human frame. I found a couple of ways to do it in MATLAB. Except that none of them are giving me the right kind of polyhedrons. I understand voronoi in 3D for a set of points should appear like this. Refer link:
How I expected the graph to look like:refer fig1 For my set of data points, the voronoi polyhedrons do not encapsulate all of the points. The voronoi polyhedrons that are formed out of my data points look something like this:refer fig2 The data points are:
X= [116,191,0;
108,183,0;
120,175,0;
100,162,12;
116,166,8;
133,158,14;
100,150,0;
116,166,15;
125,144,8;
90,133,5;
108,133,2.5;
144,133,5;
116,116,15;
144,116,6.5;
108,100,-5;
150,100,15;
83,100,15;
108,83,14;
100,58,13;
133,50,13;
100,25,11;
133,30,12;
100,8.3,14;
133,8.3,14];
The code I used was:
plot3(X(:,1),X(:,2),X(:,3), '*');
hold on
dt = delaunayTriangulation(X);
[V,R] = voronoiDiagram(dt);
V(1,:) = [];
qrypts = [116,166,15];
tid = nearestNeighbor(dt,qrypts);
XR10 = V(R{tid},:);
K = convhull(XR10);
defaultFaceColor = [0.6875 0.8750 0.8984];
trisurf(K, XR10(:,1) ,XR10(:,2) ,XR10(:,3) , ...
'FaceColor', defaultFaceColor, 'FaceAlpha',0.9)
title('3-D Voronoi Region')
Please note that the vector V which hold the vertices of polygons has Inf values in the first row. I get an error like this due to the infinity values:
Error using convhull
The coordinates of the input points must be finite values; Inf and NaN are not permitted.
Error in best3D_original (line 38) K = convhull(XR10); Even if I forcefully remove the first row using the line:
V(1,:) = [];
I still don't get my required results. Also, if you compare my figure with the first figure, you'll see that all the points are not encapsulated by voronoi polyhedrons. Any help will be appreciated. Thank you.

Answers (0)

Categories

Find more on Voronoi Diagram 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!