some attempts to turn distance to signed distance.
groundwork for periodic domains