auto_hinges function

Guess whether insertion of hinges is needed or not