function [] = plotparts(shape,visible,hax,x0,y0)

partsdef
shape = reshape(shape,[parts_nvtot 2]);

xy = zeros(0);
for ip=1:parts_np
  idx = parts_nvcum(ip)+1:parts_nvcum(ip+1);
  xy{ip} = shape(idx,:);
end

axes(hax);
hold on
for ip=1:parts_np
  if ~visible(ip)
    continue;
  end
  
  for ic=parts_nccum(ip)+1:parts_nccum(ip+1)
    buf = xy{ip}(parts_curv{ic},:);
    line(buf(:,1)+x0,buf(:,2)+y0,'Color',parts_clr{ip},'LineWidth',1.5);
  end
end
hold off
