From undulating Si quantum wires to Si quantum dots: a model for porous silicon