bug in mex signed distance