Skip to content

Instantly share code, notes, and snippets.

@RCura
Created October 16, 2012 16:53
Show Gist options
  • Save RCura/3900523 to your computer and use it in GitHub Desktop.
Save RCura/3900523 to your computer and use it in GitHub Desktop.
def selfIntersection(x, y):
"""
ATTENTION A NE PAS LANCER LE TEST SUR DES GEOMETRIES INFERIEUR A TROIS COORDONNEES DISTINCTES
"""
print x, y
for i in xrange(len(x)-1):
xSeg1 = [x[i], x[i+1]]
ySeg1 = [y[i], y[i+1]]
seg1 = guilabs.createGeometry(2, xSeg1, ySeg1)
for j in xrange(i + 2, len(x)-3):
xSeg2 = [x[i+j+2],x[i+j+3]]
ySeg2 = [y[i+j+2],y[i+j+3]]
seg2 = guilabs.createGeometry(2, xSeg2, ySeg2)
result = seg1.Intersect(seg2)
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment