Shape of curves and surfaces : the combinatorics