def getCircleIntersectionsFromCircleNodes(circleNodes):
 if (len(circleNodes) < 1):
  return []
 circleIntersections = []
 index = 0
 pixelTable = {}
 for circleNode in circleNodes:
  euclidean.addElementToPixelListFromPoint(circleNode, pixelTable, circleNode.circle)
 accumulatedCircleNodeTable = {}
 for circleNodeIndex in xrange(len(circleNodes)):
  circleNodeBehind = circleNodes[circleNodeIndex]
  circleNodeIndexMinusOne = (circleNodeIndex - 1)
  if (circleNodeIndexMinusOne >= 0):
   circleNodeAdditional = circleNodes[circleNodeIndexMinusOne]
   euclidean.addElementToPixelListFromPoint(circleNodeAdditional, accumulatedCircleNodeTable, (0.5 * circleNodeAdditional.circle))
  withinNodes = circleNodeBehind.getWithinNodes(accumulatedCircleNodeTable)
  for circleNodeAhead in withinNodes:
   circleIntersectionForward = CircleIntersection(circleNodeAhead, index, circleNodeBehind)
   if (not circleIntersectionForward.isWithinCircles(pixelTable)):
    circleIntersections.append(circleIntersectionForward)
    circleNodeBehind.circleIntersections.append(circleIntersectionForward)
    index += 1
   circleIntersectionBackward = CircleIntersection(circleNodeBehind, index, circleNodeAhead)
   if (not circleIntersectionBackward.isWithinCircles(pixelTable)):
    circleIntersections.append(circleIntersectionBackward)
    circleNodeAhead.circleIntersections.append(circleIntersectionBackward)
    index += 1
 return circleIntersections

def getCircleIntersectionsFromCircleNodes ( circleNodes ) : if ( len ( circleNodes ) < 1 ) : return [ ] circleIntersections = [ ] index = 0 pixelTable = { } for circleNode in circleNodes : euclidean . addElementToPixelListFromPoint ( circleNode , pixelTable , circleNode . circle ) accumulatedCircleNodeTable = { } for circleNodeIndex in xrange ( len ( circleNodes ) ) : circleNodeBehind = circleNodes [ circleNodeIndex ] circleNodeIndexMinusOne = ( circleNodeIndex - 1 ) if ( circleNodeIndexMinusOne >= 0 ) : circleNodeAdditional = circleNodes [ circleNodeIndexMinusOne ] euclidean . addElementToPixelListFromPoint ( circleNodeAdditional , accumulatedCircleNodeTable , ( 0.5 * circleNodeAdditional . circle ) ) withinNodes = circleNodeBehind . getWithinNodes ( accumulatedCircleNodeTable ) for circleNodeAhead in withinNodes : circleIntersectionForward = CircleIntersection ( circleNodeAhead , index , circleNodeBehind ) if ( not circleIntersectionForward . isWithinCircles ( pixelTable ) ) : circleIntersections . append ( circleIntersectionForward ) circleNodeBehind . circleIntersections . append ( circleIntersectionForward ) index += 1 circleIntersectionBackward = CircleIntersection ( circleNodeBehind , index , circleNodeAhead ) if ( not circleIntersectionBackward . isWithinCircles ( pixelTable ) ) : circleIntersections . append ( circleIntersectionBackward ) circleNodeAhead . circleIntersections . append ( circleIntersectionBackward ) index += 1 return circleIntersections
get all the circle intersections which exist between all the circle nodes .