
function plot_sphpoly_bnd(vertices)

% first vertex and last vertex are equal;
% after this stage the number of sides is N-1.
N=size(vertices,1);
if norm(vertices(1,:)-vertices(end,:)) > 0
    vertices(end+1,:)=vertices(1,:);
end

plot3(vertices(:,1),vertices(:,2),vertices(:,3),'mo','MarkerSize',16);

% R=norm(vertices(1,:));
% theta=(linspace(0,1,10))'; % useful for convex combination on each side
% pts=[];
% for k=1:N-1
%     V1=vertices(k,:);
%     V2=vertices(k+1,:);
%     P=bsxfun(@times,theta,V1)+bsxfun(@times,1-theta,V2);
%     normP=(vecnorm(P'))';
%     ptsL=[(R./normP).*P];
%     pts=[pts; ptsL];
%     plot3(ptsL(:,1),ptsL(:,2),ptsL(:,3),'m-','LineWidth',6);
%     hold on;
%     pause;
% end

% plot3(pts(:,1),pts(:,2),pts(:,3),'m-','LineWidth',6);
