Add distance control in edge gen