% Zeichnen eines 2D-Fachwerks (Stabkraefte)
function drawfw2dsk (xy , km , kr , bk , sk , adds)

if nargin < 6 adds = '' ; end

[ne,n] = size (km) ;

% Fachwerk zeichnen:
drawfw2d (xy , km , kr , bk , adds) ;

% Elemente (Staebe) farblich kennzeichnen:
for i=1:ne
   k1 = km(i,1) ;
   k2 = km(i,2) ;
   if (sk(i) < 0) 
       c = 'g' ;
   elseif (sk(i) > 0)
       c = 'r' ;
   else
       c = 'b' ;
   end
   plot ([xy(k1,1) xy(k2,1)],[xy(k1,2) xy(k2,2)] , c ,'Linewidth' , 3) ;
   if nargin > 5 & strfind(adds,'e') > 0
     text ((xy(k1,1)+xy(k2,1))/2 , (xy(k1,2)+xy(k2,2))/2 , ...
            int2str(i) , 'Color' , 'k') ;
   end
   hold on ;
end
plot (xy(:,1) , xy(:,2) , 'ro' , 'MarkerEdgeColor','k', 'MarkerFaceColor','w') ;
title ('Rot - Zugstab,   Grün - Druckstab,   Blau - Nullstab') ;
