def addConnectionVertexes(connectionVertexes, geometryOutput):
 if (geometryOutput.__class__ == list):
  for element in geometryOutput:
   addConnectionVertexes(connectionVertexes, element)
  return
 if (geometryOutput.__class__ != dict):
  return
 for geometryOutputKey in geometryOutput.keys():
  geometryOutputValue = geometryOutput[geometryOutputKey]
  if ((geometryOutputKey == 'connectionStart') or (geometryOutputKey == 'connectionEnd')):
   connectionVertexes.append(geometryOutputValue)
  elif (geometryOutputKey == 'vertex'):
   for vertex in geometryOutputValue:
    connectionVertexes.append(vertex)
  else:
   addConnectionVertexes(connectionVertexes, geometryOutputValue)

def addConnectionVertexes ( connectionVertexes , geometryOutput ) : if ( geometryOutput . __class__ == list ) : for element in geometryOutput : addConnectionVertexes ( connectionVertexes , element ) return if ( geometryOutput . __class__ != dict ) : return for geometryOutputKey in geometryOutput . keys ( ) : geometryOutputValue = geometryOutput [ geometryOutputKey ] if ( ( geometryOutputKey == 'connectionStart' ) or ( geometryOutputKey == 'connectionEnd' ) ) : connectionVertexes . append ( geometryOutputValue ) elif ( geometryOutputKey == 'vertex' ) : for vertex in geometryOutputValue : connectionVertexes . append ( vertex ) else : addConnectionVertexes ( connectionVertexes , geometryOutputValue )
add the connections and vertexes .