function y = count_3Dpoly_sides(k,poly3D)
%k = conhulln(poly3D);
%Counting the number of extra triangles which K shows
len2 = length(k);
extra_surf = 0;
for i = 1:len2 - 1
    for j = i+1 : len2
        a = intersect(k(i,:),k(j,:));
        if length(a)==2
            crs_i = cross(poly3D(k(i,2),:)-poly3D(k(i,1),:), poly3D(k(i,3),:)-poly3D(k(i,1),:));
            n_hat_i = crs_i/norm(crs_i);
            crs_j = cross(poly3D(k(j,2),:)-poly3D(k(j,1),:), poly3D(k(j,3),:)-poly3D(k(j,1),:));
            n_hat_j = crs_j/norm(crs_j);
            if (n_hat_i == n_hat_j) | (n_hat_i == -n_hat_j)
                extra_surf = extra_surf +1;
            end
            
        end
        
    end
end

y = len2 - extra_surf;

end
