this task is extremely difficult to do.
you must have a boundary polygon that you want to fill with a spiral
I think you already have
create a new smaller polygon by moving all the lines inward to the step.
This is like creating a dash line around a polygon. The pitch is the width of the screw, so at the beginning of the polygon it is 0 , and at the end it is d
remove invalid rows from newly created screw
Some lines at the corners and curvature will intersect. It is very difficult to detect / recover reliably after seeing
repeat (make the next screw) ... until a place for the screw is found
But now, after the first screw, the step is always d , this will not necessarily fill the entire form. For example, if you have a thinner spot on the figure, it will fill up much faster than the rest, so some holes may still remain.
You must discover them and process, as you see, see
Know that detection, if the area is full, is also not trivial
Here's what this approach looks like:

[Note]
If you forget about the spiral and want to fill the interior with a zigzag or similar pattern, then this is not so difficult.
Spiral filling creates a lot of difficult geometric problems, and if you do not know geometry and vector math, this task can be too difficult for a beginner or even an average skilled programmer in this field to make it work correctly. This is at least my opinion (as I did before), so treat it as such.
source share