function points = h3d_test_shape(i) switch i case 1 [X,Y,Z] = peaks(15); s = 1/6; points = xyz2points(X*s,Y*s,Z*s); case 2 [X,Y,Z] = peaks(15); s = 1/6; points = xyz2points(X*s,Y*s,Z*0); case 'pyramid' V = [0 0 0; 0.5 0.5 0; 1 0 0; 0.5 0.3 1]'; points = V; k = 5; for i = 1:3 for j = i+1:4 delta = 0.15; for alpha=0:delta:1-delta p = V(:,i) * alpha + (1-alpha)*V(:,j); points(:,k) = p; k = k + 1; end end end end function points = xyz2points(X,Y,Z) points = [0;0;0]; k = 1; for i=1:size(X,1) for j=1:size(X,2) points(:,k) = [X(i,j); Y(i,j); Z(i,j)]; k = k + 1; end end