[geometry] Applied (slightly adapted) patch by Karsten Ahnert sent to me Jul 25, fixing disjoint for degenerate segments