Adaptation de shape.py de ycopin