- v1 = Vector(P.v[i-1])
- v1[2] = 0
- v2 = Vector(P.v[i])
- v2[2] = 0
-
- EPS = 10e-7
-
- for j in range(0, len(Q.v)):
- v3 = Vector(Q.v[j-1])
- v3[2] = 0
- v4 = Vector(Q.v[j])
- v4[2] = 0
-
- ret = LineIntersect(v1, v2, v3, v4)
- # if line v1-v2 and v3-v4 intersect both return
- # values are the same.
- if ret and ret[0] == ret[1] and isOnSegment(v1, v2,
- ret[0], True) and isOnSegment(v3, v4, ret[1], True):
-
-
- l1 = (ret[0] - v1).length
- l2 = (ret[0] - v2).length
-
- l3 = (ret[1] - v3).length
- l4 = (ret[1] - v4).length
-
- if (l1 < EPS or l2 < EPS) and (l3 < EPS or l4 < EPS):
- continue
-
- debug("Projections OVERLAP!!\n")
- debug("line1:"+
- " M "+ str(v1[0])+','+str(v1[1]) + ' L ' + str(v2[0])+','+str(v2[1]) + '\n' +
- " M "+ str(v3[0])+','+str(v3[1]) + ' L ' + str(v4[0])+','+str(v4[1]) + '\n' +
- "\n")
- debug("return: "+ str(ret)+"\n")
- return True
-
- return False
-
-
- from facesplit import facesplit