script with k means 3d