Try to make distance between a point and a segment s1 equal to padding.