I am trying to look for my options for generating a custom infill pattern which complies to a geometry that I want to repeat. I can get the geometrical coordinates too in order to make the final shape. Has anyone done so previously?
From my experience, this is hard, particularly because slicers are not made to handle it well. They generally do their infill generation efficiently in terms of 2D geometry, built as a function of the layer height and the outline(s) in the layer. Of course you can actually make the infill pattern part of your model geometry, or use a separate model intersected with the interior of your model as the infill, but having the infill structure be 3D geometry means that the slicer will be quantizing it to layers, and will have a hard time generating exactly-one-line-thickness extrusions that print will for the infill cross sections.
If you do want to do this anyway, OpenSCAD provides the tools to do the necessary intersection of your generated geometry pattern with the model interior.