fix polygon side intersection detection