Ideas on machine learning algorithms to paint on a canvas I am completely new to machine learning.
I explain the problem with an example.
I have a two dimensional white canvas.
The shape of the canvas is an arbitrary closed curve.
I have a brush, it is represented as a circle having a radius small enough to reach all corners of the canvas.
I have also blue paint.
I would like use a machine learning algorithm to create a trajectory of the brush in order to paint all the canvas in blue.
I attach a sketch of the problem.

Q1) Is there any machine learning algorithm available for such kind of problems?
Q2) If an algorithm does not exist, then may you indicate any reference I could study (book, paper, website) to learn how to write such an algorithm, please?
Any other suggestion of where to focus my studies for this problem is appreciated.
In my problem I have a "painter" acting as a reference motion. I would like my machine learning to mimic the painter.

I think that you have fallen into a common trap, and it is worth addressing early in your machine learning journey, even if this is more like an extended comment than an answer.
Machine learning is interesting, machine learning can solve difficult problems, and machine learning can get you a job that pays a lot of money.
Machine learning is not everything, and machine learning is not synonymous with writing Python code that does math or works with data.
If you just want to paint the shape blue, I do not see this as a machine learning problem. The comment by User20160 gets into some ways to solve the problem.
As the saying goes, to the carpenter who only has a hammer, everything looks like a nail, yet the good carpenter will also have a saw. Some aspects of carpentry just are not tasks for a hammer.
Machine learning is your hammer, but you should solve this with a saw (better yet, a paintbrush).
