def removeEndpoints(layerInfillWidth, paths, pixelTable, removedEndpoints, aroundWidth):
 for removedEndpointIndex in xrange((len(removedEndpoints) - 1), (-1), (-1)):
  removedEndpoint = removedEndpoints[removedEndpointIndex]
  removedEndpointPoint = removedEndpoint.point
  if isPointAddedAroundClosest(layerInfillWidth, paths, pixelTable, removedEndpointPoint, aroundWidth):
   removedEndpoints.remove(removedEndpoint)

def removeEndpoints ( layerInfillWidth , paths , pixelTable , removedEndpoints , aroundWidth ) : for removedEndpointIndex in xrange ( ( len ( removedEndpoints ) - 1 ) , ( - 1 ) , ( - 1 ) ) : removedEndpoint = removedEndpoints [ removedEndpointIndex ] removedEndpointPoint = removedEndpoint . point if isPointAddedAroundClosest ( layerInfillWidth , paths , pixelTable , removedEndpointPoint , aroundWidth ) : removedEndpoints . remove ( removedEndpoint )
remove endpoints which are added to the path .