A line distancer over previous layer is constructed. It is then queried during travel planing. If an obstacle is found in the travel path, the travel algorithm ensures minimal elevation before the obstacle.