signed distance mex