Add detection of unsmooth connections

Preliminary version based on triangle geometry