<p>I understand how slicer programs create sets of closed-loop polygons to print on a layer-by-layer basis.  For a given closed loop polygon which needs to be printed, the tool path generator will know the coordinates and how those coordinates are connected to each other, such that traversing a set of segments in that order will bring the extruder head back to the first coordinate to complete the closed loop.</p>

<p>My question is: By what mechanism does the tool path generator decide which direction to traverse the closed loop?  As it is a loop, that loop could be printed "clockwise" or "counter-clockwise", as it were.  Any details, and links to further explanations of how some of the big-name slicer programs determine this is much appreciated.</p>

Math
In math, there is a way how a path is to be followed, and that is usually counterclockwise:
Assuming a perimeter path of a circle with
$r=1$
around
$(2,2)$
, then the  path can be defined as
$f(p)={{\cos(p)+2}\choose{\sin(p)+2}}$
- where
$p$
is the path parameter, in this case an angle of 0 to 360°, and just increasing the angle rotates right hand around. If we had the same path but a different starting point, a shift by
$\theta$
, then the path would read
$f(p)={{\cos(p+\theta)+2}\choose{\sin(p+\theta)+2}}$
. So math is usually
counterclockwise
.
Slicers
Every slicer is applying math. As far as I can tell, any Slicer generates a perimeter path, which is always performed in the same way if sliced with the same settings. For one case look at this:
Counterclockwise starting from a 7 o clock position in this case. However, other slicers or other objects on the printbed might use other engines, thus doing it not that way. They might go clockwise since solving a path with
$p=0°\to360°$
and solving it
$p=360°\to0°$
results in producing the exact same print, just opposed print direction of the perimeter.
As long as the perimeter of an object is solved as being done as one closed loop, the perimeter will need to have just one, prescribed direction. This direction will be clockwise or counterclockwise depending on how the slicer exactly solves its calculations. Since both directions are equally valid, it is a programmer's decision. A programmer might even prescribe clockwise or counterclockwise solution based on any factor they wanted. They might use layer number (for alternating directions) or a user setting or even an RNG, if they wanted to.
On the other hand, how the memory is operated and written can also result in the path and the math looking differently. Two examples:
Solving the path correctly counterclockwise and putting the slicing into a FILO memory, resulting in a clockwise operation starting from the last solved point.
Solving counterclockwise and saving into FIFO, running counterclockwise.
Conclusion
Slicers for 3D printing have a hard-coded way to choose the direction that is followed when producing G-code. Any and all perimeters will be printed, starting from some arbitrary point, into that direction. In the end, it is a choice of the
programmer
of the slicing engine that determines if the path is to be run down "forward" or "backward" in mathematical sense.
Addendum
Slicers are derived from CAM programming. CAM - computer assisted machining - takes into account one more thing when solving the tool path that is not relevant to a 3D printer: The direction of the fluting of the tool. In fact, this one will determine into which direction the path will give a better cut and changing the fluting should swap the path direction to ensure best results.