A model of a spiral galaxy with finite thickness