I applied a question a few days ago here Filling contour levels with grain (texture) using Leaflet, I still found no answer I try to well exposed the problem here again in another way.
if we have a set of contour like this:
and if extracted from each contour with:
res
if we have a set of contour like this:

and if extracted from each contour with:
res