Auto cut coords

Continuation of @dohmatob 's PR #291