Created
October 16, 2012 16:53
-
-
Save RCura/3900523 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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