Wrote about this a bit at:
To explore it a bit more we look at a couple of tools:
and look into how they may be previewed.
A notable G-code previewer is:
https://tahlinc.com/products/cutviewer.html
Which specifically supports this sort of tooling via G-code comments:
(unfortunately, the developer has passed away, so its status is uncertain โ the website is off-line as of this writing: https://www.cutviewer.com/ )
Suggestions for other G-code previewing tools to try would be welcome (but see below).
Here, we will look into creating G-code and files and supporting this sort of tooling.