function [VV, nVVbig] = tjsr_getpolytope(type);   
% VV = tjsr_getpolytope(type);   
% This function belongs to tjsr!
% select the vertices which make up the current polytope
% Input:
%   type        the type struct from tjsr
%
% Output:
%   VV          selected vertices
%   nVVbig      number of vertices of the polytope, without removed vertices
%   some text output
%
% Written by tommsch, 2018

    VV=[type.cyclictree.V{:}]; %get all vertices
    idx=true(1,size(VV,2)); %indices of all vertices
    
    idx_norm=[type.cyclictree.norm{:}]>1-type.opt.epspolytope; 
    idx=idx & idx_norm; %only select vertices which are outside the polytope
    nVVbig=nnz(idx);
    
    if(type.opt.simplepolytope && length(type.JSR)>1);
        val=min(type.opt.simplepolytope, (type.JSR(2)/type.JSR(1)-1)/1000)-type.opt.epslinprog;
        idx_dist=[type.cyclictree.norm{:}]>1+val;
        idx=idx & idx_dist; %only select vertices which are far away from other vertices 
    end
    
    VV=VV(:,idx); %remove all unselected vertices
    VV=removezero(VV,2); %remove empty columns
    
end