def getEndpointFromPath(path, pathIndex):
 begin = path[(-1)]
 end = path[(-2)]
 endpointBegin = Endpoint()
 endpointEnd = Endpoint().getFromOtherPoint(endpointBegin, end)
 endpointBegin.getFromOtherPoint(endpointEnd, begin)
 endpointBegin.path = path
 endpointBegin.pathIndex = pathIndex
 return endpointBegin

def getEndpointFromPath ( path , pathIndex ) : begin = path [ ( - 1 ) ] end = path [ ( - 2 ) ] endpointBegin = Endpoint ( ) endpointEnd = Endpoint ( ) . getFromOtherPoint ( endpointBegin , end ) endpointBegin . getFromOtherPoint ( endpointEnd , begin ) endpointBegin . path = path endpointBegin . pathIndex = pathIndex return endpointBegin
get endpoint segment from a path .