added helperfunction to convert array to polydata