The theory of braids and the analysis of impossible figures