How can I create a 3D repeating pattern on top of a flat surface?
Another solution is to use tissue add-on

Model your base shape:

Create a component shape (the shape on top of final object)

Select the component object first, and then the base object, and click tessellate.

Note that the order in which you select the objects is important with tissue, if selection is done in the incorrect order you will up with strange results.


Adjust options in redo panel F9



For this object, it was needed to merge by distance and extrude the bottom faces in -Z. This step may vary per object use case.
Also, can select border faces and Alt+E &gt;Extrude Faces Along Normals to create an extended border around the object.


Result: