Does Cura have an algorithm for any infill percentage or does it just have specific patterns? Looking in the Cura interface, I can set any whole number 0-100 for the infill percentage. Does Cura have an algorithm to calculate a pattern for any of those possible values, or does it have a few patterns where it selects the closest one?
I fear I'm going to deny your question.  The infil percentage and the infil pattern are two orthogonal properties, both of which contribute to the strength, density, mass, and print time of an object.   Since there's no way for an algo to "know" what your desired outcome is, this can't be done.

Note - I used 'orthogonal' in the Hilbert sense, meaning neither property is a function of the other.