Function getConnectedPoints

Gets connected point indices from the lines array