if the shapes are ordered like in your example, you could determine the bounding box of the object, make a 3d pointgrid that has the spacing of your boundingbox, then cull all points that are outside your shape (+offset), and copy the objects to the remaining points.
Thanks! This worked great. One question, If i were to set another form like a freeform organic shape and wanted to fill that, how would I go about doing that? From what I understand is that This is basically creating a box to fill based on the size inputs.
yes, this solution is restricted to a box shape. if you wanted to fill a free form shape, i would firstly voxelize it and then use box mapping to distribute the cylinder (in this case) to the free form.
daniel christev has two videos about voxelizing (among many other great videos) you can work with: