Edge constraint algorithm as described by Anglada and Domiter part way implemented.