Add polygons to extruded 2D object
version Remesh
If you want an even grid also on edges you can try to use modifier Remesh &gt; Sharps

or Blocks modifier directly on Silhouethe object... just use Solidify modifier before Remesh to let it works.

version Knife Project
Select Silhouette than Grid, go to Top View, switch to edit mode and search for Knife Project, but ...

... since silhouette use more vertices that grid you will have generated n-gons on edges that can be problematic for modifiers or modeling. You wil see :)


Notes:
If you need a grid on sides, extrude it after Knife Project. You can use Loop Cut Ctrl+R for that.
For some generated terrain you can use Displace modifier with Cloud texture ... here used on version Remesh &gt; Blocks &gt; Octree Depth 9