Sketcher Constraints: small code refactor

Unifying first checks in grad().